Compile error
#1

I got some errors can you help me pls

PHP код:
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(150) : error 017undefined symbol "cmd"
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(152) : error 017undefined symbol "strtok"
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(152) : error 033: array must be indexed (variable "tmp")
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
3 Errors

PHP код:
//============================================================================//
//====================================CMDS======================================//
//============================================================================//
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!
IsPlayerAdmin(playerid)) return 0;
    if(
strcmp(cmd"/respawn_veh",true) == 0) {
    new 
tmp[256];
    
tmp strtok(cmdtext,idx);
    
SetVehicleToRespawn(strval(tmp));
    return 
1;

Reply
#2

up...
Reply
#3

pawn Код:
if(strcmp(cmd, "/respawn_veh",true) == 0)
{
    new tmp[256];
    if(!IsPlayerAdmin(playerid)) return 0;
    tmp = strtok(cmdtext,idx);
    SetVehicleToRespawn(strval(tmp));
} <--- You forgot
Reply
#4

6 erros now..
Quote:

C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(149) : error 017: undefined symbol "cmd"
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(153) : error 017: undefined symbol "strtok"
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(153) : error 033: array must be indexed (variable "tmp")
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(160) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(160) : error 010: invalid function or declaration
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(162) : error 010: invalid function or declaration
C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(172) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.

Reply
#5

Do you have strtok defined? If not, add this outside any callback:

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;
}
Reply
#6

Quote:

C:\Users\Bruno\Desktop\CoD-Rivals\CoD-Rivals\gamemodes\CoD-R.pwn(171) : error 017: undefined symbol "idx"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Line 171 tmp = strtok(cmdtext,idx);
Reply
#7

https://sampforum.blast.hk/showthread.php?tid=318635
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)