Jump to content

Will it work ?


EvoGT

Recommended Posts

Posted

I found something interesting in resources.

https://community.multitheftauto.com/ind ... ls&id=1259

This makes all cars undestroyable

And when i use this

https://community.multitheftauto.com/ind ... ls&id=5711

i cant destroy cars.

its good

And i found this :

    function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
        if (weapon == 31 and hitElement and getElementType(hitElement)=="vehicle") then -- If the weapon is a M4 and the element hit is a vehicle 
              if getElementHealth(hitElement) >= 1000 then return end -- If the vehicle health is 1000%, don't heal it. 
              setElementHealth(hitElement, getElementHealth(hitElement)+100) -- Set the vehicle health +100%. 
        end 
    end 
    addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) 

    addEventHandler("onResourceStart",resourceRoot, 
    function () 
        setWeaponProperty(31, "pro", "damage", 0) 
    end) 

its a heal gun

it is possible to make it unheal gun ?

Like if i shot 1 time. it minuses 1 HP from vehicle Health

Smt like this : I shot with gun in car 3 times. And car has 997 HP.

It would be great way.

And this: if getElementHealth(hitElement) >= 1000

it will work if car has 1000 HP ? is it possible to make it work on "random" hp, like 997 , 567

Please help .

Posted

Client

addEventHandler("onClientPlayerWeaponFire", root, 
    function (weapon, hitElement) 
        if (weapon == 31) and (getElementType(hitElement) == "vehicle") then 
            local health = getElementHealth(hitElement) 
            setElementHealth(hitElement, health + 100) 
        end 
    end 
) 

This will raise the HP of the vehicle that got hit by 100HP (If the weapon ID = 31), You can Change it if you like ...

**Not Tested ..!

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted

Second argument of: "onClientPlayerWeaponFire" isn't the hitElement.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Client
addEventHandler("onClientPlayerWeaponFire", root, 
    function (weapon, hitElement) 
        if (weapon == 31) and (getElementType(hitElement) == "vehicle") then 
            local health = getElementHealth(hitElement) 
            setElementHealth(hitElement, health + 100) 
        end 
    end 
) 

This will raise the HP of the vehicle that got hit by 100HP (If the weapon ID = 31), You can Change it if you like ...

**Not Tested ..!

Will it give heath for car ?

I need to make that when i shot to car with that gun, it makes car HP lower.

I tryed this script now, dont work : ( and tryed with - 100

Posted
Client
addEventHandler("onClientPlayerWeaponFire", root, 
    function (weapon, hitElement) 
        if (weapon == 31) and (getElementType(hitElement) == "vehicle") then 
            local health = getElementHealth(hitElement) 
            setElementHealth(hitElement, health + 100) 
        end 
    end 
) 

This will raise the HP of the vehicle that got hit by 100HP (If the weapon ID = 31), You can Change it if you like ...

**Not Tested ..!

Will it give heath for car ?

I need to make that when i shot to car with that gun, it makes car HP lower.

I tryed this script now, dont work : ( and tryed with - 100

It won't work because of what I said, go check the wiki to see the arguments.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
addEventHandler("onClientPlayerWeaponFire", root, 
    function (weapon, _, _, _, _, _, hitElement) 
        if (weapon == 31) and (getElementType(hitElement) == "vehicle") then 
            local health = getElementHealth(hitElement) 
            setElementHealth(hitElement, health - 100) 
        end 
    end 
) 

Try it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I tryed make it myself and what i made:

function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
         if (weapon == 31) and (getElementType(hitElement) == "vehicle") then       -- if i shot to car.... 
         setElementHealth(hitElement, getElementHealth(hitElement)-100) -- makes car hp lower.. i think.. 
    end 
end 
-- And this for every time player shots to car. 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) 

Will it work ?

Posted

if you want to lower every time then it's hard

but i have idea !

replace

setElements

with

BlowVehilce ?

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted
Solid, dont work :/

it doesn't makes car hp lower :/

It works here, you must put it as client side on meta.xml.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Solid, dont work :/

it doesn't makes car hp lower :/

It works here, you must put it as client side on meta.xml.

its Client sided. Maybe i know where the failure.

I need to make it when every time shots the car , to make lower, not once. What should i add ?

Posted
addEventHandler("onClientPlayerWeaponFire", root, 
    function (weapon, _, _, _, _, _, hitElement) 
        if (weapon == 31) and (getElementType(hitElement) == "vehicle") then 
            local health = getElementHealth(hitElement) 
            setElementHealth(hitElement, health - 100) 
        end 
    end 
) 

Try it.

Tryed , dont work ://

Posted

Post your meta.xml.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Should work, I destroyed a vehicle with just a few shoots.

Remember that you must use the M4.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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