Cocodrilo Posted April 28, 2013 Posted April 28, 2013 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)
DNL291 Posted April 28, 2013 Posted April 28, 2013 thePlayer isn't defined. "onZombieWasted" must be a custom event because it doesn't exist. Please do not PM me with scripting related question nor support, use the forums instead.
MIKI785 Posted April 28, 2013 Posted April 28, 2013 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) Lua Scripter Owner of mshost.cz MTA portal.
iPrestege Posted April 28, 2013 Posted April 28, 2013 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
codeluaeveryday Posted April 28, 2013 Posted April 28, 2013 I hope your using addEvent() function. Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
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