random color on connecting
#1

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

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

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!
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)