Jump to content

How to know what element/player to put and setting timer


Recommended Posts

Posted (edited)

i want to know what element to put when your using functions and how to find out what one also how can you set timers to lines of code for example

  
-- THiS IS A EXAMPLE OF THE TIMER THING! 
-- Ignore the random stuff like hasHeDied. This is just trying to help you understand me  
function test() 
      local test = hasHeDied 
      if ( test == true ) then 
      setTimer(spawnPlayer,0,0,0), 5000, 0) 
      end 
end 

Edited by Guest
Guest Guest4401
Posted

What do you mean?

Posted
What do you mean?

I want to know how you know what element to put cuz sometimes i put player then people tell me its source im like how do you know that? Also how can i set a timer to a line of code like in the example

Posted
function test() 
      setTimer(spawnPlayer,5000,1,source,x,y,z) -- change x,y,z to the pos 
end 
addEventHandler ("onPlayerWasted",root,test) 

The source of this event is the player that died or got killed.

https://wiki.multitheftauto.com/wiki/OnPlayerWasted

remember that when you use spawnPlayer you will need to use setCameraTarget too.

Note: setCameraTarget must be used to focus on the player. Also, all players have their camera initially faded out after connect. To ensure that the camera is faded in, please do a fadeCamera after

https://wiki.multitheftauto.com/wiki/SpawnPlayer

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...