|
Hello, I would like to have color playerii clan clan but is a little problem, and why I decided to ask. Colors are saved in the following way XXXXXX (FF0000) how I could add besides these XXXXXX 0xXXXXXXFF can put color to the player?
|
format(szColor, sizeof(szColor), "0x%sFF", ClanInfo[clanid][cColor]);
SendClanMessage(clanid, szColor, szMessage);
new Colors[] = 0xFFFFFFFF, /* FIRST COLOR */, 0xFF0000FF, // SECOND, you can make more // on player spawn if (ClanVariable[playerid] == clan id) SetPlayerColor(playerid, Colors[clan id]);
|
Colors are not strings. They are often represented in the hexadecimal number system but they are still numbers. The 0x prefix is there so that the Pawn compiler knows to treat it as a hexadecimal number instead of a variable.
|
new colors[] = { 0xFFFFFFFF, 0xFF0000FF, 0xFFFF00FF }; // etc
public OnPlayerSpawn(playerid)
{
If(Example[playerid] == 1);
SetPlayerColor(playerid, ClanColor);
SendClientMessage(playerid, YELLOW, "You Are a clan Member So your Clan Color Has Been Set");
return 1;
}
Example means your clan variable e.g Grove, Ballas, Aztecaz
|
You Must Do .
Код:
public OnPlayerSpawn(playerid)
{
If(Example[playerid] == 1);
SetPlayerColor(playerid, ClanColor);
SendClientMessage(playerid, YELLOW, "You Are a clan Member So your Clan Color Has Been Set");
return 1;
}
Код:
Example means your clan variable e.g Grove, Ballas, Aztecaz |
If(Example[playerid] == 1);
public OnPlayerSpawn(playerid)
{
switch(Clan[playerid])
{
case 1: SetPlayerColor(playerid, 0x800080FF); // Ballas color (Purple)
case 2: SetPlayerColor(playerid, 0x008000FF); // Grove color (Green)
case 3: SetPlayerColor(playerid, 0x00FFFFFF); // Varrios Los Aztecas Color (Aqua)
case 4: SetPlayerColor(playerid, 0xFFFF00FF); // Los Santos Vagos Color (Yellow)
}
return 1;
} // P.S Is just an exemple.