SA-MP Forums Archive
random color on connecting - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: random color on connecting (/showthread.php?tid=222529)



random color on connecting - omer5198 - 07.02.2011

^^title... how can i make that a player will get random color when he connects?


Re: random color on connecting - Ash. - 07.02.2011

SAMP can do it for you, it should do it automatically if you dont have SetPlayerColor in your script


Re: random color on connecting - omer5198 - 07.02.2011

samp is suppose to do it for me... and it did it well but now it doesn't.. when i type anything in this code:
Quote:

public OnPlayerText(playerid, text[])
{
new string[128];
new playercolor = GetPlayerColor(playerid);
if(IsPlayerAdmin(playerid))
{
new chater2[MAX_PLAYER_NAME];
GetPlayerName(playerid, chater2, MAX_PLAYER_NAME);
format(string, sizeof(string), "[%s]: %s [id:%d | Admin]", chater2, text, playerid);
SendClientMessageToAll(playercolor, string);
}
else
{
new chater[MAX_PLAYER_NAME];
GetPlayerName(playerid, chater, MAX_PLAYER_NAME);
format(string, sizeof(string), "[%s]: %s [id:%d | Player]", chater, text, playerid);
SendClientMessageToAll(playercolor, string);
}
return 1;
}

it always type it black... i dont know why because my color is orange/ any other color!


Re: random color on connecting - Ash. - 07.02.2011

SetPlayerColor must be used before GetPlayerColor will return the correct colour.

OR you can use this;
https://sampwiki.blast.hk/wiki/ColorFix