Jump to content

Vehicle blow


Xwad

Recommended Posts

Posted

Hi i want to make a script that makes possible that the vehicle will only blow if it has 0 % hp. Becaouse the vehicles blows if the hp is under 250%. What functions need i use for that?

Posted

You can't. You can only "fake" value.

local healthValue = (getElementHealth(vehicle)-250)/750*100 

This will get vehicle's health 0-100.

Posted

ohh ok thanks.And one more question. How can i make that if i shoot with the rhino something (fir example an object) then the bullet will not blow? (i want to disable the rhinos bullet explosion if its hit something)

  • Moderators
Posted

You can cancel the bullet explosion like this:

addEventHandler("onClientExplosion",root, 
function (x,y,z,explosionType) 
    if source == localPlayer and explosionType == 10 then 
        local vehicle = getPedOccupiedVehicle(localPlayer) 
        if vehicle and getElementMode(vehicle) == 432 then 
            cancelEvent() 
        end 
    end 
end)     

But how you want to check if it hits an object is up to you.

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...