"undefined symbol" after I add something new.
#1

Before I add this strip of code, the script works perfectly. But after I add it, it breaks all the "giveplayerid"s.
Why?

pawn Code:
CMD:skipmytut(playerid, params[])
{
    if(IsPlayerConnected(giveplayerid))
    {
        for(new t = 0; t < 54; t++)
        {
            TextDrawHideForPlayer(giveplayerid, TutTxtDraw[t]);
        }

        SetPlayerInterior(giveplayerid, 0);
        SetPlayerVirtualWorld(giveplayerid, 0);
        TogglePlayerControllable(giveplayerid, 1);
        SetPlayerPos(giveplayerid, 1773.459350, -1942.273437, 13.569922);
        SetPlayerFacingAngle(giveplayerid, 329.64);
        SetCameraBehindPlayer(giveplayerid);

        InsideTut[giveplayerid] = 0;
        DeletePVar(giveplayerid, "MedicBill");
        SetPlayerColor(giveplayerid,TEAM_HIT_COLOR);
        PlayerInfo[giveplayerid][pTut] = 1;

        PlayerInfo[giveplayerid][pSkin] = 299;
        SetPlayerSkin(giveplayerid, 299);

        ClearChatbox(giveplayerid);
        new string[128];
        format(string, sizeof(string), "Welcome to Horizon Roleplay, %s.", GetPlayerNameEx(giveplayerid));
        SendClientMessage(giveplayerid, COLOR_NEWS, string);

        format(string, sizeof(string), "~w~Welcome~n~~y~%s", GetPlayerNameEx(giveplayerid));
        GameTextForPlayer(giveplayerid, string, 5000, 1);

        SendClientMessage(giveplayerid, COLOR_YELLOW, "If you have any further questions, please use /newb. You can also /report if you see any rule-breakers.");

        new motdstring[128];
        format(motdstring, sizeof(motdstring), "News: %s", GlobalMOTD);
        SendClientMessage(giveplayerid, COLOR_WHITE, motdstring);
       
        DeletePVar(giveplayerid, "IsFrozen");

        TutorialProgress[giveplayerid] = 0;
    }
    return 1;
}
Code:
RP.pwn(10816) : error 017: undefined symbol "giveplayerid"
RP.pwn(10820) : error 017: undefined symbol "giveplayerid"
RP.pwn(10823) : error 017: undefined symbol "giveplayerid"
RP.pwn(10824) : error 017: undefined symbol "giveplayerid"
RP.pwn(10825) : error 017: undefined symbol "giveplayerid"
RP.pwn(10826) : error 017: undefined symbol "giveplayerid"
RP.pwn(10827) : error 017: undefined symbol "giveplayerid"
RP.pwn(10828) : error 017: undefined symbol "giveplayerid"
RP.pwn(10830) : error 017: undefined symbol "giveplayerid"
RP.pwn(10831) : error 017: undefined symbol "giveplayerid"
RP.pwn(10832) : error 017: undefined symbol "giveplayerid"
RP.pwn(10833) : error 017: undefined symbol "giveplayerid"
RP.pwn(10835) : error 017: undefined symbol "giveplayerid"
RP.pwn(10836) : error 017: undefined symbol "giveplayerid"
RP.pwn(10838) : error 017: undefined symbol "giveplayerid"
RP.pwn(10840) : error 017: undefined symbol "giveplayerid"
RP.pwn(10841) : error 017: undefined symbol "giveplayerid"
RP.pwn(10843) : error 017: undefined symbol "giveplayerid"
RP.pwn(10844) : error 017: undefined symbol "giveplayerid"
RP.pwn(10846) : error 017: undefined symbol "giveplayerid"
RP.pwn(10850) : error 017: undefined symbol "giveplayerid"
RP.pwn(10852) : error 017: undefined symbol "giveplayerid"
RP.pwn(10854) : error 017: undefined symbol "giveplayerid"
Reply
#2

pawn Code:
new giveplayerid;
is missing.
Of course will give an error.
Reply
#3

Quote:
Originally Posted by Dragonsaurus
View Post
pawn Code:
new giveplayerid;
is missing.
Of course will give an error.
LOL derp can't believe I missed that.
Thanks!
Reply
#4

where is new giveplayerid; ?


EDIT: sorry i haven't seen post at up
Reply
#5

