Question -
Edw - 19.08.2015
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?
Re: Question -
brandypol - 19.08.2015
Quote:
Originally Posted by Edw
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?
|
Could you clarify your question please ?
Re: Question -
SumX - 19.08.2015
INI_WriteHex
Re: Question -
Edw - 20.08.2015
Quote:
Originally Posted by brandypol
Could you clarify your question please ?
|
I am Romanian, please excuse me.
So a clan color is as it FF0000 if I want to have color players the clan (SetPlayerColor - clan color) how I could add that 0x FF00000 FF?
Ex: (error)
PHP код:
format(szColor, sizeof(szColor), "0x%sFF", ClanInfo[clanid][cColor]);
SendClanMessage(clanid, szColor, szMessage);
Re: Question -
Mariciuc223 - 20.08.2015
Why want you to save his color when you can set it on his spawn :
Код:
new Colors[] = 0xFFFFFFFF, /* FIRST COLOR */, 0xFF0000FF, // SECOND, you can make more
// on player spawn
if (ClanVariable[playerid] == clan id) SetPlayerColor(playerid, Colors[clan id]);
I hope you understand what i want to say . I'm romanian too , but i'm not proud when i see that "Sorry about my english , but i'm 'roumaine'" - 'roumaine' it's not in english dudes , omg , that french . At least you don't write "roumaine" / you was more smart.
Re: Question -
Vince - 20.08.2015
Colors are
not strings. They are often represented in the hexa
decimal 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.
Re: Question -
Mariciuc223 - 20.08.2015
Quote:
Originally Posted by Vince
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.
|
Sorry , forgot the { }
Код HTML:
new colors[] = { 0xFFFFFFFF, 0xFF0000FF, 0xFFFF00FF }; // etc
Re: Question -
xXxThunderxXx - 20.08.2015
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
Re: Question -
Mariciuc223 - 20.08.2015
Quote:
Originally Posted by xXxThunderxXx
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
|
Код HTML:
If(Example[playerid] == 1);
Awesome exemple ..
1. If will give an error because that it's not defined .. There it's just 'if'
2. For that ';' before if you will recive an compile error (empty statement) because you don't write nothing there to put ';'
You can do it how i said above , or if you don't know how you can make it simplest like that:
Код HTML:
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.