SA-MP Forums Archive
[help] Car system - 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: [help] Car system (/showthread.php?tid=584230)



[help] Car system - Karolukas123 - 03.08.2015

warning 209: function "CarCheck" should return a value

}
forward CarCheck();
public CarCheck()
{
for(new v; v < MAX_VEHICLES; v++)
{
if(GetVehicleDistanceFromPoint(v, -1520.5173,2659.1863,56.2042) < 2)
{
SetVehiclePos(v,-1520.5173,2659.1863,56.204);
{
if(GetVehicleDistanceFromPoint(v, -1520.7703,2654.2078,55.7311) < 2)
{
SetVehiclePos(v, -1520.7703,2654.2078,55.7311);
}
}
return 1;
}
}


Re: [help] Car system - MarvinPWN - 03.08.2015

PHP код:
public CarCheck()
{
    for(new 
v;v<MAX_VEHICLES;v++)
    {
        if(
GetVehicleDistanceFromPoint(v,-1520.5173,2659.1863,56.2042) < 2)
        {
            
SetVehiclePos(v,-1520.5173,2659.1863,56.204);
            break;
        }
        else if(
GetVehicleDistanceFromPoint(v,-1520.7703,2654.2078,55.7311) < 2)
        {
            
SetVehiclePos(v, -1520.7703,2654.2078,55.7311);
            break;
        }
    }
    return 
1;