Jump to content

setPlayerWantedLevel


golanu21

Recommended Posts

function player_Wasted ( ammo, attacker, weapon, bodypart ) 
    if ( attacker ) then 
        local tempString 
        if ( getElementType ( attacker ) == "player" ) then 
            tempString = getPlayerName ( attacker ).." la omorat pe "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")" 
            setPlayerWantedLevel ( attacker, math.random(3, 6)) 
        elseif ( getElementType ( attacker ) == "vehicle" ) then 
            local tempString = getPlayerName ( getVehicleController ( attacker ) ).." la omorat pe "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")" 
            setPlayerWantedLevel ( attacker, 2) 
        end 
        if ( bodypart == 9 ) then 
            tempString = tempString.." (HEADSHOT!)" 
        else 
            tempString = tempString.." ("..getBodyPartName ( bodypart )..")" 
        end 
        outputChatBox ( tempString ) 
    else 
        outputChatBox ( getPlayerName ( source ).." died. ("..getWeaponNameFromID ( weapon )..") ("..getBodyPartName ( bodypart )..")" ) 
    end 
end 

it is ok?

Link to comment

killer: an element representing the player or vehicle who was the killer. If there was no killer this is false.

ex :

addEventHandler ( "onPlayerWasted", getRootElement(),  
function ( ammo, killer, killerweapon, bodypart ) 
       if ( killer ) and ( killer ~= source ) then         
setPlayerWantedLevel(killer,2) 
        end 
end 
) 
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...