Jump to content

Hi, i need help please :v


justn

Recommended Posts

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

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