IsVehicleSpawned
#1

Is it possible to make a function to check if a vehicle is spawned or not?

I'm trying to create a fuel script and I want to set the spawned vehicles fuel to 100% ongamemodeinit,

I have

pawn Код:
public OnGameModeInit()
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        print("Vehicle %d fuel set to 100%%");
        VehicleFuel[i] = 100;
    }
    return 1;
}
Is it possible?

Thanks!

I want


pawn Код:
public OnGameModeInit()
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        if(IsVehicleSpawned(i))
        {
            print("All fuel set to 100%%");
            VehicleFuel[i] = 100;
        }
    }
    return 1;
}
Reply
#2

none of them will be spawned untill someone connects!
not needed just use the first way.

regards.
Reply
#3

I do not believe there is an already existent function for such, although you could probably easily make one if you know what you are doing.
Reply
#4

pawn Код:
stock DoesVehicleExist(vehicleid)
{
    if(GetVehicleModel(vehicleid) > 0) return 1;
    else return 0;
}
That should work fine.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)