Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Simple But Effective Pvp Item To Add


janpan40
 Share

Recommended Posts

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 Handler
If GetPlayerLevel(attacker) <> GetPlayerLevel(victim) Then
If GetPlayerLevel(attacker) > GetPlayerLevel(Victim) + 15 Then
Call PlayerMsg(attacker, GetPlayerName(victim) & " is too great a level distance from you to fight", BrightRed)
Exit Function
End If
End If
>! Their You Know Have A Level Difference Function In Pvp, Now If A Player Is 15 Levels Above Another Player
They 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 use

Remember 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

~~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) Then

You'll have to change that to:

```
If GetPlayerLevel(attacker) > GetPlayerLevel(Victim) + 15 Then
```
Link to comment
Share on other sites

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 equation

man1 > 15 < man2

I failed that test btw lol
Link to comment
Share on other sites

@janpan40:

> I know, thats why i hate math it doesnt make sence logicaly

> but it sometimes works.

> I failed that test btw lol

Your logic, infallible it is…
/sarcasm

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.
Link to comment
Share on other sites

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

ADD:

If GetPlayerLevel(attacker) < GetPlayerLevel(Victim) - 15 Then
...
End If

This 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) Then
If GetPlayerLevel(attacker) > GetPlayerLevel(Victim) + 15 Then
If GetPlayerLevel(attacker) < GetPlayerLevel(Victim) - 15 Then
Call PlayerMsg(attacker, GetPlayerName(victim) & " is too great a level distance from you to fight", BrightRed)
Exit Function
End If
End If
End If
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...