janpan40 Posted May 22, 2011 Author Share Posted May 22, 2011 I got tired of higher levels pking lower levels soo i made this code to put a end to it.you are welcome to use it as long as you give me credits.>! Simple Tutorial To Make A Level Difference Blocker In Pvp!>! Server Sided:ModCombat:>! Find: ' Make sure the victim is high enough level >! Paste This Right Below It that code:>! ' Make Sure The Attacker And Victims Levels Arent Too Far Apart' Janpan40's Level Difference HandlerIf GetPlayerLevel(attacker) <> GetPlayerLevel(victim) ThenIf GetPlayerLevel(attacker) > GetPlayerLevel(Victim) + 15 ThenCall PlayerMsg(attacker, GetPlayerName(victim) & " is too great a level distance from you to fight", BrightRed)Exit FunctionEnd IfEnd If>! Their You Know Have A Level Difference Function In Pvp, Now If A Player Is 15 Levels Above Another PlayerThey Cannot Attack!>! you can change the 15 to what ever you want the max difference to be!>! make sure you give credits to me if you useRemember to give credits to me if you use beacuase i came up with this code.Have fun:)Mod:Thanks To Lightnings Suggestion, give him credits as well.Mine Works, 100% sure.If you have any problems please contact me and ill repost lightning's mod. Link to comment Share on other sites More sharing options...
janpan40 Posted May 22, 2011 Author Share Posted May 22, 2011 Any1 who uses please post a screen shot, i did not have time.:) Link to comment Share on other sites More sharing options...
Yxxe Posted May 22, 2011 Share Posted May 22, 2011 ~~This won't work:~~ Well, it doesn't bring up an error in my IDE. It seems like a really weird way to do it, however.@janpan40:> If GetPlayerLevel(attacker) > 15 < GetPlayerLevel(victim) ThenYou'll have to change that to:```If GetPlayerLevel(attacker) > GetPlayerLevel(Victim) + 15 Then``` Link to comment Share on other sites More sharing options...
janpan40 Posted May 22, 2011 Author Share Posted May 22, 2011 It worked in mine i tested it out useing multiple levels. such as level 72 v.s. 54level 25 v.s. level 15, and 1 more i forgot which but i know it works.at least for my server anyway. Link to comment Share on other sites More sharing options...
Broojo02 Posted May 22, 2011 Share Posted May 22, 2011 Still, the line of code doesn't make senseIf GetPlayerLevel(attacker) > 15 < GetPlayerLevel(victim) ThenIts like saying if player level is greater than 15 which is in turn less than victim level. Link to comment Share on other sites More sharing options...
janpan40 Posted May 22, 2011 Author Share Posted May 22, 2011 I know, thats why i hate math it doesnt make sence logicaly "sorry if i misspelled that".but it sometimes works.i got the idea from a math problem.if a man has 10$ for a icecream but another man is competing for the 15$ higher who will win.here was the equationman1 > 15 < man2I failed that test btw lol Link to comment Share on other sites More sharing options...
Repercussionist Posted May 22, 2011 Share Posted May 22, 2011 @janpan40:> I know, thats why i hate math it doesnt make sence logicaly> but it sometimes works.> I failed that test btw lolYour logic, infallible it is…/sarcasmSeriously though,It appears that, in addition to changing the statement to what lightning suggests, that you'll need to put a check on being 15 levels under as well. Link to comment Share on other sites More sharing options...
janpan40 Posted May 22, 2011 Author Share Posted May 22, 2011 Yeah, fixed it.Lightning thanks for the help.:) Link to comment Share on other sites More sharing options...
Yxxe Posted May 22, 2011 Share Posted May 22, 2011 @janpan40:> Yeah, fixed it.> Lightning thanks for the help.> :)No problem. Best of luck learning VB6! Link to comment Share on other sites More sharing options...
RyokuHasu Posted May 27, 2011 Share Posted May 27, 2011 @Repercussionist:> Seriously though,> It appears that, in addition to changing the statement to what lightning suggests, that you'll need to put a check on being 15 levels under as well.^_^ Im on it!…I have one issue with it, the lower person can Still attack the higher one it he were to ... i dont know ...KEEP ATTACKING.. eventualy the bigger guy would loose and die because of lact to attack back.the better way to do it is Add In another If stamentADD:If GetPlayerLevel(attacker) < GetPlayerLevel(Victim) - 15 Then...End IfThis checks if the person your attacking is to high, not just too low, that way the lower one cant give a SLOW one sided fist fight. If you want to do somthing like this you must think from ALL angles, I dont want some noob pinning me in a cornor and waling on me just cause i cant hit him back. If i cant hit him, he cant hit me.FINAL PRODUCT:If GetPlayerLevel(attacker) <> GetPlayerLevel(victim) ThenIf GetPlayerLevel(attacker) > GetPlayerLevel(Victim) + 15 ThenIf GetPlayerLevel(attacker) < GetPlayerLevel(Victim) - 15 ThenCall PlayerMsg(attacker, GetPlayerName(victim) & " is too great a level distance from you to fight", BrightRed)Exit FunctionEnd IfEnd IfEnd If 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