Quote:
Originally Posted by Dragonsaurus
View Post
pawn Code:
new giveplayerid;
is missing.
Of course will give an error.
And the command will be executed for ID 0 only.

No, if the player who types the command is the one who will be set at those coordinates etc then use playerid instead. If it's about someone else, then use sscanf to store that id to giveplayerid. But I guess it's the first one.
Reply
#6

@Up: Yeah... I really thought it was about another player. It has to be for playerid though. Thanks for the correction!
Reply
#7

....
Reply
#8

Quote:
Originally Posted by Emmet_
View Post
Considering that you use sscanf..

pawn Code:
CMD:skipmytut(playerid, params[])
{
    new giveplayerid;
    if (sscanf(params, "u", giveplayerid))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /skipmytut [playerid/PartOfName]");
        return 1;
    }
    if(IsPlayerConnected(giveplayerid))
    {
        for(new t = 0; t < 54; t++)
        {
            TextDrawHideForPlayer(giveplayerid, TutTxtDraw[t]);
        }

        SetPlayerInterior(giveplayerid, 0);
        SetPlayerVirtualWorld(giveplayerid, 0);
        TogglePlayerControllable(giveplayerid, 1);
        SetPlayerPos(giveplayerid, 1773.459350, -1942.273437, 13.569922);
        SetPlayerFacingAngle(giveplayerid, 329.64);
        SetCameraBehindPlayer(giveplayerid);

        InsideTut[giveplayerid] = 0;
        DeletePVar(giveplayerid, "MedicBill");
        SetPlayerColor(giveplayerid,TEAM_HIT_COLOR);
        PlayerInfo[giveplayerid][pTut] = 1;

        PlayerInfo[giveplayerid][pSkin] = 299;
        SetPlayerSkin(giveplayerid, 299);

        ClearChatbox(giveplayerid);
        new string[128];
        format(string, sizeof(string), "Welcome to Horizon Roleplay, %s.", GetPlayerNameEx(giveplayerid));
        SendClientMessage(giveplayerid, COLOR_NEWS, string);

        format(string, sizeof(string), "~w~Welcome~n~~y~%s", GetPlayerNameEx(giveplayerid));
        GameTextForPlayer(giveplayerid, string, 5000, 1);

        SendClientMessage(giveplayerid, COLOR_YELLOW, "If you have any further questions, please use /newb. You can also /report if you see any rule-breakers.");

        new motdstring[128];
        format(motdstring, sizeof(motdstring), "News: %s", GlobalMOTD);
        SendClientMessage(giveplayerid, COLOR_WHITE, motdstring);

        DeletePVar(giveplayerid, "IsFrozen");

        TutorialProgress[giveplayerid] = 0;
    }
    return 1;
}
But I don't want players to be able to execute it on other players, only on themselves.
Reply
#9

pawn Code:
CMD:skipmytut(playerid, params[])
{
    for(new t = 0; t < 54; t++)
    {
        TextDrawHideForPlayer(playerid, TutTxtDraw[t]);
    }

    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    TogglePlayerControllable(playerid, 1);
    SetPlayerPos(playerid, 1773.459350, -1942.273437, 13.569922);
    SetPlayerFacingAngle(playerid, 329.64);
    SetCameraBehindPlayer(playerid);

    InsideTut[playerid] = 0;
    DeletePVar(playerid, "MedicBill");
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    PlayerInfo[playerid][pTut] = 1;

    PlayerInfo[playerid][pSkin] = 299;
    SetPlayerSkin(playerid, 299);

    ClearChatbox(playerid);
    new string[128];
    format(string, sizeof(string), "Welcome to Horizon Roleplay, %s.", GetPlayerNameEx(playerid));
    SendClientMessage(playerid, COLOR_NEWS, string);

    format(string, sizeof(string), "~w~Welcome~n~~y~%s", GetPlayerNameEx(playerid));
    GameTextForPlayer(playerid, string, 5000, 1);

    SendClientMessage(playerid, COLOR_YELLOW, "If you have any further questions, please use /newb. You can also /report if you see any rule-breakers.");

    new motdstring[128];
    format(motdstring, sizeof(motdstring), "News: %s", GlobalMOTD);
    SendClientMessage(playerid, COLOR_WHITE, motdstring);

    DeletePVar(playerid, "IsFrozen");

    TutorialProgress[playerid] = 0;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)