Temperamental Script - 26 Unsolveable Errors
#1

Hey,

I've been at this since last night now, my script is being really tempermental, it'll throw 26 errors at me, and sometimes 9 if I change a certain text from SC Locations to SLocations, even though in my script I use SCLocations.

With the correct thing being at SCLocations, I get these errors:
Код:
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3648) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3797) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3821) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3844) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3868) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3998) : error 021: symbol already defined: "GetPlayerPos"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(4001) : error 010: invalid function or declaration
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(11728) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(11876) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(11888) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(12149) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(12164) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(14701) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(14767) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(14858) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16872) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16884) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16897) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16952) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(18618) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(18676) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25277) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25286) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25295) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25304) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25322) : error 017: undefined symbol "SetPlayerPosObf"

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


26 Errors.
But changing it to SLocations and leaving the others at SCLocations gives me these;
Код:
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3648) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3797) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3821) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3844) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3868) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3981) : error 017: undefined symbol "SLocations"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3981) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3981) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3981) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3981) : fatal error 107: too many error messages on one line

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


9 Errors.
The lines I'm playing with are here:
pawn Код:
public StartSMission(playerid)
{
 if(TypeSail[playerid] == 1) // Coastguard
    {
        StartedSMission[playerid] = 1;
        new rand = random(sizeof(SCLocations));
        new string2[65], message[128];
//LINE3981  BELOW
    SetPlayerSailCheckpoint(playerid, SCLocations[rand][LocX],SCLocations[rand][LocY],SLocations[rand][LocZ], 15.0);
        format(string2, sizeof(string2), "%s", SCLocations[rand][LocationName]); //PASSWORD
        strmid(FirstSName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
        //FirstAPName[playerid] = ALocations[rand][LocationName];
        //FirstAPName[playerid] = AndroDName;
        format(message,sizeof(message), "Head to {1B8AE4}%s {FFFFFF}and pick up the cargo goods.", SCLocations[rand][LocationName]);
        SendClientMessage(playerid, COLOR_WHITE, message);
        TypeSail[playerid] = 1;
        MissionSStage[playerid] = 1;
        WantsRecording[playerid] = 1;
        Pos1[playerid] = SCLocations[rand][LocX];
        Pos2[playerid] = SCLocations[rand][LocY];
        Pos3[playerid] = SCLocations[rand][LocZ];
    }
}
    new Float:DistanceCheckS;
    new Float:SP1, Float:SP2, Float:SP3;
    GetPlayerPos(playerid, SP1, SP2, SP3);
    DistanceCheckS = GetDistanceBetweenPoints(SP1, SP2, SP3,Pos1[playerid],Pos2[playerid],Pos3[playerid]);
    DistanceSail1[playerid] = floatround(DistanceCheckS, floatround_round);
    return 1;
}
But when deleting that whole chunk from my script I get the 9 errors above again..

I'm confused because SetPlayerPosObf is defined in my script at the top and I've never had this before, I've checked for missing brackets etc.. but to no avail.

pawn Код:
#define SetPlayerPos SetPlayerPosObf
I'm not sure what lines are going to be needed to check elsewhere in the script as the lines it references to doesn't contain the SetPlayerPosObf, so let me know.

REP to anyone that can help me solve this.
Reply
#2

26 undefined symbol errors usually are caused by an unnecessary bracket }
It closes a function too early, so everything after it is messed up.

In your case the extra bracket is here:

pawn Код:
public StartSMission(playerid)
{
 if(TypeSail[playerid] == 1) // Coastguard
    {
        StartedSMission[playerid] = 1;
        new rand = random(sizeof(SCLocations));
        new string2[65], message[128];
//LINE3981  BELOW
    SetPlayerSailCheckpoint(playerid, SCLocations[rand][LocX],SCLocations[rand][LocY],SLocations[rand][LocZ], 15.0);
        format(string2, sizeof(string2), "%s", SCLocations[rand][LocationName]); //PASSWORD
        strmid(FirstSName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
        //FirstAPName[playerid] = ALocations[rand][LocationName];
        //FirstAPName[playerid] = AndroDName;
        format(message,sizeof(message), "Head to {1B8AE4}%s {FFFFFF}and pick up the cargo goods.", SCLocations[rand][LocationName]);
        SendClientMessage(playerid, COLOR_WHITE, message);
        TypeSail[playerid] = 1;
        MissionSStage[playerid] = 1;
        WantsRecording[playerid] = 1;
        Pos1[playerid] = SCLocations[rand][LocX];
        Pos2[playerid] = SCLocations[rand][LocY];
        Pos3[playerid] = SCLocations[rand][LocZ];
    }
//} // the function is closed here, but theres more code after it
    new Float:DistanceCheckS;
    new Float:SP1, Float:SP2, Float:SP3;
    GetPlayerPos(playerid, SP1, SP2, SP3);
    DistanceCheckS = GetDistanceBetweenPoints(SP1, SP2, SP3,Pos1[playerid],Pos2[playerid],Pos3[playerid]);
    DistanceSail1[playerid] = floatround(DistanceCheckS, floatround_round);
    return 1;
}
If you indent the code correctly you should normally notice bracket problems, as that bracket clearly is on the same level with the function header and so closes it.
Reply
#3

That solved the 26 errors, thank-you, when I change the SLocations to SCLocations I'm getting the 26 errors back again. I'm really at wits end on this.

Код:
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3648) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3797) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3821) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3844) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(3868) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(11727) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(11875) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(11887) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(12148) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(12163) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(14700) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(14766) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(14857) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16871) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16883) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16896) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16951) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(18617) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(18675) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25276) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25285) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25294) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25303) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25321) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25333) : error 017: undefined symbol "SetPlayerPosObf"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(25345) : error 017: undefined symbol "SetPlayerPosObf"

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


