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

Another Practice Script I Made


Vikola
 Share

Recommended Posts

Ok so this is my second script and i made it for practice.
i typed /test and it didnt work. can someoen help me?
```
Case "/test"
If GetPlayerAccess(Index) = 5 Then
Call PlayerMsg(Index, "Pass", WHITE)
ElseIf GetPlayerAccess(Index) = 4 Then
Call PlayerMsg(Index, "Pass", WHITE)
Else
Call PlayerMsg(Index, You aren't an admin!", RED)
End If
Exit Sub
```=)
Link to comment
Share on other sites

@Vikola:

> Ok so this is my second script and i made it for practice.
> i typed /test and it didnt work. can someoen help me?
> ```
> Case "/test"
> If GetPlayerAccess(Index) = 5 Then
> Call PlayerMsg(Index, "Pass", WHITE)
> ElseIf GetPlayerAccess(Index) = 4 Then
> Call PlayerMsg(Index, "Pass", WHITE)
> Else
> Call PlayerMsg(Index, You aren't an admin!", RED)
> End If
> Exit Sub
> ```=)

Again, I don't see a problem with it, but try this:
```
Case "/test"
If GetPlayerAccess(Index) = 5 Then
Call PlayerMsg(Index, "Pass", WHITE)
ElseIf GetPlayerAccess(Index) = 4 Then
Call PlayerMsg(Index, "Pass", WHITE)
End If
                        If GetPlayerAccess(Index) < 4 Then
Call PlayerMsg(Index, You aren't an admin!", RED)
End If
Exit Sub
```
Link to comment
Share on other sites

Just a little heads up, you CAN do else's.
And, you can use > to see if a number is bigger than another (or >= if a number is bigger or equal to another number)

```
Case "/test"
        If GetPlayerAccess(Index) >= 4 Then
            Call PlayerMsg(Index, "Pass", WHITE)
        Else
            Call PlayerMsg(Index, You aren't an admin!", RED)
        End If
        Exit Sub

```
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...