06.03.2009, 17:10
Ok, so I don't know what happened. I didn't touch any code of mine or something. Simply SetPlayerSkin function doesn't work.
These are two of my commands, both don't work at all. It does send the messages. Everything is correct but skin, it doesn't set it.
I tried once with strval(cmd) without setting any shorter varieble, then I tried with a shorter varieble
These are two of my commands, both don't work at all. It does send the messages. Everything is correct but skin, it doesn't set it.
I tried once with strval(cmd) without setting any shorter varieble, then I tried with a shorter varieble
pawn Код:
new skin=strval(cmd);
pawn Код:
if(!strcmp(cmd,"/skin",true))
{
if(!pInfo[playerid][Admin]) return aerror(playerid);
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /skin [skinid]");
return SetPlayerSkin(playerid,strval(cmd));
}
if(!strcmp(cmd,"/setskin",true))
{
if(!pInfo[playerid][Admin]) return aerror(playerid);
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setskin [playername/id] [skinid]");
id=ReturnUser(cmd);
if(!IsPlayerConnected(id)) return error(playerid);
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setskin [playername/id] [skinid]");
new skin=strval(cmd);
SetPlayerSkin(id,skin);
format(string,sizeof(string),"Admin %s has changed your skin to %d.",PlayerName(playerid),skin);
SendClientMessage(id,COLOR_RED,string);
format(string,sizeof(string),"You've changed %s's skin to %d.",PlayerName(id),skin);
return SendClientMessage(playerid,COLOR_RED,string);
}