25.09.2011, 13:30
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/changeskin", true, 11) == 0)
{
new string[128], skinid;
if(!cmdtext[11]) return SendClientMessage(playerid, COLOR, "Usage: /changeskin [skinid]");
skinid = strval(cmdtext[12]);
switch(skinid)
{
case 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289: { return SendClientMessage(playerid, COLOR, "Error: invalid skin ID!"); }
default:
{
SetPlayerSkin(playerid, skinid);
format(string, sizeof(string), "You have successfully changed your skin to %d", skinid);
SendClientMessage(playerid, COLOR, string);
}
}
return 1;
}
return 0;
}