10.06.2013, 05:03
Quote:
Oh thats why. Thanks but is there any way to do like /color green other than Onplayercommandtext?
|
pawn Code:
CMD:color(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, 0xCC0000AA, "Valid colors: green, red, blue");
new tmp[10];
if(!strcmp(params, "green", true))
{
SetPlayerColor(playerid, 0x33AA33AA);
tmp="green";
}
else if(!strcmp(params, "red", true))
{
SetPlayerColor(playerid, 0xFF0000AA);
tmp="red";
}
else if(!strcmp(params, "blue", true))
{
SetPlayerColor(playerid, 0x0000FFAA);
tmp="blue";
}
//and so on
new string[100];
format(string, sizeof(string), "You set your color to %s", tmp);
SendClientMessage(playerid, 0xCCCC00AA, string);
return 1;
}