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", cmd, true) == 0)
{
if(IsPlayerAdmin(playerid)) {
new temp[256], player, Float:X, Float:Y, Float:Z, carid, seat;
player = strval(temp);
GetPlayerPos(player, X, Y, Z);
if(IsPlayerInAnyVehicle(playerid)){
carid = GetPlayerVehicleID(playerid);
seat = GetPlayerVehicleSeat(playerid);
SetVehiclePos(carid, X+1, Y, Z);
PutPlayerInVehicle(playerid, carid, seat);
return 1;
}
SetPlayerPos(playerid, X+1, Y, Z);
return 1;
}
else{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are not authorized to use this command.");
return 1;
}
}
if(strcmp("/get", cmd, true) == 0)
{
if(IsPlayerAdmin(playerid)) {
new temp[256], player, Float:X, Float:Y, Float:Z, carid, seat;
player = strval(temp);
GetPlayerPos(playerid, X, Y, Z);
if(IsPlayerInAnyVehicle(player)){
carid = GetPlayerVehicleID(player);
seat = GetPlayerVehicleSeat(player);
SetVehiclePos(carid, X+1, Y, Z);
PutPlayerInVehicle(player, carid, seat);
return 1;
}
SetPlayerPos(player, X+1, Y, Z);
return 1;
}
else{
SendClientMessage(playerid, COLOR_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.