[Help]
#1

Код:
#include <a_samp>

new cmd[128];
new tmp[128];
new idx;
new giveplayername[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
new string[128];
== > line 9 cmd = strtok(cmd,idx); 

#define POLICE 1
#define ARMY 2
#define FBI 3

forward IsPlayerInPolice(playerid);
forward IsPlayerInArmy(playerid);
forward IsPlayerInFbi(playerid);
Код:
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(9) : error 010: invalid function or declaration
Reply
#2

Yes but if i put it in onplayercommand text like this

Код:
#include <a_samp>



#define POLICE 1
#define ARMY 2
#define FBI 3



forward IsPlayerInPolice(playerid);
forward IsPlayerInArmy(playerid);
forward IsPlayerInFbi(playerid);

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128];
new tmp[128];
new idx;
new giveplayername[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
new string[128];
cmd = strtok(cmd,idx);
{
if(strcmp("/command", cmdtext, true, 7) == 0)
{
return 1;
}
return 0;
}
I get these erors

Код:
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(23) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(23) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(33) : error 030: compound statement not closed at the end of file (started at line 17)
Reply
#3

You have one { bracket which you don't need, try this:

pawn Код:
#include <a_samp>

#define POLICE 1
#define ARMY 2
#define FBI 3

forward IsPlayerInPolice(playerid);
forward IsPlayerInArmy(playerid);
forward IsPlayerInFbi(playerid);

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128];
new tmp[128];
new idx;
new giveplayername[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
new string[128];
cmd = strtok(cmd,idx);
if(strcmp("/command", cmdtext, true, 8) == 0)
{
return 1;
}
return 0;
}
And make sure you have the "strtok" function (i don't see it in the code you gave).
Reply
#4

I still get 2 erors and a few warnings


Код:
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(19) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(19) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(18) : warning 204: symbol is assigned a value that is never used: "string"
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(17) : warning 204: symbol is assigned a value that is never used: "sendername"
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(16) : warning 204: symbol is assigned a value that is never used: "giveplayername"
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(15) : warning 203: symbol is never used: "idx"
C:\Documents and Settings\Administrator\Desktop\Jub commands.pwn(14) : warning 204: symbol is assigned a value that is never used: "tmp"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

Quote:
Originally Posted by Don Correlli
And make sure you have the "strtok" function (i don't see it in the code you gave).
Reply
#6

oh didnt see that sry thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)