Jump to content

onPlayerWasted


Recommended Posts

Posted

Hello all i want set this code to onPlayerWasted i tried it but dont want to work here is the lua

exports.scoreboard:addScoreboardColumn("WepPoints",getRootElement(),6,60) 
  
function PlayerKill ( killer, weapon, bodypart) 
local slot = getPedWeapon(killer) 
  
for _,player in ipairs(getElementsByType("player")) do 
bindKey(player,"next_weapon",PlayerKill) 
bindKey(player,"previous_weapon",PlayerKill) 
  
  
  
if (killer and killer ~= source) then 
if ( bodypart == 9) then 
setPedStat(killer, stat, getPedStat(killer, stat)+5) 
setElementData(killer,"WepPoints",tonumber(getPedStat(killer,stat))) 
  
elseif (killer and killer ~= source) then 
if ( bodypart == -- s8) --> then 
setPedStat(killer, stat, getPedStat(killer, stat)+1) 
setElementData(killer,"WepPoints",tonumber(getPedStat(killer,stat))) 
  
elseif (killer and killer ~= source) then 
if ( bodypart == 7) then 
setPedStat(killer, stat, getPedStat(killer, stat)+1) 
setElementData(killer,"WepPoints",tonumber(getPedStat(killer,stat))) 
  
elseif (killer and killer ~= source) then 
if ( bodypart == 6) then 
setPedStat(killer, stat, getPedStat(killer, stat)+1) 
setElementData(killer,"WepPoints",tonumber(getPedStat(killer,stat))) 
  
elseif (killer and killer ~= source) then 
if ( bodypart == 5) then 
setPedStat(killer, stat, getPedStat(killer, stat)+1) 
setElementData(killer,"WepPoints",tonumber(getPedStat(killer,stat))) 
  
elseif (killer and killer ~= source) then 
if ( bodypart == 4) then 
setPedStat(killer, stat, getPedStat(killer, stat)+1) 
setElementData(killer,"WepPoints",tonumber(getPedStat(killer,stat))) 
  
elseif (killer and killer ~= source) then 
if ( bodypart == 3) then 
setPedStat(killer, stat, getPedStat(killer, stat)+1) 
setElementData(killer,"WepPoints",tonumber(getPedStat(killer,stat))) 
                                    end 
                                end 
                            end 
                        end 
                    end 
                end 
            end 
        end 
    end 
end 
  
addEventHandler("onPlayerWasted",getRootElement(),PlayerKill) 

and ramdan kareem to all musulmans :D

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Fixed i added ammo to this line

function win(killer, weapon, bodypart) 

function win(ammo, killer, weapon, bodypart) 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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