client side
addEventHandler ( "onClientPlayerDamage",root,
function ()
if getElementData(source,"invincible") then
cancelEvent()
end
end)
addEventHandler("onClientPlayerStealthKill",localPlayer,
function (targetPlayer)
if getElementData(targetPlayer,"invincible") then
cancelEvent()
end
end)
server side
bstaffteam = createTeam ( "Staff", 255, 255, 255 )
function staff (Player)
local account = getPlayerAccount(Player)
if (not account or isGuestAccount(account)) then return end
local accountName = getAccountName(account)
if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then
setPlayerTeam (Player, staffteam )
setElementData(Player, "Occupation", "Staff")
setElementModel ( Player, 217)
end
end
addCommandHandler("staff",staff)
addEvent("staff",true)
addEventHandler("staff",getRootElement(),staff)
function getPlayersInGroup( accName )
local Table = { }
for _,v in pairs( getElementsByType( "player" ) ) do
local accName = getAccountName ( getPlayerAccount ( v ) )
if (isObjectInACLGroup ("user." .. accName, aclGetGroup("Admin")) ) then
table.insert( Table,v )
end
end
return Table
end
if getElementData(thePlayer,"invincible") then
setElementData(thePlayer,"invincible",false)
else
setElementData(thePlayer,"invincible",true)
end
I found this script on a forum, the question is: does this script make the admins immortal?