Jump to content

Rhino damageable by RPG?


Recommended Posts

hello is it possible to make RHINO damageable by RPG? RPG id is 35 , or it's not possible?

tried this but doesnt work:

client

local weaponsBoom = { 
   ["35"] = true, 
} 
  
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), 
function (weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    if (hitElement) then 
    if getElementType(hitElement) == "vehicle" then 
    if getElementModel(hitElement) == 432 then 
    if weaponBoom(hitElement) then 
    triggerServerEvent("setTheTankHealth",getLocalPlayer(),hitElement) 
    end 
     end 
   end 
end) 

server

addEvent("setTheTankHealth",true) 
addEventHandler("setTheTankHealth",getRootElement(), 
function(tank) 
setElementHealth(tank, getElementHealth(tank) - 1000) 
end 
) 

Link to comment

That event does not trigger for projectiles. The rocket launcher fires a projectile.

What you can do is use the event onClientExplosion instead and then create a col sphere at that location to check if there are any vehicles inside the radius. If there are, and they're of the Rhino model - apply damage depending on how close to the center they are.

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