24.04.2014, 00:26
Use IsVehicleOccupied or something to detect if it's occupied or not. Also, your code is very stretched out when it doesn't have to be so confusing, and stretched out because your not using a stock to detect if it's taken.
After a quick ****** search I found this:
Source: https://sampforum.blast.hk/showthread.php?tid=235783
After a quick ****** search I found this:
pawn Код:
stock IsVehicleOccupied(vehicleid) // Returns 1 if there is anyone in the vehicle
{
foreach(Player,i)
{
if(IsPlayerInAnyVehicle(i))
{
if(GetPlayerVehicleID(i)==vehicleid)
{
return 1;
}
else
{
return 0;
}
}
}
}