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

Change name color not working?


Recommended Posts

Ok I changed that, but now it just says "an error occurred". What else is wrong?
```
Case "/changecolor"
If GetPlayerAccess(Index) < 4 Then
call colorplayername(index, 15)
Else
call playermsg(Index, "An Error Occured.", BRIGHTRED)
End if
Exit Sub
```
Link to comment
Share on other sites

Ok first off you are using the wrong variable all together second off like bobosk said you are using less than where you should be using greater than. And last, you need parenthises around the 15\. here is your code that I fixed for you.

```
Case "/changecolor"
If GetPlayerAccess(Index) > 4 Then
call SetPlayerNameColor(index, "15")
Else
call playermsg(Index, "An Error Occured.", BRIGHTRED)
End If
Exit Sub

```
This command will let you pick when you type in the code for example /changecolor 15 (15 is the color that I want the name to be)
```
Case "/changecolor"
If GetPlayerAccess(Index) > 4 Then
ColorID = TextSay(1)
Call SetPlayerNameColor(Index, ColorID)
Else
Call PlayerMsg(Index, "An Error Occured.", BRIGHTRED)
End If
Exit Sub

```
On the code below you can change other players colors (Example: /changecolor Kira 15    Kira is the player and 15 is the color)
```
Case "/changecolor"
If GetPlayerAccess(Index) > 4 Then
PlayerID = FindPlayer(TextSay(1))
ColorID = TextSay(2)
Call SetPlayerNameColor(PlayerID, ColorID
Else
Call PlayerMsg(Index, "An Error Occured.", BRIGHTRED)
End If
Exit Sub

```GoodLuck! :)
Link to comment
Share on other sites

Case "/changecolor"
If GetPlayerAccess(Index) > 4 Then
call SetPlayerNameColor(index, "15")
Else
call playermsg(Index, "An Error Occured.", BRIGHTRED)
End If
Exit Sub
You don't need quotes around the 15, and i didn't tell him to use a > instead of a <, i'm saying that his access is higher than what his script is checking for, all in all, not every / command needs a check for access, which is obviously a common mis-conception, judging by your recent "tutorials"
Link to comment
Share on other sites

Bobosk Im sorry im not as good as "scripter" as you are _obviously_ are but it works in my game and I only said you said that he is using less than I wanted him to know that he should be using the greater than for him to be able to use it
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...