Jump to content

[Help] bike glitch to solve


BieHDC

Recommended Posts

Hello,

i admin a dd server and there are some maps with random vehicle markers.

the problem is that a bike cant be killed by minigun of RC Baron, Ruster... and that i wanna fix.

i thought about a check if bike has less than 5 live and then to kill player, but i dont know what things to use.

Can you please tell me what functions i should use?

then i will try to script and if i fail i will post my script here.

and i think its not only a problem on my server, so i am going to upload this to community.

Thx

Link to comment
Hello,

i admin a dd server and there are some maps with random vehicle markers.

the problem is that a bike cant be killed by minigun of RC Baron, Ruster... and that i wanna fix.

i thought about a check if bike has less than 5 live and then to kill player, but i dont know what things to use.

Can you please tell me what functions i should use?

then i will try to script and if i fail i will post my script here.

and i think its not only a problem on my server, so i am going to upload this to community.

Thx

If you want to report a bug/giltch in MTA then this is the wrong section.

Link to comment

try this. (Car's start burning around ~200HP , so i put 200 but you can make test's with bike's)

It's server side

function KillVehicleOwner() 
  
   if  getElementHealth(source) <= 200 and  getVehicleType(source) == "BMX" then 
  
local thePlayer = getVehicleOccupant(source) 
    killPed(thePlayer) 
    end 
end 
  
addEventHandler("onVehicleDamage", getRootElement(), KillVehicleOwner) 

Link to comment

@Bandi94: I don't think that will work, since bikes don't actually take any damage when shot on. Thus, your script won't be triggered.

@BieHDC: Did you try the code Bandi gave you, and did it work? I believe BMX is a vehicle type which includes all bikes except motorbikes. Might be wrong though... D:

Link to comment
Yes "Dealman" BMX includes all bkies except motorbikes.

Well i don't played to much with bike's , but if i remember well it have HP , only when it reach 0 it doesent make anything

The bikes do have health like any vehicle, yes. But if I recall correctly they don't take any damage from weapons or collisions. Which might make it hard to accomplish what this guy wants. :|

Link to comment

Like Apache Server would say: It Works!

;D

function KillVehicleOwner() 
      
   if  getElementHealth(source) <= 300 and  getVehicleType(source) == "BMX" then 
      
local thePlayer = getVehicleOccupant(source) 
    killPed(thePlayer) 
    end 
end 
      
addEventHandler("onVehicleDamage", getRootElement(), KillVehicleOwner) 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...