[Tutorial] [TUT]How to change player colours
#1

add this to the top of your script you can change these numbers

pawn Code:
new playerColors[MAX_PLAYERS] = {
0xAA3333AA,
0xAFAFAFAA,
0x33AA33AA,
0xAA3333AA,
0xFFFF00AA,
0xFFFFFFAA,
0xFF9900AA,
0xFF8C55FF,
0x6DC5F3FF,
0xFF0000FF,
0x2986CEFF,
0xC6BEBDFF,
0x000000FF,
0x74E80099,
0xBE615099,
0x00BBBB99,
0xFF0000FF
};
now add this too
pawn Code:
SetPlayerColor(playerid, playerColors[playerid % sizeof playerColors]);
thanks too ♣ Joker ♠

pawn Code:
public OnPlayerRequestClass(playerid, classid)
hope this helps you i dont know if there is allready a tut for this i found this myself
Reply
#2

Very simple TUT, but will help the noobs.
Reply
#3

Quote:
Originally Posted by Steven82
Very simple TUT, but will help the noobs.
yep simple but works
Reply
#4

very niiice
Reply
#5

Quote:
Originally Posted by johnathon956
Quote:
Originally Posted by Steven82
Very simple TUT, but will help the noobs.
yep simple but works
work until you have more then 17 player ... then you are out of array boundary.
Reply
#6

Quote:
Originally Posted by snoob
Quote:
Originally Posted by johnathon956
Quote:
Originally Posted by Steven82
Very simple TUT, but will help the noobs.
yep simple but works
work until you have more then 17 player ... then you are out of array boundary.
there is an easy fix for that

pawn Code:
SetPlayerColor(playerid, playerColors[playerid % sizeof playerColors]);
Reply
#7

Quote:
Originally Posted by ♣ Joker ♠
Quote:
Originally Posted by snoob
Quote:
Originally Posted by johnathon956
Quote:
Originally Posted by Steven82
Very simple TUT, but will help the noobs.
yep simple but works
work until you have more then 17 player ... then you are out of array boundary.
there is an easy fix for that

pawn Code:
SetPlayerColor(playerid, playerColors[playerid % sizeof playerColors]);
lol why didnt i thing of that XD
Reply
#8

Quote:
Originally Posted by ♣ Joker ♠
Quote:
Originally Posted by snoob
Quote:
Originally Posted by johnathon956
Quote:
Originally Posted by Steven82
Very simple TUT, but will help the noobs.
yep simple but works
work until you have more then 17 player ... then you are out of array boundary.
there is an easy fix for that

pawn Code:
SetPlayerColor(playerid, playerColors[playerid % sizeof playerColors]);
I have a question, what exactly does "%" do? I never found a good place to find an explanation :/
Reply
#9

Quote:
Originally Posted by _Xerxes_
Quote:
Originally Posted by ♣ Joker ♠
Quote:
Originally Posted by snoob
Quote:
Originally Posted by johnathon956
Quote:
Originally Posted by Steven82
Very simple TUT, but will help the noobs.
yep simple but works
work until you have more then 17 player ... then you are out of array boundary.
there is an easy fix for that

pawn Code:
SetPlayerColor(playerid, playerColors[playerid % sizeof playerColors]);
I have a question, what exactly does "%" do? I never found a good place to find an explanation :/
uhm dunno XD
Reply
#10

Quote:
Originally Posted by _Xerxes_
Quote:
Originally Posted by ♣ Joker ♠
Quote:
Originally Posted by snoob
Quote:
Originally Posted by johnathon956
Quote:
Originally Posted by Steven82
Very simple TUT, but will help the noobs.
yep simple but works
work until you have more then 17 player ... then you are out of array boundary.
there is an easy fix for that

pawn Code:
SetPlayerColor(playerid, playerColors[playerid % sizeof playerColors]);
I have a question, what exactly does "%" do? I never found a good place to find an explanation :/
It calculates the Rest from a division

Example:
playerid = 48 48 % 17 = 14
playerid = 15 15 % 17 = 15
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)