#1

PHP код:
vehOnVehicleSpawn(vehicleid) {
    
vehOnLoadPaintJob(vehicleid);
    
VehicleInfo[vehicleid][EVFlags] &= ~EVehicleFlags_WindowsDown;
    
VehicleInfo[vehicleid][EVFlags] &= ~EVehicleFlags_Totaled;
    if(
VehicleInfo[vehicleid][EVType] == EVehicleType_Owned && VehicleInfo[vehicleid][EVToDelete] == 1) {
        if(
playerHasCarInsurance(VehicleInfo[vehicleid][EVOwner]) && IsACar(GetVehicleModel(vehicleid))) {
            
putVehicleInImpound(vehicleid,0);
            
SendClientMessage(VehicleInfo[vehicleid][EVOwner], X11_LIGHTBLUE"Your vehicle has been destroyed, you must reclaim it at the Insurance Company");    
        } else {
            
DestroyOwnedVehicle(vehicleid);
            
SendClientMessage(VehicleInfo[vehicleid][EVOwner], X11_LIGHTBLUE"Your vehicle has been destroyed.");    
        } 
I want to add heli to the insurance aswell.. I tried adding && IsAHelicopter(GetVehicleModel(vehicleid) but that didn't work and gave me a fatal error like.. pawno has stopped working.

So I want to use
PHP код:
IsAHelicopter 
so the heli go to the insurance aswell.
Reply
#2

From what I understand, I think you're after a function which checks whether a vehicle is a helicopter. In order to use the function "IsAHelicopter", you'll have to ensure there is an actual function with that name such as:

Код:
new bool:MyVariable;

IsAHelicopter(vehicleid)
{
     new vehicle = GetVehicleModel(vehicleid);
     if(vehicle == 417 || vehicle == 425 || vehicle == 447 || vehicle == 469 || vehicle == 487 || vehicle == 488 || vehicle == 497 || vehicle == 548 || vehicle == 563)
     {
          // The vehicle IDs above in the 'if statement' are all the helicopter models in GTA SA, do not remove them.
          MyVariable = true;
     } else {
          MyVariable = false;
     }
     return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)