Ezzam
New Member
- Joined
- Jan 16, 2008
- Messages
- 213
- Reaction score
- 2
Here you have a 100% working PvP-Arena for TFS 0.3!
I could not have made it without Tufte. (Give him REP++!)
Also, dont fotget to give me REP++
I could not have made it without Tufte. (Give him REP++!)
Code:
local arena = {
frompos = {x=31950, y=32068, z=0},
topos = {x=32192, y=32256, z=15},
exit = {x=32097, y=32219, z=7}
}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == TRUE then
if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
if doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE) == TRUE then
if doTeleportThing(cid, arena.exit) == TRUE then
doSendMagicEffect(arena.exit, 10)
doPlayerSendTextMessage(mostDamageKiller,MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You have defeated '..getPlayerName(cid)..'!')
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You where defeated by '..getPlayerName(mostDamageKiller)..'!')
return FALSE
end
end
end
end
return TRUE
end
Also, dont fotget to give me REP++