Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <natives.h>
- #include <consts.h>
- #include <common.h>
- #include <types.h>
- int ChangeWepType = 1;
- Vehicle foundcar;
- bool found;
- driver;
- lock;
- void GetOffset(float distance, float *x, float *y, float *z){
- Vector3 p;
- GET_PED_BONE_POSITION(GetPlayerPed(), BONE_RIGHT_HAND, distance, distance * 0.042, distance * -0.113, &p);
- *x = p.x;
- *y = p.y;
- *z = p.z;
- }
- void Search(void){
- if(found){
- if(DOES_VEHICLE_EXIST(foundcar)){
- if(IS_CHAR_SHOOTING(GetPlayerPed())){
- if(ChangeWepType==1)
- SET_PETROL_TANK_HEALTH(foundcar,-1);
- if(ChangeWepType==2)
- DELETE_CAR(&foundcar);
- if(ChangeWepType==3)
- APPLY_FORCE_TO_CAR(foundcar,true,0.0,0.0,1000.0,0.0,0.0,0.0,true,true,true,true);
- if(ChangeWepType==4){
- GET_DRIVER_OF_CAR(foundcar,&driver);
- if(DOES_CHAR_EXIST(driver))
- print("Driver's seat is currently occupied");
- else
- WARP_CHAR_INTO_CAR(GetPlayerPed(),foundcar);
- }
- if(ChangeWepType==5){
- GET_CAR_DOOR_LOCK_STATUS(foundcar,&lock);
- if(lock == VEHICLE_DOOR_UNLOCKED){
- LOCK_CAR_DOORS(foundcar,VEHICLE_DOOR_LOCKED_BOTH_SIDES);
- print("Doors locked!");
- }
- else{
- LOCK_CAR_DOORS(foundcar,VEHICLE_DOOR_UNLOCKED);
- print("Doors unlocked!");
- }
- }
- found = false;
- WAIT(500);
- }
- return;
- }
- else found = false;
- }
- else{
- foundcar = INVALID_HANDLE;
- float search, tx, ty, tz;
- for (search = 1;search<100;search++){
- found = false;
- GetOffset(search, &tx, &ty, &tz);
- foundcar = GET_CLOSEST_CAR(tx, ty, tz, 1.5f, 0, 71);
- if (!DOES_VEHICLE_EXIST(foundcar)){
- foundcar = GET_CLOSEST_CAR(tx, ty, tz, 1.5f, 0, 69);
- if (!DOES_VEHICLE_EXIST(foundcar))
- foundcar = GET_CLOSEST_CAR(tx, ty, tz, 1.5f, 0, 70);
- }
- if (DOES_VEHICLE_EXIST(foundcar)){
- found = true;
- break;
- }
- }
- return;
- }
- }
- void Searchinit(void){
- uint Weapon;
- GET_CURRENT_CHAR_WEAPON(GetPlayerPed(), &Weapon);
- if (Weapon != WEAPON_PISTOL) {
- found = false;
- DISABLE_PLAYER_LOCKON(GET_PLAYER_ID(), false);
- return;
- }
- if (IS_CHAR_IN_ANY_CAR(GetPlayerPed())){
- found = false;
- return;
- }
- DISABLE_PLAYER_LOCKON(GET_PLAYER_ID(), true);
- if(IS_BUTTON_JUST_PRESSED(0,BUTTON_LB)){
- if(ChangeWepType == 5) ChangeWepType = 1;
- else ChangeWepType++;
- if(ChangeWepType == 1) print("Destroy Vehicle");
- if(ChangeWepType == 2) print("Delete Vehicle");
- if(ChangeWepType == 3) print("Slingshot Vehicle");
- if(ChangeWepType == 4) print("Teleport into Vehicle");
- if(ChangeWepType == 5) print("Lock/Unlock Doors");
- }
- if (IS_BUTTON_PRESSED(0,BUTTON_LT))Search();
- else found = false;
- }
- void main(void){
- THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
- print("Aim at a vehicle and fire to destroy it ~PAD_LT~ + ~PAD_RT~");
- WAIT(2500);
- print("Press ~PAD_LB~ to change fire option");
- WAIT(2500);
- print("Currently only for ped car's; I may edit to work for online player's vehicles");
- WAIT(2500);
- print("Destroy Vehicle");
- WAIT(2500);
- printlong("Created By X ADRENALINE IX");
- if (!HAS_CHAR_GOT_WEAPON(GetPlayerPed(), WEAPON_PISTOL))
- GIVE_WEAPON_TO_CHAR(GetPlayerPed(), WEAPON_PISTOL, AMMO_MAX, 0);
- while(true)
- {
- Searchinit();
- WAIT(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment