24.08.2016, 11:19
I am trying to replicate a server, They had a command where they can let their player to make their own colors by using the /cc (stands for color change
I have no idea on how to make it though so far I have coded this into my /setcolor command. The format are; /setcolor [0-255] [0-255] [0-255].

I have no idea on how to make it though so far I have coded this into my /setcolor command. The format are; /setcolor [0-255] [0-255] [0-255].
PHP код:
CMD:setcolor(playerid, params[])
{
if(!pInfo[playerid][pLogged] && !pInfo[playerid][pUser])
return SendError(playerid, "You must logged in (register) to your account first.");
new c[3];
if(sscanf(params, "ddd", c[0], c[1], c[2]))
return SendSyntax(playerid, "/setcolor [0-255] [0-255] [0-255]");
if(c[0] < 0 || c[0] > 255)
return SendError(playerid, "Invalid color number for #1.");
if(c[1] < 0 || c[1] > 255)
return SendError(playerid, "Invalid color number for #2.");
if(c[2] < 0 || c[2] > 255)
return SendError(playerid, "Invalid color number for #3.");
return 1;
}