17.01.2010, 03:00
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new tmp[128], string[128], cmd[128], idx, skinid;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/changeskin", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR, "Usage: /changeskin [skinid]");
skinid = strval(tmp);
if(IsValidSkin(skinid) == 0) return SendClientMessage(playerid, COLOR, "Error: invalid skin ID!");
SetPlayerSkin(playerid, skinid);
format(string, sizeof(string), "You have successfully changed your skin to %d", skinid);
SendClientMessage(playerid, COLOR, string);
return 1;
}
return 0;
}