Colors -
Ph0eniX - 12.01.2014
Hi all , i never understand this function with random...and i want to make something with colors .
When 1 player enter in game (OnPlayerConnect) i want to give him random color...i maked this :
Код:
new PlayerColors[200] = {
0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF.....
};
And at OnPlayerConnect:
Код:
SetPlayerColor(playerid, PlayerColors[playerid]);
But ... no effect . What i can do ?
PS: Srry for my bad englesh...i am from italy.
Re: Colors -
ScRipTeRi - 12.01.2014
Maybe this will help you
https://sampwiki.blast.hk/wiki/ColorFix
Re: Colors -
Ph0eniX - 12.01.2014
i sayd , i maked it but don't work , i don't know why it will set me only orange color
Re: Colors -
Seif- - 12.01.2014
SetPlayerColor(playerid, PlayerColors[random(sizeof PlayerColors)]);
Re: Colors -
Ph0eniX - 12.01.2014
ty Seif . Solved
Re: Colors -
Ph0eniX - 12.01.2014
Solved+Edit:
How i can make , when 1 player use /invisible another player to don't see hes nick name ?
Re : Colors -
S4t3K - 12.01.2014
PHP код:
// In OnPlayerCommandText
if(strcmp(cmd, "/invisible", true) == 0)
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(playerid, i, 0);
}
SendClientMessage(playerid, -1, "{9ACD32}[Update]{FFFFFF} Now nobody can see your nickname !");
return 1;
}
No indentation, but the essential is here.
Re: Colors -
Ph0eniX - 13.01.2014
S4t3K , ty but it don't work ... when 1 player type /invisible all players can see hes name and health+armour...
Код:
CMD:invisible(playerid,params[])
{
if(IsPlayerAdmin(playerid) || AccInfo[playerid][Level] >= 5)
{
if(AccInfo[playerid][Hide] == 0)
{
AccInfo[playerid][pColor] = GetPlayerColor(playerid);
SetPlayerColor(playerid, 0xFFFFFF00);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~g~Invisible!",2500,3);
AccInfo[playerid][Hide] = 1;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new int1 = GetPlayerInterior(playerid);
LinkVehicleToInterior(GetPlayerVehicleID(playerid),int1+1);
for (new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(playerid, i, 0);
}
}
return 1;
}
else return SendClientMessage(playerid, lightred,"ERROR: You are already Invisible!");
}
else return ErrorMessages(playerid, 1);
}
+...how i can make 1 "update" at this...
Код:
if(AccInfo[playerid][Level] > 0 && AccInfo[playerid][Hide] == 0)
{
new str3[256];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str3, 256, "%s{0000FF}(Admin){15FF00}(%d):{FFFFFF} %s",name, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), str3);
return 0;
}
but...to show at head when 1 player say something , like
SendPlayerMessageToAll
Re: Colors -
Ph0eniX - 13.01.2014
....up