golanu21 Posted March 13, 2013 Share Posted March 13, 2013 i want to make this : When player1 kill player2, server give to player1 wanted level > 2 Link to comment
iPrestege Posted March 13, 2013 Share Posted March 13, 2013 onPlayerWasted setPlayerWantedLevel Link to comment
golanu21 Posted March 13, 2013 Author Share Posted March 13, 2013 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
iPrestege Posted March 13, 2013 Share Posted March 13, 2013 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
Renkon Posted March 13, 2013 Share Posted March 13, 2013 Line 9 replace for setPlayerWantedLevel ( getVehicleOccupant(attacker), 2) 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