Jump to content

Wanted Level


Recommended Posts

well I have this script of wanted level it works fine but when I die my stars get deleted here is the code

  
function wanted( ammo, attacker, weapon, bodypart ) 
   setPlayerWantedLevel ( attacker, getPlayerWantedLevel( attacker )+1 ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), wanted ) 
  

Link to comment

Try this:

function wanted( ammo, attacker, weapon, bodypart ) 
if (attacker) and (attacker ~=source) then 
   setPlayerWantedLevel ( attacker, getPlayerWantedLevel( attacker )+1 ) 
else 
local wanted = getPlayerWantedLevel( source ) 
setPlayerWantedLevel(source,wanted) 
   end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), wanted ) 

Link to comment

Maybe try this:

function wanted( ammo, attacker, weapon, bodypart ) 
if (attacker) and (attacker ~=source) then 
   setPlayerWantedLevel ( attacker, getPlayerWantedLevel( attacker )+1 ) 
else 
local wanted = getPlayerWantedLevel( source ) 
setTimer(setPlayerWantedLevel, 1000, 1, source, wanted) --1000 is 1 sec and it should be the time taken to spawn you should specify this yourself 
   end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), wanted ) 

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