You put this under OnPlayerCommandText:
pawn Код:
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
So it gets like this (idk):
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/skin", true)==0)
{
if(IsPlayerInRangeOfPoint(playerid, 10, 198.9780, -127.8640, 1003.5152))
{
new tmp[128];
tmp = strtok (cmdtext, idx);
if(strlen(tmp)==0) SendClientMessage(playerid, COLOR_RED, "USAGE: /skin [ID]");
SetPlayerSkin(playerid, strval(tmp));
}
else SendClientMessage(playerid, COLOR_RED, "You must be in the clothing store.");
return 1;
}
//Other commands here. Dont forget to use cmd instead of cmdtext ;)
return 0;
}
Put this at bottom of script:
pawn Код:
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}