SA-MP Forums Archive
Symbol already defined pissing me off - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Symbol already defined pissing me off (/showthread.php?tid=643028)



Symbol already defined pissing me off - insus100 - 11.10.2017

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


Re: Symbol already defined pissing me off - whadez - 11.10.2017

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.