;Event Starter for Players

If GetUserAccess(#USERID) > 4
	If Lower(GetUserMessage(#USERID))="reset"
		SendMessageToUser(#USERID,"Event system reset.",#MSG_SERVER)
		SetUserFlag(0,10,0)
		SetUserFlag(0,11,0)
		GoTo END
	EndIf
EndIf

;SendMessageToUser(#USERID,"More work is being done on the event system - Comrade",#MSG_SERVER)
GoTo END

If GetUserFlag(0,10)<>0
	SendMessageToUser(#USERID,"There is already an event in progress.",#MSG_SERVER)
	Goto End
EndIf

SetUserFlag(0,11,0)
SetUserFlag(1,10,-1)

MSG=Lower(GetUserMessage(#USERID))



If MSG="yes"
	SendMessageToUser(#USERID,"Which track? [water/forest/urban/desert]",#MSG_SAY)
	GoTo END
ElseIf MSG="water"
	SetUserFlag(0,10,1)
	EventName="Water Race"
	EventStartMap=500
	Script=148
ElseIf MSG="forest"
	SetUserFlag(0,10,2)
	EventName="Forest Race"
	EventStartMap=452
	Script=179
ElseIf MSG="urban"
	SetUserFlag(0,10,7)
	EventName="Urban Race"
	EventStartMap=580
	Script=253
ElseIf MSG="desert"
	SetUserFlag(0,10,9)
	EventName="Desert Race"
	EventStartMap=830
	Script=362
Else
	SendMessageToUser(#USERID,"Do you wish to start a race?",#MSG_SAY)
	GoTo END
EndIf

Timer(517,100,EventName,3,0)
Timer(Script,120000,EventStartMap,0,0)

Label END

Continue = 1