;'Event Center' - Player ran events

EventToRun = 0

If GetUserAccess(#USERID) > 5
	If Lower(GetUserMessage(#USERID))="block"
		SetUserFlag(0,48,1)
	ElseIf Lower(GetUserMessage(#USERID))="reset"
		SetUserFlag(0,48,0)
	ElseIf Lower(GetUserMessage(#USERID))="unblock"
		SetUserFlag(0,48,0)
	EndIf
	GoTo END
EndIf

If GetUserFlag(0,48) > 0
	If GetUserAccess(#USERID) < 6
		SendMessageToUser(#USERID,"You cannot run an event right now.",#MSG_SAY)
		GoTo END
	EndIf
EndIf

If GetUserFlag(0,10) <> 0
	SendMessageToUser(#USERID,"Another event is currently running.",#MSG_SAY)
EndIf

If Lower(GetUserMessage(#USERID))="race1"
	SetUserFlag(0,48,1)
ElseIf Lower(GetUserMessage(#USERID))="race2"
	SetUserFlag(0,48,0)
ElseIf Lower(GetUserMessage(#USERID))="race3"
	SetUserFlag(0,48,0)
Else
	SendMessageToUser(#USERID,"Type one of the following events to run it: 'race1', 'race2', 'race3'",#MSG_SAY)
EndIf

Label END

Continue = 1