kuwalda Posted August 3, 2014 Share Posted August 3, 2014 Hello. I have made script that automalicly ends race for player after defined time, but it does not work(I belive clientside is wrong). Can anyone please find where did I go wrong? --trigger it from serverSide triggerClientEvent(thePlayer, "showTimeLeft", thePlayer, getTickCount() + 60000) --handle it from clientSide addEvent( "showTimeLeft", true ) addEventHandler( "showTimeLeft", getRootElement(), function (timeLeft) dxDrawText("Time left:", 19, 210, 185, 228, tocolor(0, 0, 0, 255), 1.20, "sans", "left", "top", false, false, true, false, false) dxDrawText(""..timeLeft.."", 19, 228, 165, 247, tocolor(0, 0, 0, 255), 1.25, "sans", "right", "top", false, false, true, false, false) addEventHandler("onClientRender", root, showTimeLeft) if timeLeft =< getTickCount() then removeEventHandler("onClientRender", root, showTimeLeft) triggerServerEvent("endRaceForPlayer", localPlayer) end end) Link to comment
Addlibs Posted August 3, 2014 Share Posted August 3, 2014 --trigger it from serverSide triggerClientEvent(thePlayer, "showTimeLeft", thePlayer, getTickCount() + 60000) Is thePlayer defined? Link to comment
vx89 Posted August 31, 2014 Share Posted August 31, 2014 If you are using the default race gamemode, you could set maximum racing time in race resource settings (not sure about map overrides). Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now