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

Player Access Colors


Derek
 Share

Recommended Posts

There are 0-5 accesses. Player (Dark Yellow), Moderator (Gray), Mapper (Teal), Developer (Dark Blue), Admin (Magenta), and Owner(Bright Yellow)

The color by the access name is the color that the player's name changes ingame. So I was wondering how I change the color so when you're a mod, you name is blue, when your an admin, its black, etc.

Thanks  :afro:
Link to comment
Share on other sites

Add this code under the Sub JoinGame(Index)
```
If GetPlayerAccess(Index) = [ACCESS] Then
Call colorplayername(Index, [color])
End If

You can put them for each access. Just remove [ACCESS] and replace that with the Access number.
And replace [color] with the color code you want. So if I want Moderator to be white then I would put :

[code]
If GetPlayerAccess(Index) = 1 Then
Call colorplayername(Index, 15)
End If
[/code]
NOTE : If you want to change all the color of each access you have to have multiple of that code.
You just have to copy and paste and change the [ACCESS] and [color].

If you need more help just say so and I'll help.

Sincerely,
Rithy[/color][/color][/color]
```
Link to comment
Share on other sites

I never was good with adding scripts.
So I'm probably just doing this wrong, but this is what I have and its not working.

' Executes when a player logs into the game.
Sub JoinGame(Index)

If GetPlayerAccess(Index) = 1 Then
Call colorplayername(Index, 15)
End If

If GetPlayerAccess(Index) = 0 Then
Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY)
Else
Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW)
End If

Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE)

If LenB(MOTD) <> 0 Then
Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN)
End If

Call SendWhosOnline(Index)

End Sub
Link to comment
Share on other sites

omg im an idiot i thought this was my post, im sorry here
no credit of this is to me.

Client Source > ModGameLogic > Sub BltPlayerName
If you know your color code, you can change it there in the right case base on the Access you want.
Link to comment
Share on other sites

Alright… I found it but I'm not quite sure what to edit.

Sub BltPlayerName(ByVal Index As Long)
    Dim TextX As Long
    Dim TextY As Long
    Dim color As Long

    If Player(Index).color <> 0 Then
        If Player(Index).color > 16 Then
            Exit Sub
        Else
            color = QBColor(Val(Player(Index).color - 1))
        End If
    Else
        ' Check access level
        If GetPlayerPK(Index) = NO Then
            color = QBColor(YELLOW)
            Select Case GetPlayerAccess(Index)
                Case 0
                    color = QBColor(BROWN)
                Case 1
                    color = QBColor(DARKGREY)
                Case 2
                    color = QBColor(CYAN)
                Case 3
                    color = QBColor(BLUE)
                Case 4
                    color = QBColor(PINK)
            End Select
        Else
            color = QBColor(BRIGHTRED)
        End If
    End If
Link to comment
Share on other sites

color = QBColor(YELLOW)
that is the color for access five

case 1 - 4 is the acces colors for 1-4

Case 1
                    color = QBColor(DARKGREY)

EXAMPLE:
Case 1
                    color = QBColor(WHITE)
Link to comment
Share on other sites

press 'ctrl' + 'f'. Change it to search the whole project. search for: " Executes when a player logs into the game."

press enter. add
```
If GetPlayerAccess(Index) = [ACCESS] Then
Call colorplayername(Index, [color])
End If

[ACCESS] needs to be replaced with a value within 1-5\. Replace [color] with a color.

save the project and compile it by going to File -> Make client.exe[/color][/color]
```
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...