Errors Help
#1

pawn Code:
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23464) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23464) : error 033: array must be indexed (variable "cmd")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23476) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23476) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23517) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23517) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23553) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23553) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23927) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23927) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23945) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23945) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23973) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23973) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23990) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(23990) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(24006) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(24006) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(24022) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(24022) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(24039) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(24039) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(24058) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(24058) : error 033: array must be indexed (variable "tmp")
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(24074) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(24074) : error 033: array must be indexed (variable "tmp")

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
not exactly sure how to fix this
Reply
#2

WOW post the script bro we cant just fix it for you...
Reply
#3

Strtok

Paste this somewhere in your script
pawn Code:
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
#4

Here is link to download becuz its a gamemode i downloaded and edited

http://www.mediafire.com/?x8xhtxhnh5pvz0q
Reply
#5

Quote:
Originally Posted by HellSphinX
View Post
Strtok

Paste this somewhere in your script
pawn Code:
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;
}
now i only get this

pawn Code:
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(26622) : error 017: undefined symbol "isNumeric"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(26634) : error 017: undefined symbol "isNumeric"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#6

here you go
pawn Code:
new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
Make that a gobal
Reply
#7

im very sorry for double posting i said the wrong thing above put this at the bottom of the script
pawn Code:
IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}
put this at the bottom of the script.
Reply
#8

Quote:
Originally Posted by HellSphinX
View Post
Strtok

Paste this somewhere in your script
pawn Code:
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;
}
Quote:
Originally Posted by [A]ndrei
View Post
here you go
pawn Code:
new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
Make that a gobal
i get so many errors it says stop working when i add that
Reply
#9

use what i said 2nd after here again
pawn Code:
IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}
put this at the bottom of the script...
Reply
#10

pawn Code:
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(26622) : error 017: undefined symbol "isNumeric"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(26634) : error 017: undefined symbol "isNumeric"
C:\Users\User\Desktop\GTA - San Andreas\FR 2013\gamemodes\freeroamEN.pwn(27810) : error 021: symbol already defined: "IsNumeric"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
got this
Reply
#11

O_O then if it defined and not defined i dont understand it myself :PP
Reply
#12

Quote:
Originally Posted by [A]ndrei
View Post
O_O then if it defined and not defined i dont understand it myself :PP
Need help :"(
Reply
#13

Post the lines of the errors!
Reply
#14

Quote:
Originally Posted by HellSphinX
View Post
Post the lines of the errors!
pawn Code:
if(!strlen(inputtext) || !isNumeric(inputtext) || strval(inputtext)<=0) return ShowPlayerDialog(playerid,DIALOGGIRIGARA,DIALOG_STYLE_INPUT,"Race's laps","{FFFFFF}ERROR:\nTipea el numero de laps para el circuito (1:sprint 2-o mбs:circuito)","Continuar","");
^Line 26640

pawn Code:
if(!strlen(inputtext) || !isNumeric(inputtext) || strval(inputtext)<=0) return ShowPlayerDialog(playerid,DIALOGCOSTOGARA,DIALOG_STYLE_INPUT,"Race's Coste","{FFFFFF}Pon el coste de la carrera (min 1):","Continuar","");
^Line 26628

pawn Code:
IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}
^Lines 27815-27822 this is error "already defined"
Reply
#15

I just downloaded the code you uploaded on Mediafire and I found this:

pawn Code:
stock IsNumeric(const string[])
{
  new length=strlen(string);
  if (length==0) return false;
  for (new i = 0; i < length; i++)
    {
      if (
            (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+') // Not a number,'+' or '-'
             || (string[i]=='-' && i!=0)                                             // A '-' but not at first.
             || (string[i]=='+' && i!=0)                                             // A '+' but not at first.
         ) return false;
    }
  if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
  return true;
}
Do you still have this after you defined IsNumeric with [A]ndrei's method? If so then remove your IsNumeric stock and use only [A]ndrei's one.
Reply
#16

Quote:
Originally Posted by HellSphinX
View Post
I just downloaded the code you uploaded on Mediafire and I found this:

pawn Code:
stock IsNumeric(const string[])
{
  new length=strlen(string);
  if (length==0) return false;
  for (new i = 0; i < length; i++)
    {
      if (
            (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+') // Not a number,'+' or '-'
             || (string[i]=='-' && i!=0)                                             // A '-' but not at first.
             || (string[i]=='+' && i!=0)                                             // A '+' but not at first.
         ) return false;
    }
  if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
  return true;
}
Do you still have this after you defined IsNumeric with [A]ndrei's method? If so then remove your IsNumeric stock and use only [A]ndrei's one.
that removed the already defined error but still have the 2 undefined errors
Reply
#17

It's IsNumeric not isNumeric .
Reply
#18

FIXED thank you so much..ALL YOU GUYS
Reply
#19

No problem glad it worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)