Jump to content

addEventHandler


Gallagher

Recommended Posts

Posted

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!

Posted
  
[url=https://wiki.multitheftauto.com/wiki/OnClientPlayerWasted]https://wiki.multitheftauto.com/wiki/On ... ayerWasted[/url] 

I think that's what you're lookin for.

Posted
  
[url=https://wiki.multitheftauto.com/wiki/OnClientPlayerWasted]https://wiki.multitheftauto.com/wiki/On ... ayerWasted[/url] 

I think that's what you're lookin for.

Thanks friend, I had tried but not worked because onPlayerWasted is server side event.

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

  • Moderators
Posted
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)

Posted (edited)
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
Posted
Maybe you should just cancelEvent onPlayerLogout.

By leaving the server, it forces him to logout ...

Ohh and I thought People stay logged in forever when after they once logged in :P

Hey was talking about relogin, thought its about logout and in again.

Posted
Maybe you should just cancelEvent onPlayerLogout.

By leaving the server, it forces him to logout ...

Ohh and I thought People stay logged in forever when after they once logged in :P

Lmao.

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