![Smile :)](./images/smilies/icon_smile.gif)
looking forward to see what comes out after testing
Moderators: Forum moderators, developers
i checked in manual for abs like in pascal, cos the language looks similar...Can't find and instead of this i used `-´ (negation)wrote:
function et_Obituary(victimnum, killernum, meansofdeath)
local victimteam = tonumber(et.gentity_get(victimnum, "sess.sessionTeam"))
local killerteam = tonumber(et.gentity_get(killernum, "sess.sessionTeam"))
if victimteam ~= killerteam and killernum ~= 1022 then
local killername = string.gsub(et.gentity_get(killernum, "pers.netname"), "%^$", "^^ ")
local killerhp = et.gentity_get(killernum, "health")
end
if (killerhp > 0) then
et.trap_SendServerCommand(victimnum, string.format("cp "^7Your ^7killer ^7%s ^7has ^7still ^o%d ^7health ^7points ^7remaining.\n"", killername, killerhp))
else
et.trap_SendServerCommand(victimnum, string.format("cp "^7Your ^7killer ^7%s ^7has ^7still ^o%d ^7health ^7points ^7remaining.\n"", killername, -killerhp))
end
end
I believe to get an absolute value you have to use math.abs(NUMER)Luk4ward wrote:i checked in manual for abs like in pascal, cos the language looks similar...Can't find and instead of this i used `-´ (negation)