Need a SaveColor for this.
#1

Hi,

I have a RGB colour system, I want a savecolor for it, it means: When a player types /setmycolor 255 255 255 it will save the color for each spawn or each time that player joins.

Here the code.
Quote:

public OnPlayerConnect(playerid)
cForced[playerid] = 0;
return 1;

dcmd_setmycolor(playerid,params[]) //
{
if(cForced[playerid] == 0)
{
static R, G, B;
if (sscanf(params, "iii", R,G,B)) return SendClientMessage(playerid, 0xff0000aa, "*USAGE: /setmycolor <0-255> <0-255> <0-255>");
SendClientMessage(playerid,(R * 16777216) + (G * 65536) + (B*256), "Your color has been changed!");
SetPlayerColor(playerid, (R * 16777216) + (G * 65536) + (B*256));
}
else return SendClientMessage(playerid, 0xff0000aa, "*You aren't allowed to use this command!");
return 1;
}
Can you help me, guys?

Thanks for reading guys ^^
Reply
#2

bump!
Reply
#3

Save the color (what GetPlayerColor returns*) as integer.

* If SetPlayerColor was not used at all, GetPlayerColor would return 0. Look at sa-mp wiki for a fix.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)