Jump to content

Help needed thanks ^_^


justn

Recommended Posts

Client:

  
addEventHandler("onClientPlayerWeaponFire",localPlayer,function() 
    triggerServerEvent("playerFire",source) 
end) 
  

Server:

  
local timers = {} 
addEventHandler("onResourceStart",resourceRoot,function() 
    for _,player in ipairs (getElementsByType("player")) do 
        timers[player] = setTimer(setPlayerWantedLevel,300000,0,player,getPlayerWantedLevel(player)-1) 
    end 
end) 
addEventHandler("onPlayerJoin",root,function() 
    timers[source] = setTimer(setPlayerWantedLevel,300000,0,source,getPlayerWantedLevel(source)-1) 
end) 
  
addEvent("playerFire",true) 
addEventHandler("playerFire",root,function() 
    if isTimer(timer[client]) then 
        resetTimer(timer[client]) 
    end 
end) 
  

Not tested.

Link to comment
  • Moderators
The source of onClientWeaponFire is the weapon not the player element. A small typo. ;)
  
 addEventHandler("onClientPlayerWeaponFire",localPlayer,function() 
    triggerServerEvent("playerFire",localPlayer) 
  
end) 

But he isn't using onClientWeaponFire but onClientPlayerWeaponFire.

It can be both, source and localPlayer.

Link to comment
The source of onClientWeaponFire is the weapon not the player element. A small typo. ;)
  
 addEventHandler("onClientPlayerWeaponFire",localPlayer,function() 
    triggerServerEvent("playerFire",localPlayer) 
  
end) 

But he isn't using onClientWeaponFire but onClientPlayerWeaponFire.

It can be both, source and localPlayer.

sorry, my bad. :lol:

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