Symbol already defined pissing me off
#1

Hello again, second post today, I'm trying to put this in my gamemode:
PHP код:
    if(strcmp("/tp"cmdtrue) == 0)
    {
     if(
IsPlayerAdmin(playerid)) {
            new 
temp[256], playerFloat:XFloat:YFloat:Zcaridseat;
            
player strval(temp);
            
GetPlayerPos(playerXYZ);
            if(
IsPlayerInAnyVehicle(playerid)){
                
carid GetPlayerVehicleID(playerid);
                
seat GetPlayerVehicleSeat(playerid);
                
SetVehiclePos(caridX+1YZ);
                
PutPlayerInVehicle(playeridcaridseat);
                return 
1;
            }
            
SetPlayerPos(playeridX+1YZ);
               return 
1;
        }
        else{
            
SendClientMessage(playeridCOLOR_WHITE"SERVER: You are not authorized to use this command.");
            return 
1;
        }
    }
    if(
strcmp("/get"cmdtrue) == 0)
    {
     if(
IsPlayerAdmin(playerid)) {
               new 
temp[256], playerFloat:XFloat:YFloat:Zcaridseat;
            
player strval(temp);
            
GetPlayerPos(playeridXYZ);
            if(
IsPlayerInAnyVehicle(player)){
                
carid GetPlayerVehicleID(player);
                
seat GetPlayerVehicleSeat(player);
                
SetVehiclePos(caridX+1YZ);
                
PutPlayerInVehicle(playercaridseat);
                return 
1;
            }
            
SetPlayerPos(playerX+1YZ);
               return 
1;
        }
        else{
            
SendClientMessage(playeridCOLOR_WHITE"SERVER: You are not authorized to use this command.");
            return 
1;
        }
 } 


When compiling I get one error:
Код:
:\1.Iсigo\GTA\GTA SA\3. SERVER TOOLS\GM\Original\2 con armacol\SERVER.pwn(2324) : error 021: symbol already defined: "strtok"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Line 2324 has nothing t do with the code I'm trying to put in...
Line 2324 and on:
PHP код:
    strtok(const string[], &index)
    {
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
    
index++;
    } 
It's behing public CountDown.

Thanks
Reply
#2

strtok function is included in some of your include. If you want to keep yours, then rename it and use it like that. Otherwise just delete it and the problem should dissapear.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)