14.03.2012, 10:12
Hi Reklez,
That function will indeed delete every vehicle in the server if it's un-occupied. If you want to avoid it deleting certain vehicles you will need to make a function that will tell the script that vehicle x should not be deleted. For instance:
I hope that made sense..
Cheers,
TJ
That function will indeed delete every vehicle in the server if it's un-occupied. If you want to avoid it deleting certain vehicles you will need to make a function that will tell the script that vehicle x should not be deleted. For instance:
pawn Код:
//Top Of Script
new do_not_delete[MAX_VEHICLES];
public OnGameModeInit()
{
do_not_delete[0] = CreateVehicle...
}
public DeleteVehicles()
{
for(new veh = 0; veh < MAX_VEHICLES; veh++)
{
if(!VehicleOccupied(veh) && CanDeleteVehicle(veh))
{
DestroyVehicle(veh);
}
}
return 1;
}
public CanDeleteVehicle(vehicleid)
{
for(new i = 0; i < sizeof(do_not_delete); i ++)
{
if(vehicleid == do_not_delete[i]) return false;
}
return true;
}
Cheers,
TJ