SA-MP Forums Archive
Question - 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)
+--- Thread: Question (/showthread.php?tid=586149)



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(szColorsizeof(szColor), "0x%sFF"ClanInfo[clanid][cColor]);
    
SendClanMessage(clanidszColorszMessage); 



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 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.


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.