Jump to content

[HELP] Set Timer


Recommended Posts

hey guys

what is problem in my this code ?

addEvent("getTicket",true)
addEventHandler("getTicket", root,
function()
		setElementInterior(client, 1)
		setElementPosition(client, 1.76953125 ,28.478515625 ,1199.59375)
		outputChatBox("#00ff00You are now in air plane!", client, 255, 255, 255, true)
	setTimer(
	function()
		setElementInterior(client, 0)
		setElementPosition(client, 1685.8193359375 ,-2237.5400390625 ,13.546875)
		outputChatBox("#00ff00Welcome To Los Santos!", client, 255, 255, 255, true)
	end, 60000, 1)
end)

I buy a ticket and i teleport to air plane but after 1 min i'm not going to los santos !

Link to comment

'client' isn't defined in the function with the timer.

addEvent("getTicket",true)
addEventHandler("getTicket", root,
function()
        setElementInterior(client, 1)
        setElementPosition(client, 1.76953125 ,28.478515625 ,1199.59375)
        outputChatBox("#00ff00You are now in air plane!", client, 255, 255, 255, true)
        setTimer(
            function(client)
                setElementInterior(client, 0)
                setElementPosition(client, 1685.8193359375 ,-2237.5400390625 ,13.546875)
                outputChatBox("#00ff00Welcome To Los Santos!", client, 255, 255, 255, true)
            end
       , 60000, 1 ,client)
end)

 

  • Haha 1
Link to comment
10 minutes ago, Shux said:

'client' isn't defined in the function with the timer.


addEvent("getTicket",true)
addEventHandler("getTicket", root,
function()
        setElementInterior(client, 1)
        setElementPosition(client, 1.76953125 ,28.478515625 ,1199.59375)
        outputChatBox("#00ff00You are now in air plane!", client, 255, 255, 255, true)
        setTimer(
            function(client)
                setElementInterior(client, 0)
                setElementPosition(client, 1685.8193359375 ,-2237.5400390625 ,13.546875)
                outputChatBox("#00ff00Welcome To Los Santos!", client, 255, 255, 255, true)
            end
       , 60000, 1 ,client)
end)

 

Thanks for your help ❤️

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...