error656
New Member
- Joined
- Aug 27, 2007
- Messages
- 60
- Reaction score
- 1
Hi everyone
Im use TFS 0.3.4 PL2
I have problem with pvp arena, im use alots of scripts but nothink works ;/(when die lost exp etc) I dont use map editor for this because I want to set up when player die in Pvp arena, he lost corps(without losing exp items etc) and it shows up in player deaths page. Can You give me some script or some odvice for that? Do i need to write something in constant.lua?? Or maybe my login.lua is wrong?
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "PrepareDeath")
return TRUE
end
and
script of pvp arena:
local arena = {
frompos = {x=32383, y=32172, z=7},
topos = {x=32387, y=32178, z=7),
exit = {x=32383, y=32174, 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
thx for Your time
Im use TFS 0.3.4 PL2
I have problem with pvp arena, im use alots of scripts but nothink works ;/(when die lost exp etc) I dont use map editor for this because I want to set up when player die in Pvp arena, he lost corps(without losing exp items etc) and it shows up in player deaths page. Can You give me some script or some odvice for that? Do i need to write something in constant.lua?? Or maybe my login.lua is wrong?
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "PrepareDeath")
return TRUE
end
and
script of pvp arena:
local arena = {
frompos = {x=32383, y=32172, z=7},
topos = {x=32387, y=32178, z=7),
exit = {x=32383, y=32174, 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
thx for Your time