Problem wtf?
#1

i get this errors:

C:\Documents and Settings\Owner\ЕрйцЬнейб есгбуЯбт\gta server\gamemodes\copsandrobbers.pwn(307) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Owner\ЕрйцЬнейб есгбуЯбт\gta server\gamemodes\copsandrobbers.pwn(307) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\Owner\ЕрйцЬнейб есгбуЯбт\gta server\gamemodes\copsandrobbers.pwn(312) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Owner\ЕрйцЬнейб есгбуЯбт\gta server\gamemodes\copsandrobbers.pwn(312) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Owner\ЕрйцЬнейб есгбуЯбт\gta server\gamemodes\copsandrobbers.pwn(306) : warning 203: symbol is never used: "idx"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.






This is my command:

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);

if(strcmp(cmd, "/kick", true) == 0)
{
new tmp[128];
tmp = strtok(cmdtext, idx);

if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /kick [playerid]");

Kick(strval(tmp));
return 1;
}
return 0;
}
Reply
#2

You need strtok

Код:
stock strtok(const string[], &index,seperator=' ')
{
new length = strlen(string);
new offset = index;
new result[128];
while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}

result[index - offset] = EOS;
if ((index < length) && (string[index] == seperator))
{
index++;
}
return result;
}
stock IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
if (string[i] > '9' || string[i] < '0')
return 0;
return 1;
}
Reply
#3

Thank you very much!!!!!!!!
Reply
#4

lol np
Reply
#5

Can you help me to make an arrest command?
Reply
#6

Quote:
Originally Posted by tour15
Can you help me to make an arrest command?
Just see if the playerid is a police officer, then set the criminal's position to whatever.
Reply
#7

Can you give me a simple example if the cop team is TEAM_COPS?
Reply
#8

pawn Код:
#define TEAM_COPS 1
I suggest you to use sscanf and zcmd instead of strcmp and strtok.
Reply
#9

I have already the teams.... The only think i need is the command.... Can someone add my msn to help me do this?
nikostour@hotmail.com
Reply
#10

ahahahahahah poso palio einai auto to topic?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)