29.12.2012, 17:04
Ok I have a small problem with my script. When i drive and hit stuff with vehicles the auto fix works pefectly but when my vehicle (car) is upside down and starts bunring it doesn't fix it so i blow up. If there is a way to do this i will be grateful.
HERE IS THE SCRIPT:
Oh and this script also contains scripts for vehicles to FLIP and have NITRO
One more thing if you like to have this script and get more details for it go here:
https://sampforum.blast.hk/showthread.php?tid=373147
OR click [FilterScript] AutoFix/Flip/InfinityNos at the bottom.
========>THANKS IN ADVANCE<========
HERE IS THE SCRIPT:
pawn Код:
//=====INCLUDES=====//
#include <a_samp>
//===================DEFINES====================//
#define HOLDING(%0) \
((newkeys & (%0)) == (%0))
#define RELEASED(%0) \
(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
//====================FORWARDS=================//
forward Repair(playerid);
//=============================================//
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n-----------------------------------------");
print(" /AutoFix/Flip/InfinityNos/by ThePrograme/ ");
print("-----------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n-----------------------------------------");
print(" /AutoFix/Flip/InfinityNos/by ThePrograme/ ");
print("-----------------------------------------\n");
}
#endif
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
if ( HOLDING( KEY_FIRE ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
{
AddVehicleComponent( GetPlayerVehicleID( playerid ), 1010 );
}
if ( RELEASED( KEY_FIRE ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
{
RemoveVehicleComponent( GetPlayerVehicleID( playerid ), 1010 );
}
if((newkeys&KEY_CROUCH)&&!(oldkeys&KEY_CROUCH))
{
new VehicleID,Float:B;
VehicleID = GetPlayerVehicleID(playerid);
GetVehicleZAngle(VehicleID,B);
SetVehicleZAngle(VehicleID,B);
}
return 1;
}
public OnPlayerConnect(playerid)
{
SetTimerEx("Repair",1000,true,"i",playerid);
return 1;
}
public Repair(playerid)
{
if (IsPlayerInAnyVehicle(playerid))
{
new Float:health;
new vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid, health);
if (health <= 1000)
{
SetVehicleHealth(vehicleid,1000);
}
}
}
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
#pragma unused playerid
RepairVehicle(vehicleid);
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
tires = encode_tires(0, 0, 0, 0);
panels = encode_panels(0, 0, 0, 0, 0, 0, 0);
doors = encode_doors(0, 0, 0, 0, 0, 0);
lights = encode_lights(0, 0, 0, 0);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
return 1;
}
encode_tires(tire1, tire2, tire3, tire4) return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3);
encode_panels(flp, frp, rlp, rrp, windshield, front_bumper, rear_bumper)
{
return flp | (frp << 4) | (rlp << 8) | (rrp << 12) | (windshield << 16) | (front_bumper << 20) | (rear_bumper << 24);
}
encode_doors(bonnet, boot, driver_door, passenger_door, behind_driver_door, behind_passenger_door)
{
#pragma unused behind_driver_door
#pragma unused behind_passenger_door
return bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24);
}
encode_lights(light1, light2, light3, light4)
{
return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}
One more thing if you like to have this script and get more details for it go here:
https://sampforum.blast.hk/showthread.php?tid=373147
OR click [FilterScript] AutoFix/Flip/InfinityNos at the bottom.
========>THANKS IN ADVANCE<========