26 Errors.
The function that surrounds 3648;
pawn Код:
public RespawnPlayer(playerid)
{
    if(ChosenClass[playerid] == 1) //Pilot
    {
        switch(PInfo[playerid][sSpawn])
        {
            case 0: //Default
            {
                if(gTeam[playerid] == TEAM_CPILOT)
                {
                    DisplayDialogForPlayer(playerid, 3);
                }
                else if(gTeam[playerid] == TEAM_MILITARY)
                {
                    DisplayDialogForPlayer(playerid, 5);
                }
                UpdateSkin(playerid);
                FreezePlayerForTime(playerid, 3);
                SetCameraBehindPlayer(playerid);
                return 1;
            }
            case 1: //House 1
            {
                if(PInfo[playerid][House1] > 0)
                {
                    new HID = PInfo[playerid][House1];
                    PurelySpawned[playerid] = 1;
                    PlayerSpawned[playerid] = 1;
                    SetPlayerHealth(playerid, 100);
                    SetPlayerInterior(playerid, HInfo[HID][hInterior]);
                    SetPlayerVirtualWorld(playerid, HID);
                    SetPlayerPos(playerid, HInfo[HID][hiX],HInfo[HID][hiY],HInfo[HID][hiZ]);
                    UpdateSkin(playerid);
                    UpdatePlayerColour(playerid);
                    InHouse[playerid] = HID;
                    SetCameraBehindPlayer(playerid);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_ERROR, "You do not own a house in this slot! Please update your settings [/settings].");
                    DisplayDialogForPlayer(playerid, 3);
                    return 1;
                }
            }
            case 2: //House 2
            {
                if(PInfo[playerid][House2] > 0)
                {
                    new HID = PInfo[playerid][House2];
                    PurelySpawned[playerid] = 1;
                    PlayerSpawned[playerid] = 1;
                    SetPlayerHealth(playerid, 100);
                    SetPlayerInterior(playerid, HInfo[HID][hInterior]);
                    SetPlayerVirtualWorld(playerid, HID);
                    SetPlayerPos(playerid, HInfo[HID][hiX],HInfo[HID][hiY],HInfo[HID][hiZ]);
                    UpdatePlayerColour(playerid);
                    InHouse[playerid] = HID;
                    UpdateSkin(playerid);
                    SetCameraBehindPlayer(playerid);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_ERROR, "You do not own a house in this slot! Please update your settings [/settings].");
                    DisplayDialogForPlayer(playerid, 3);
                    return 1;
                }
            }
            case 3: // Airline
            {
                if(PInfo[playerid][Airline] > 0)
                {
                    PurelySpawned[playerid] = 1;
                    PlayerSpawned[playerid] = 1;
                    SetPlayerHealth(playerid, 100);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerVirtualWorld(playerid, 0);
                    SetPlayerPos(playerid, AInfo[PInfo[playerid][Airline]][aPos1], AInfo[PInfo[playerid][Airline]][aPos2], AInfo[PInfo[playerid][Airline]][aPos3]);
                    SetPlayerFacingAngle(playerid, AInfo[PInfo[playerid][Airline]][aPos4]);
                    UpdatePlayerColour(playerid);
                    UpdateSkin(playerid);
                    FreezePlayerForTime(playerid, 3);
                    SetCameraBehindPlayer(playerid);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_ERROR, "You are not in an airline! Please update your settings [/settings].");
                    DisplayDialogForPlayer(playerid, 3);
                    return 1;
                }
            }
        }
    }
 if(ChosenClass[playerid] == 2) //Sailor
    {

                if(gTeam[playerid] == TEAM_SAILOR)
                {
                    PurelySpawned[playerid] = 1;
                    PlayerSpawned[playerid] = 1;
                    SetPlayerPos(playerid,  64.2697,-1790.0209,3.1146);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerVirtualWorld(playerid, 0);
                    PlayerSpawned[playerid] = 1;
                    SetCameraBehindPlayer(playerid);
                    SelectedSpawn[playerid] = 1;
                    UpdatePlayerColour(playerid);
                    UpdateSkin(playerid);
                    FreezePlayerForTime(playerid, 3);
                }
    }
    return 1;
}
And the function after lines 11727
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerControllable(playerid, false);
    SetPlayerPos(playerid,1933.6263,-2399.9102,1201.7321);
    SetPlayerCameraPos(playerid, 1931.7674, -2417.5302, 1205.6908);
    SetPlayerCameraLookAt(playerid, 1931.7674, -2417.5202, 1200.6908);
    if(PlayerLogged[playerid] == 0)
    {
        mysql_reconnect();
        new Query[90], EscName[MAX_PLAYER_NAME];
        mysql_real_escape_string(PlayerName(playerid), EscName);
        format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", EscName);
        mysql_query(Query);
        mysql_store_result();
        if(mysql_num_rows() != 0)
        {
            mysql_free_result();
            SendClientMessage(playerid, COLOR_SECURITY, "Please enter your password below to continue.");
            DisplayDialogForPlayer(playerid, 1);
            return 0;
        }
        else
        {
            mysql_free_result();
            SendClientMessage(playerid, COLOR_SECURITY, "Please enter a password below to register an account.");
            DisplayDialogForPlayer(playerid, 2);
            return 0;
        }
    }
    return 1;
}
Its probably going to be the simplest thing, but I've been at it over night now, and not having at luck.
Reply
#4

Hm still looks like theres another missing or additional bracket somewhere, but the parts you posted should be okay.

You could try a missing bracket finder (ex https://sampforum.blast.hk/showthread.php?tid=305047), but i never used it myself, dont know if it works and if it will also detect unnecessary brackets.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)