Jump to content

Zombie kill reward by ACL


Cocodrilo

Recommended Posts

What is wrong?

function killReward (totalAmmo, killer, killerweapon, bodypart, stealth) 
local accountname = getAccountName(getPlayerAccount(thePlayer)) 
  if isObjectInACLGroup("user." .. accountname, aclGetGroup("VIP")) then 
    if (killer) and (killer ~= source) then 
      givePlayerMoney (killer, 1000) 
    end 
  end 
end 
addEventHandler ("onZombieWasted", getRootElement(), killReward) 

Link to comment

If the account is supposed to be the killer's account, change thePlayer to killer...

function killReward (totalAmmo, killer, killerweapon, bodypart, stealth) 
local accountname = getAccountName(getPlayerAccount(killer)) 
  if isObjectInACLGroup("user." .. accountname, aclGetGroup("VIP")) then 
    if (killer) and (killer ~= source) then 
      givePlayerMoney (killer, 1000) 
    end 
  end 
end 
addEventHandler ("onZombieWasted", getRootElement(), killReward) 

Link to comment

No try this but not tested ;

function killReward ( killer,weapon,bodypart ) 
    local accountname = getAccountName(getPlayerAccount(killer)) 
    if isObjectInACLGroup("user." .. accountname, aclGetGroup("VIP")) then 
    if (killer) and (killer ~= source) then 
      givePlayerMoney (killer,1000) 
    end 
  end 
end 
addEventHandler ("onZombieWasted", getRootElement(), killReward) 

The killer is on the parameter one -.- read here :

https://wiki.multitheftauto.com/wiki/Slothman/Zombies#onZombieWasted

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