جرب
group = "group name"
addEventHandler ("onPlayerLogin", root, function (thePreviousAccount, theCurrentAccount, autoLogin)
if not (isGuestAccount (getPlayerAccount (source))) then
local accountData = getAccountData (theCurrentAccount, "count")
if (accountData) then
setElementData (source, "count", getAccountData (theCurrentAccount, "count"))
outputChatBox ("You have [" .. getAccountData (theCurrentAccount, "count") .. "] of point.", source, 255, 255, 0)
end
end
end)
addEventHandler("onPlayerWasted",root, function(totalAmmo, killer, killerweapon, bodypart)
if killer and killerweapon == 31 then
if not (getElementData (killer, "count")) then
setElementData (killer, "count", 0)
end
setElementData (killer, "count", getElementData (killer, "count") + 1)
outputChatBox ("You got 1 point now you have [" .. getElementData (killer, "count") .. "] of point.", killer, 0, 255, 0)
if getElementData (killer, "count") == 50 then
outputChatBox ("Congratulation you have a 50 point and you got a " .. group .. ".", killer, 0, 255, 0)
local account = getAccountName(getPlayerAccount(killer))
aclGroupAddObject (aclGetGroup(group),"user."..account)
end
end
end)
addEventHandler ("onPlayerQuit", root, function (quitType, reason, responsibleElement)
if not (isGuestAccount (getPlayerAccount (source))) then
account = getPlayerAccount (source)
if (account) then
setAccountData (account, "count", getElementData (source, "count"))
end
end
end)