04.09.2013, 04:23
There you go.
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],
id,
color,
name[MAX_PLAYER_NAME+1];
if(sscanf(params, "ud", id, color))
{
SendClientMessage(playerid, red, "[Usage] /dcolor [Player ID] [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;
}
GetPlayerName(id, name, sizeof(name));
format(string, sizeof(string), "[SUCCESS] You have set %s's color to %d.", name, color);
SendClientMessage(playerid, white, string);
SetPlayerColor(id, color);
}
return 1;
}