05.01.2013, 17:06
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(setskin,7,cmdtext);
return 0;
}
pawn Код:
dcmd_setskin(playerid, params[])
{
if(!CmdLevelCheck(playerid,"setskin")) return CmdLevelError(playerid,"setskin");
new id,skinid,string[128];
if(sscanf(params, "ud", id, skinid)) return SendClientMessage(playerid, RED, "USAGE: /SETSKIN [ID / NICK] [SKINID]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "This player is offline");
if(IsSkinWrong(skinid)) return SendClientMessage(playerid,RED,"Error: enter a valid skin-ID");
SendCommandMsg(playerid,"setskin");
if(playerid != id) format(string,sizeof(string),"Administrator: %s have set your skin to %d",AdminName(playerid),skinid);
else format(string,sizeof(string),"You have set your own skin to %d",skinid);
SendClientMessage(id,YELLOW,string);
format(string,sizeof(string),"You have set %s his skin to %d",Name(id),skinid);
SendClientMessage(playerid,YELLOW,string);
return SetPlayerSkin(id,skinid);
}