Help - 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 (
/showthread.php?tid=643312)
Help -
Puff - 17.10.2017
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
so the heli go to the insurance aswell.
Re: Help -
McBan - 17.10.2017
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;
}