Why i get this warning?
#1

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!
Reply
#2

Can you post the script in code tags please.

I might be able to help
Reply
#3

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

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

Exactly what said above. Remove the 'playerid'.
Reply
#6

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
Reply
#7

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?
Reply
#8

Thank you very much admantis rep!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)