04.09.2013, 05:13
Oops, I didn't get you right.
I thought you wanted him to be able to set everyone's color, so that's what the command I posted above does.
But here you go, I made you a new command, using this he will only be able to set his own color.
I thought you wanted him to be able to set everyone's color, so that's what the command I posted above does.
But here you go, I made you a new command, using this he will only be able to set his own color.
PHP код:
CMD:dcolor(playerid, params[])
{
if(PlayerInfo[playerid][dRank] < 1) return SendClientMessage(playerid, red, "[Error] You are not authorised to use this command.");
else
{
new string[84],
color;
if(sscanf(params, "d", color))
{
SendClientMessage(playerid, white, "[Usage] /dcolor [Color ID]");
SendClientMessage(playerid, white, "[Info] Colours: 0=black 1=white 2=red 3=orange 4=yellow 5=green 6=blue 7=purple 8=brown 9=pink");
return 1;
}
format(string, sizeof(string), "[SUCCESS] You set your color to %d.", color);
SendClientMessage(playerid, white, string);
SetPlayerColor(playerid, color);
}
return 1;
}