SA-MP Forums Archive
error 017: undefined symbol "NameTimer" - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 017: undefined symbol "NameTimer" (/showthread.php?tid=255114)



error 017: undefined symbol "NameTimer" - Deal-or-die - 14.05.2011

When i compile a GM it gives me this error
pawn Код:
error 017: undefined symbol "NameTimer"
First time compiling the script Its just the sandard GM non edited


Re: error 017: undefined symbol "NameTimer" - Stigg - 14.05.2011

Try:
pawn Код:
new NameTimer;



Re: error 017: undefined symbol "NameTimer" - MadeMan - 14.05.2011

Put this into your script

pawn Код:
public NameTimer()
{
    new Float:p1x, Float:p1y, Float:p1z;
    new Float:p2x, Float:p2y, Float:p2z;
    for(new i = 0;i < MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerPos(i,p1x,p1y,p1z);
            for(new q = 0;q < MAX_PLAYERS;q++)
            {
                if(IsPlayerConnected(q))
                {
                    GetPlayerPos(q,p2x,p2y,p2z);
                    if(GetPointDistanceToPointExMorph(p1x,p1y,p1z,p2x,p2y,p2z) < pdistance)
                    {
                        ShowPlayerNameTagForPlayer(i,q,1);
                    }
                    else
                    {
                        ShowPlayerNameTagForPlayer(i,q,0);
                    }
                }
            }
        }
    }
}



Re: error 017: undefined symbol "NameTimer" - Deal-or-die - 14.05.2011

@Stigg
Then i get
pawn Код:
(24794) : error 012: invalid function call, not a valid address
and on line (24794) is:
pawn Код:
NameTimer();
and the only thing "NameTimer" is used is in:
pawn Код:
public CustomPickups()
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new string[128];
    NameTimer();
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerPos(i, oldposx, oldposy, oldposz);
            new tmpcar = GetPlayerVehicleID(i);
            if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0)
            {
                for(new h = 0; h < sizeof(SBizzInfo); h++)
                {
                    if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
                    {
                        format(string, sizeof(string), "~w~%s~n~~r~Products Required~w~: %d~n~~y~Price per Product: ~w~: $%d~n~~g~Funds: ~w~: $%d",SBizzInfo[h][sbMessage],(SBizzInfo[h][sbMaxProducts]-SBizzInfo[h][sbProducts]),SBizzInfo[h][sbPriceProd],SBizzInfo[h][sbTill]);
                        GameTextForPlayer(i, string, 5000, 3);
                        return 1;
                    }
                    if(PlayerToPoint(2.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
                    {
                        if(SBizzInfo[h][sbOwned] == 1)
                        {
                            format(string, sizeof(string), "~w~%s~w~~n~Owner : %s~n~Extortion by : %s~n~Entrance Fee : ~g~$%d ~w~Level : %d ~n~to enter type /enter",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost],SBizzInfo[h][sbLevelNeeded]);
                        }
                        else
                        {
                            format(string, sizeof(string), "~w~%s~w~~n~This Business is for sale~n~Cost: ~g~$%d ~w~Level : %d ~n~to buy this Business type /buybiz",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]);
                        }
                        GameTextForPlayer(i, string, 5000, 3);
                        return 1;
                    }
                }



Re: error 017: undefined symbol "NameTimer" - Deal-or-die - 14.05.2011

@Mademan
Now i get
pawn Код:
(24803) : error 017: undefined symbol "GetPointDistanceToPointExMorph"



Re: error 017: undefined symbol "NameTimer" - MadeMan - 14.05.2011

Add this too

pawn Код:
Float:GetPointDistanceToPointExMorph(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2)
{
    new Float:x, Float:y, Float:z;
    x = x1-x2;
    y = y1-y2;
    z = z1-z2;
    return floatsqroot(x*x+y*y+z*z);
}



Re: error 017: undefined symbol "NameTimer" - Deal-or-die - 14.05.2011

Where do i add that? Just with the other but you gave me or just any where random.


Re: error 017: undefined symbol "NameTimer" - Biesmen - 14.05.2011

Somewhere outside callbacks


Re: error 017: undefined symbol "NameTimer" - Seven_of_Nine - 14.05.2011

Dear Deal-or-Die,

undefined symbol error means you don't have that function / variable / define.

If you don't have one, search first.


Re: error 017: undefined symbol "NameTimer" - Steven82 - 14.05.2011

This is, why we don't use gf edits right?