Jump to content

addEventHandler


Gallagher

Recommended Posts

I have this event the client side, but does not work as I want.

I want this event "(triggerServerEvent, 15000, 1," ClientHaveLevels "getLocalPlayer ())" is activated when the player dies.

WHAT I put in place onPlayer spawn?

function triplo() 
    setTimer ( triggerServerEvent, 15000, 1, "ClientHaveLevels", getLocalPlayer() ) 
end 
  
addCommandHandler ("triplo", triplo) 
addEventHandler ( "onPlayerSpawn", getLocalPlayer(), triplo ) 

this script above works, but if the player relogin the event will be triggered again and I do not want it!

Link to comment
  • Moderators
this script above works

Lol why are you lying ?

onPlayerSpawn is a server side event only ... (or maybe you created one on clientside that is triggered from the server using onPlayerSpawn or client side using onClientPlayerSpawn but I doubt and it would be stupid)

Link to comment
function triplo() 
    removeEventHandler ( "onClientPlayerWasted", getLocalPlayer(), triplo ) 
  
setTimer ( function ()   triggerServerEvent, "ClientHaveLevels", getLocalPlayer() ) 
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), triplo ) 
end, 15000,1, true ) 
  
end 
  
addCommandHandler ("triplo", triplo) 
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), triplo ) 

Edited by Guest
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...