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

Prevent certain classes from attacking another?


gdog12356
 Share

Recommended Posts

Hello, i was wondering if i could have class A and B not able to attack eachother. But class A and B CAN attack classes C and D. Vice versa with C + D, allies basicly. I want to have certain classes not able to pvp other classes. Like for a naruto game, leaf village - Uchiha (would be considered a class) and leaf - Hyuuga (another class). origins would caunt them as 2 diffrent classes, so i want to disable them from attacking another.
Link to comment
Share on other sites

Open server.vbp and add the following above:

```
    CanPlayerAttackPlayer = True

```in Function CanPlayerAttackPlayer:
```

    If GetPlayerClass(attacker) = GetPlayerClass(victim) Then Exit Function
    Select Case GetPlayerClass(attacker)
        Case 1 ' attacker is class 1
            If GetPlayerClass(victim) = 2 Then Exit Function ' they're allied with class2
                                                        ' is the victim class2?
        Case 2 ' attacker is class 2
            If GetPlayerClass(victim) = 1 Then Exit Function

        Case 3 ' attacker is class 3
            If GetPlayerClass(victim) = 4 Then Exit Function ' they're allied with class4
                                                        ' is the victim class4?
        Case 4 ' attacker is class 4
            If GetPlayerClass(victim) = 3 Then Exit Function
    End Select

```
Remember: You can add this anywhere above:
```
    CanPlayerAttackPlayer = True

```
Link to comment
Share on other sites

@Soul:

> Open server.vbp and add the following above:
>
> ```
>     CanPlayerAttackPlayer = True
>
> ```in Function CanPlayerAttackPlayer:
> ```
>
>     If GetPlayerClass(attacker) = GetPlayerClass(victim) Then Exit Function
>     Select Case GetPlayerClass(attacker)
>         Case 1 ' attacker is class 1
>             If GetPlayerClass(victim) = 2 Then Exit Function ' they're allied with class2
>                                                         ' is the victim class2?
>         Case 2 ' attacker is class 2
>             If GetPlayerClass(victim) = 1 Then Exit Function
>        
>         Case 3 ' attacker is class 3
>             If GetPlayerClass(victim) = 4 Then Exit Function ' they're allied with class4
>                                                         ' is the victim class4?
>         Case 4 ' attacker is class 4
>             If GetPlayerClass(victim) = 3 Then Exit Function
>     End Select
>
> ```
> Remember: You can add this anywhere above:
> ```
>     CanPlayerAttackPlayer = True
>
> ```

thanx u da best :)
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...