24.07.2012, 13:33
I don't see the problem, seeing as I don't use strcmp, but look, THIS is the best way to do something like this with the default command processor.
This checks if the player typed /clothes, and did not type anything afterwards, promping him with a message. If he did type something, it checks what he types, converts it to an integer, and sets his skin using it.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/clothes", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,40.0,207.4733,-109.8061,1005.1328))
{
new tmp[128];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /clothes [skinid]");
if(strval(tmp) >= 0 && strval(tmp) <= 299) SetPlayerSkin(playerid, strval(tmp)); //Checks if valid skinid. Also, make sure you restrict skins that aren't used, because if there is a skinid with no skin, player crashes.
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in range of whatever");
return 1;
}
return 0;
}