• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[8.4][TFS] Heal when you die.

Bvbb

New Member
Joined
Sep 22, 2008
Messages
73
Reaction score
0
Hello all programmers.
Today I need 1 code to my OTS :)

I need easy code what check player if he is on arena.


If ( he is on arena then ) {
he don't die, but he get heal.
}

Else (he isnt on arena){
He died :)
}

How that must check if he is on arena?
Storage value :)

If (storage == 2000)
He died

Else (storage == 2001)
He is on 1 arena and dont die

Else (storage == 2002)
He is on 2 arena and dont die



TFS == cryingdamson2

Thanks.

P.S Sorry for my english, but I try be better :))
 
would be something like this:

Code:
local key = 7777
local arenas = {
[2001] = {x=100,y=100,z=7},
[2002] = {x=100,y=100,z=7}
}

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
     local arena = getPlayerStorageValue(cid, key)
     if arenas[arena] ~= nil then
          doTeleportThing(cid, arenas[arena])
          doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
          doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
          return FALSE
     end
     return TRUE
end
 
Back
Top