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

New PvP-System

Norix

Hosting Service !
Joined
Jan 18, 2008
Messages
544
Reaction score
8
Location
Germany
Hi
I wanna have a new PvP-System in my Serv but i dunno how to do.
There should be pvp level stages:
Level 10-19, 20-29, 30-39... till 59. From 60 it should be normal pvp system. Now in the new system you should be able to atk someone only if he is in your stage. So e.g. when you are lvl 37 you can only atk someone who is lvl 30-39 and noone lower or higher. And when u are lvl 24 you can atk only someone who is lvl 20-29 etc.. And from 60 there is old system that you can atk everyone who is just higher than 59. Please help :S

Your's ballack13
 
with onattack should look something like this:
Code:
local stages = {
{ from = 1, to = 9 }
{ from = 10, to = 19 }
{ from = 20, to = 29 }
{ from = 30, to = 39 }
{ from = 40, to = 49 }
{ from = 50, to = 59 }
{ from = 60, to = 999999 }
}

function onAttack(cid, target)
     local level = getPlayerLevel(cid)
     if isPlayer(target) == TRUE then
          local target_level = getPlayerLevel(target)
          for i = 1, #stages do
               if level >= stages[i].from and level <= stages[i].to then
                    if target_level >= stages[i].from and target_level <= stages[i].to then
                         return TRUE
                    else
                         doPlayerSendCancel(cid, "You are not allowed to attack this Player.")
                    end
               end
          end
     end
     return FALSE
end
but this will only prevent that players can be attacked via battle list, mass spells will still make dmg, so its pretty useless...^^
better make it in c++

Yours,
Markey
 
Hey, i use this code
local stages = {
{ from = 50, to = 62 }
{ from = 52, to = 62 }
{ from = 54, to = 64 }
{ from = 56, to = 64 }
{ from = 58, to = 66 }
{ from = 60, to = 68 }
{ from = 62, to = 70 }
{ from = 65, to = 77 }
{ from = 69, to = 82 }
{ from = 75, to = 90 }
{ from = 80, to = 105 }
{ from = 90, to = 115 }
{ from = 100, to = 140 }
{ from = 125, to = 160 }
{ from = 150, to = 180 }
{ from = 180, to = 240 }
{ from = 200, to = 30000 }
}

function onAttack(cid, target)
local level = getPlayerLevel(cid)
if isPlayer(target) == TRUE then
local target_level = getPlayerLevel(target)
for i = 1, #stages do
if level >= stages.from and level <= stages.to then
if target_level >= stages.from and target_level <= stages.to then
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Nie mozesz atakowac tej postaci.")
end
end
end
end
return FALSE
end



And i past this code to data/lib, and when i login on my OTS, this System do not work. Why?
 
i want this to my pvp-e world. I need a system pvp:
player with 50lvl can kill to max 62lvl
When player with 50lvl go advance and have 51lvl now can attack a next stage peoples (to) 63lvl. Well, who can help me? I need this script. HELP ME PLEASE...
 
Yes, i use code with Level Difference Protection, but i have TFS 0.3.2
But this code works only with TFS 0.3.3+ :(
 
Back
Top