• 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!

[TFS 8.42] PVP Arena

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
 
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

sorry i dont mean to duplicate my post ;/
 
again, wrong section
 
For better Support:
1. Use Code Tags: Done
2. Tab the Code: XXX
3. Describe your problem(Which Client etc.): XXX
 
For better Support:
1. Use Code Tags: Done
2. Tab the Code: XXX
3. Describe your problem(Which Client etc.): XXX

With all respect I think 3 is done, but maybe you thinking about write that in thread name?

But still problem is unsolved.
 
Back
Top