some errors
#1

Quote:

C:\Users\signature\Desktop\lvcnr\pawno\include\gl_ common.inc(75) : error 021: symbol already defined: "strtok"
C:\Users\signature\Desktop\lvcnr\pawno\include\gl_ common.inc(134) : error 021: symbol already defined: "isNumeric"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors

After Removing This 75 LINE

75 LINE: new Ramp[MAX_PLAYERS];
134 LINE: EMPTY

I got This Errors

Quote:

C:\Users\signature\Desktop\lvcnr\pawno\include\gl_ common.inc(75) : error 021: symbol already defined: "strtok"
C:\Users\signature\Desktop\lvcnr\pawno\include\gl_ common.inc(134) : error 021: symbol already defined: "isNumeric"
E:\lvcnr\GOB STUFF\my.pwn(4114) : error 017: undefined symbol "Ramp"
E:\lvcnr\GOB STUFF\my.pwn(4114) : warning 215: expression has no effect
E:\lvcnr\GOB STUFF\my.pwn(4114) : error 001: expected token: ";", but found "]"
E:\lvcnr\GOB STUFF\my.pwn(4114) : error 029: invalid expression, assumed zero
E:\lvcnr\GOB STUFF\my.pwn(4114) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.

Help me to FIX THIS
Reply
#2

The problem is that Strtok and isNumeric exists two times..
Return what you removed then.
if you have ( strtok - isNumeric ) on your script remove it and compile, If not then try to Remove
pawn Код:
#include <gl_ common>
Reply
#3

you mean this Like
forward IsNumeric(const string[]);
or
#pragma unused strtok

remove which line?
Reply
#4

So you already have them already, Then remove
pawn Код:
forward IsNumeric(const string[]);
public 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;
}
And
pawn Код:
stock 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;
}
If found

OR try to just remove "#include <gl_common>"
Reply
#5

i dont have public IsNumeric(const string[]);
i only have

forward IsNumeric(const string[]);

connect me on skype ammarabid.rich
Reply
#6

You should either add those stock at the bottom of the script:
pawn Код:
stock 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;
}

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;
}
and have them only ONCE in the script and don't include gl_common.inc at all..

Or:
pawn Код:
#include "../include/gl_common.inc"
under including a_samp and remove any code you define those symbols.
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You should either add those stock at the bottom of the script:
pawn Код:
stock 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;
}

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;
}
and have them only ONCE in the script and don't include gl_common.inc at all..

Or:
pawn Код:
#include "../include/gl_common.inc"
under including a_samp and remove any code you define those symbols.
The problem was that he has another include contains strtok.. So I unincluded gl_common and gave him
pawn Код:
stock LoadStaticVehiclesFromFile(const filename[])
{
    new File:file_ptr;
    new line[256];
    new var_from_line[64];
    new vehicletype;
    new Float:SpawnX;
    new Float:SpawnY;
    new Float:SpawnZ;
    new Float:SpawnRot;
    new Color1, Color2;
    new index;
    new vehicles_loaded;

    file_ptr = fopen(filename,filemode:io_read);
    if(!file_ptr) return 0;

    vehicles_loaded = 0;

    while(fread(file_ptr,line,256) > 0)
    {
        index = 0;

        // Read type
        index = token_by_delim(line,var_from_line,',',index);
        if(index == (-1)) continue;
        vehicletype = strval(var_from_line);
        if(vehicletype < 400 || vehicletype > 611) continue;

        // Read X, Y, Z, Rotation
        index = token_by_delim(line,var_from_line,',',index+1);
        if(index == (-1)) continue;
        SpawnX = floatstr(var_from_line);

        index = token_by_delim(line,var_from_line,',',index+1);
        if(index == (-1)) continue;
        SpawnY = floatstr(var_from_line);

        index = token_by_delim(line,var_from_line,',',index+1);
        if(index == (-1)) continue;
        SpawnZ = floatstr(var_from_line);

        index = token_by_delim(line,var_from_line,',',index+1);
        if(index == (-1)) continue;
        SpawnRot = floatstr(var_from_line);

        // Read Color1, Color2
        index = token_by_delim(line,var_from_line,',',index+1);
        if(index == (-1)) continue;
        Color1 = strval(var_from_line);

        index = token_by_delim(line,var_from_line,';',index+1);
        Color2 = strval(var_from_line);
       
        //printf("%d,%.2f,%.2f,%.2f,%.4f,%d,%d",vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2);

        AddStaticVehicleEx(vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2,(30*60)); // respawn 30 minutes
       
        /*new numplate_test[32+1];
        format(numplate_test,32,"GRLC{44AA33}%d",vid);
        SetVehicleNumberPlate(vid, numplate_test);*/

       
        vehicles_loaded++;
    }

    fclose(file_ptr);
    return vehicles_loaded;
}

//----------------------------------------------------------

stock 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;
}
And It was fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)