Manigold
Active Member
- Joined
- Nov 2, 2017
- Messages
- 198
- Solutions
- 8
- Reaction score
- 48
i'm using a pvp arena scrip, and works fine , but i want to add a message when player is defeated , and to the player who won , like:
MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You defeated (player name) .
MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You where defeated by (player name) .
Someone can help me add this? (I'm using tfs 1.2) Here's my script :
MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You defeated (player name) .
MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You where defeated by (player name) .
Someone can help me add this? (I'm using tfs 1.2) Here's my script :
Lua:
local arena = {
frompos = {x=121, y=33, z=10},
topos = {x=128, y=37, z=10},
exit = {x=125, y=31, z=9}
}
local function exitArena(p)
doSendMagicEffect(p.exit, 10)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doTeleportThing(p.cid, p.exit, FALSE)
end
function onPrepareDeath(cid, killer)
if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
addEvent(exitArena, 100, {cid=cid, exit=arena.exit})
end
return FALSE
end
function isInArea(pos, fromPos, toPos)
if pos.x >= fromPos.x and pos.x <= toPos.x then
if pos.y >= fromPos.y and pos.y <= toPos.y then
if pos.z >= fromPos.z and pos.z <= toPos.z then
return true
end
end
end
return false
end
function onLogin(player)
player:registerEvent("pvparena")
return true
end