23.10.2011, 05:08
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { return 0; } COMMAND:SetColor(playerid,params[]) { new stat[20]; if(sscanf(params,"s[20]",stat)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE:/color [ColorName]"); SendClientMessage(playerid, COLOR_YELLOW, "Color - Yellow / Red / Gray / Orange / Indigo / Black / DarkGray"); SendClientMessage(playerid, COLOR_YELLOW, "Color - LightBlue / Purple / Blue / Pink / BrightRed / Green / White"); return 1; } if(!strcmp(stat,"Yellow",true)) { format(String,sizeof(String),"Your color has changed."); SendClientMessage(playerid,COLOR_YELLOW,String); SetPlayerColor(playerid,COLOR_YELLOW); return 1; } else else if(!strcmp(stat,"DarkGrey",true)) { format(String,sizeof(String),"Your color has changed."); SendClientMessage(playerid,COLOR_DARKGREY,String); SetPlayerColor(playerid,COLOR_DARKGREY); return 1; } else { SendClientMessage(playerid, COLOR_YELLOW, "Color - Yellow / Red / Gray / Orange / Indigo / Black / DarkGray"); SendClientMessage(playerid, COLOR_YELLOW, "Color - LightBlue / Purple / Blue / Pink / BrightRed / Green / White"); } return 1; }