fuinharlz Posted April 10, 2011 Author Share Posted April 10, 2011 _edit: tested it, works fine. If a player is 10 lvls lower or 10 lvls higher than other player, he's not able to attack. If he's 9 lvls lower or higher, he's still able to attack!Tested it with version 1…_I was thinking on pvp to start my game, but something ALWAYS gets on my mind… if I make a pvp game, with a min pvp lvl, even having a pk system, where u turn into a bad player and can't enter town anymore untill u redeem yourself, there'll still be people getting to high lvl and running to low lvl areas to freely kill newbies and ruin theyr play experience.So I came up in mind with something simple, that would prevent this: a pvp level range!I planed this to work like this: after all checks if the pk attack is possible (map, players in same map, if it's an admin trying to attack a player, if both have the min pvp lvl, etc), the game will check the players lvl (booth attacker and victim), and if the attacker is 10 lvls+ higher or 10 lvls- lower then the victim, it just won't let him attack! So, players need to be in difference range of 10 lvls to attack each other, making things "better".I didn't tested it yet (I just started editing the code), so, I'm not sure wich "version" to use, but I'll post both here!All changes are made on server source.In both, go to modules - modCombat and search fo player attacking player, and just after```' Make sure victim is high enough level If GetPlayerLevel(victim) < 10 Then Call PlayerMsg(attacker, GetPlayerName(victim) & " is below level 10, you cannot attack this player yet!", BrightRed) Exit Function End If```insert ONE of the versions.**version one**```' Make sure attacker and victim are in rangeIf GetPlayerLevel(attacker) >= GetPlayerLevel(victim) + 9 or GetPlayerLevel(attacker) <= GetPlayerLevel(victim) - 9 Then Call PlayerMsg(Attacker, "Some strange force stops you from attacking this player.", BrightRed) Exit FunctionEnd If```**Version 2**```' Make sure attacker and victim are in rangeIf GetPlayerLevel(attacker) >= GetPlayerLevel(victim) + 9 Then Call PlayerMsg(Attacker, "Some strange force stops you from attacking this player.", BrightRed) Exit FunctionEnd If' Make sure attacker and victim are in rangeIf GetPlayerLevel(attacker) <= GetPlayerLevel(victim) - 9 Then Call PlayerMsg(Attacker, "Some strange force stops you from attacking this player.", BrightRed) Exit FunctionEnd If```I think the first version is simplier but not sure it'll work checking both if lvl is lower or higher, this is Y I made "version 2". I'm going to try to find some "friends" and check if they can help me testing both version, but if anybody test it before, post ur comments here.Thanks, and sorry for anything, this was my first changes and "tutorial" on Eclipse ever :Phow it works:player A is lvl 12 and player b is lvl 15… they can fight.Player A is lvl 12, player b is lvl 23: they CAN'T fight.simple addition, but I think it'll help ppl to develop games with pvp without high lvl players abuse! Link to comment Share on other sites More sharing options...
Guest Posted April 10, 2011 Share Posted April 10, 2011 .. Uhh. So you added level requirements for PvP.. which were already in there.. yeah, great. Link to comment Share on other sites More sharing options...
fuinharlz Posted April 10, 2011 Author Share Posted April 10, 2011 @Sekaru:> .. Uhh. So you added level requirements for PvP.. which were already in there.. yeah, great.Actually there's a MINIMUM lvl requirement for pvp, but, after u get in the min pvp lvl, you can attack anybody from "min pvp lvl" to max lvl (and be attacked by).This code prevents someone 10 lvls higher/lower than you to attack you, or you to attack someone 10 lvls loweer/higher. Link to comment Share on other sites More sharing options...
Guest Posted April 10, 2011 Share Posted April 10, 2011 Fair enough, it's a start at least. Link to comment Share on other sites More sharing options...
Link Posted April 10, 2011 Share Posted April 10, 2011 Just keep building on it, it should work it's self out. Link to comment Share on other sites More sharing options...
DawnOfEarth Posted April 12, 2011 Share Posted April 12, 2011 thats is pretty good but you should make it were you can only pvp in certain areas like a tile you step on to enter pvp area Link to comment Share on other sites More sharing options...
Medleyy Posted July 26, 2011 Share Posted July 26, 2011 Simple but important - Thanks for this :) Link to comment Share on other sites More sharing options...
Weegee Posted July 26, 2011 Share Posted July 26, 2011 Lol doing it the rs way and ya it is very useful. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now