SA-MP Forums Archive
Why i get this warning? - 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: Why i get this warning? (/showthread.php?tid=293491)



Why i get this warning? - Tass007 - 28.10.2011

Hello i've scripted a little bit of a gamemode and i keep getting this warning
pawn Код:
warning 203: symbol is never used: "playerid"
And here is the line that is giving out the warning.
pawn Код:
stock GetClosestVehicle(playerid)
{
    new Float:x, Float:y, Float:z;
    new Float:dist, Float:closedist=9999, closeveh;
    for(new i=1; i < MAX_VEHICLES; i++)
    {
        if(GetVehiclePos(i, x, y, z))
        {
            dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
            if(dist < closedist)
            {
                closedist = dist;
                closeveh = i;
            }
        }
    }
    return closeveh;
}
Can anybody help me i will give you rep! if you sussesfully help me!


Re: Why i get this warning? - sanplayer - 28.10.2011

Can you post the script in code tags please.

I might be able to help


Re: Why i get this warning? - wumpyc - 28.10.2011

change
PHP код:
stock GetClosestVehicle(playerid
to
PHP код:
stock GetClosestVehicle() 



Re: Why i get this warning? - Tass007 - 28.10.2011

Yes i'm sorry i hit "Enter" when i was in the middle of creating the thread!


Re: Why i get this warning? - Kingunit - 28.10.2011

Exactly what said above. Remove the 'playerid'.


Re: Why i get this warning? - Tass007 - 28.10.2011

pawn Код:
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
 error 017: undefined symbol "playerid"
This is what it gives me when i delete the playerid


Re: Why i get this warning? - admantis - 28.10.2011

pawn Код:
stock GetClosestVehicle(playerid)
{
    #pragma unused playerid
    new Float:x, Float:y, Float:z;
    new Float:dist, Float:closedist=9999, closeveh;
    for(new i=1; i < MAX_VEHICLES; i++)
    {
        if(GetVehiclePos(i, x, y, z))
        {
            dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
            if(dist < closedist)
            {
                closedist = dist;
                closeveh = i;
            }
        }
    }
    return closeveh;
}
removing 'playerid' might make it all obsolete, it doesn't make sence. Get the closest vehicle, from who?


Re: Why i get this warning? - Tass007 - 28.10.2011

Thank you very much admantis rep!!