Quote:
Originally Posted by Mencent
Hello!
Try this:
PHP код:
//At the top of OnPlayerCommandText
new cmd[128],idx;
cmd = strtok(cmdtext,idx);
//The command
if(!strcmp(cmdtext,"/Command",true))
{
new tmp[128];
tmp = strtok(cmdtext,idx);
if(1 <= tmp <= 1000)
{
//Random Message
SendClientMessage(playerid,0xFF0000FF,"Kicked");
SetTimerEx("DelayedKDick",1000,false,"i",playerid);
}
return 1;
}
//in the script
stock strtok(const string[], &index) //©Jeffry
{
new result[20], length = strlen(string), i = index;
while ((i < length) && (string[i] == ' ')) i++;
strmid(result,string,i,((index = strfind(string, " ", false, i)) == -1) ? (index = length) : (index) , 20);
index++;
return result;
}
- Mencent
|
Hey, I get this error: error 033: array must be indexed (variable "tmp")