18.08.2015, 10:38
Quote:
Hi all. i Have a Question How to make a Command for RGB Colors Like /mycolor [R] [G] [B].
IF i Quit the Server and Come back again the RGB Color stay and to remove it /resetcolor to back the Normal color Please Help iwill +rep |
You've to store player's color when they leave in some external place (e.g. file or in database) and then load it up when player connects. That's pretty much it.
And about /mycolor ® (g) (b). It's pretty easy to do:
pawn Код:
COMMAND:mycolor( playerid, params[] ){
new
Red, Green, Blue ;
if( sscanf(params, "ddd", Red, Green, Blue) ) {
SendClientMessage( playerid, -1, "Use: /mycolor R G B");
return 1;
}
if( ( Red >= 0 && Green >= 0 && Blue >= 0 ) && ( Red <= 255 && Green <= 255 && Blue <= 255 ) ) {
new mixedColor = 0;
mixedColor = (Red << 24) + (Green << 16) + (Blue << 8) + 255;
SetPlayerColor( playerid, mixedColor );
SendClientMessage( playerid, -1, "Done!");
return 1;
} else {
SendClientMessage( playerid, -1, "Error: one or more channels are out of bounds (0<>255)");
return 1;
}
}