justn Posted March 23, 2014 Share Posted March 23, 2014 Hi !! the problem is the attacker, doesn't get a star when the police is dead , help please. function onPlayerWasted ( attacker ) if ( attacker ) then if isPlayerInTeam ( source, "Police" ) then if ( getElementType ( attacker ) == "player" ) then local Wanted = getPlayerWantedLevel(attacker) setPlayerWantedLevel ( attacker, Wanted+1 ) end end end end addEventHandler ( "onPlayerWasted", getRootElement(), onPlayerWasted ) Link to comment
3B00DG4MER Posted March 23, 2014 Share Posted March 23, 2014 Hi !! the problem is the attacker, doesn't get a star when the police is dead , help please. function onPlayerWasted ( attacker ) if ( attacker ) then if isPlayerInTeam ( source, "Police" ) then if ( getElementType ( attacker ) == "player" ) then local Wanted = getPlayerWantedLevel(attacker) setPlayerWantedLevel ( attacker, Wanted+1 ) end end end end addEventHandler ( "onPlayerWasted", getRootElement(), onPlayerWasted ) Next time use /debugscript 3 function onPlayerWasted ( attacker ) if ( attacker ) then if isPlayerInTeam ( localPlayer, "Police" ) then if ( getElementType ( attacker ) == "player" ) then setPlayerWantedLevel ( attacker, getPlayerWantedLevel(attacker)+1 ) end end end end addEventHandler ( "onPlayerWasted", getRootElement(), onPlayerWasted ) Try This I don't know if it work's Link to comment
WhoAmI Posted March 23, 2014 Share Posted March 23, 2014 function onPlayerWasted ( _, attacker ) if ( attacker ) then if ( getPlayerTeam ( source ) == getTeamFromName ( "Police" ) ) then if ( getElementType ( attacker ) == "player" ) then setPlayerWantedLevel ( attacker, getPlayerWantedLevel ( attacker ) + 1 ) end end end end addEventHandler ( "onPlayerWasted", root, onPlayerWasted ) @UP: Why are you using localPlayer variable in serverside code? If you can't help, just don't post, couse an author of this topic would got mindf**k. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now