SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 08/04/2010, 09:37 PM   #1
johnathon956
Big Clucker
 
Join Date: Jan 2010
Posts: 151
Reputation: 0
Default [TUT]How to change player colours

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
johnathon956 is offline   Reply With Quote
Old 08/04/2010, 09:40 PM   #2
Steven82
High-roller
 
Join Date: Nov 2009
Location: I don't know....
Posts: 2,626
Reputation: 168
Default Re: [TUT]How to change player colours

Very simple TUT, but will help the noobs.
Steven82 is offline   Reply With Quote
Old 08/04/2010, 09:42 PM   #3
johnathon956
Big Clucker
 
Join Date: Jan 2010
Posts: 151
Reputation: 0
Default Re: [TUT]How to change player colours

Quote:
Originally Posted by Steven82
Very simple TUT, but will help the noobs.
yep simple but works
johnathon956 is offline   Reply With Quote
Old 08/04/2010, 10:14 PM   #4
DarrenReeder
Huge Clucker
 
DarrenReeder's Avatar
 
Join Date: Apr 2010
Posts: 493
Reputation: 5
Default Re: [TUT]How to change player colours

very niiice
DarrenReeder is offline   Reply With Quote
Old 08/04/2010, 10:28 PM   #5
snoob
Big Clucker
 
snoob's Avatar
 
Join Date: Aug 2008
Posts: 141
Reputation: 0
Default Re: [TUT]How to change player colours

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


snoob is offline   Reply With Quote
Old 09/04/2010, 12:03 AM   #6
Nero_3D
High-roller
 
Nero_3D's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 3,246
Reputation: 316
Default Re: [TUT]How to change player colours

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]);
__________________


Nero_3D is offline   Reply With Quote
Old 09/04/2010, 09:07 AM   #7
johnathon956
Big Clucker
 
Join Date: Jan 2010
Posts: 151
Reputation: 0
Default Re: [TUT]How to change player colours

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
johnathon956 is offline   Reply With Quote
Old 09/04/2010, 09:20 AM   #8
Grim_
High-roller
 
Grim_'s Avatar
 
Join Date: Sep 2008
Posts: 3,293
Reputation: 63
Default Re: [TUT]How to change player colours

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 :/
Grim_ is offline   Reply With Quote
Old 09/04/2010, 09:22 AM   #9
johnathon956
Big Clucker
 
Join Date: Jan 2010
Posts: 151
Reputation: 0
Default Re: [TUT]How to change player colours

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
johnathon956 is offline   Reply With Quote
Old 09/04/2010, 11:45 AM   #10
Nero_3D
High-roller
 
Nero_3D's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 3,246
Reputation: 316
Default Re: [TUT]How to change player colours

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
__________________


Nero_3D is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change player name? ruckfules99 Help Archive 8 24/04/2010 01:49 PM
Text and Player/Team colours. Andy_McKinley Help Archive 4 10/11/2009 03:45 PM
Change player color DokerJr Help Archive 3 03/11/2009 12:00 PM
How to edit player/job colours Chivava Help Archive 6 22/06/2009 11:44 AM
Change player position. arachimi Help Archive 4 30/04/2009 04:20 PM


All times are GMT. The time now is 06:27 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.