joedajoester Posted November 24, 2011 Posted November 24, 2011 Hi, for a healing gun its only avainable in mta sa 1.2 so i got mta 1.2 and i tried making the healing gun and nothing. local damage = setWeaponProperty(31, "pro", "damage", -100) I get no error but the gun, m4 still damages and not heals https://wiki.multitheftauto.com/wiki/SetWeaponProperty
Castillo Posted November 24, 2011 Posted November 24, 2011 setWeaponProperty doesn't allow negative values. You can do this though: -- client side: 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 ) -- server side: addEventHandler("onResourceStart",resourceRoot, function () setWeaponProperty(31, "pro", "damage", 0) end) This way it won't damage the vehicle at all, but it should heal it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
joedajoester Posted November 24, 2011 Author Posted November 24, 2011 error get localplayer a nil value
Castillo Posted November 24, 2011 Posted November 24, 2011 I'm pretty sure you put the client side as a server side script (in meta.xml). San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
joedajoester Posted November 24, 2011 Author Posted November 24, 2011 Ok, ill look at it tomorrow i gotta go to bed now. Thanks and i wanna use create swat rope thing, looks awesome
joedajoester Posted November 24, 2011 Author Posted November 24, 2011 It doesnt take away health, and it doesnt give health either. Thats weird lol
Castillo Posted November 24, 2011 Posted November 24, 2011 Well, I damaged a vehicle and then I shoot at it and it "healed" it. How's your meta.xml? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
joedajoester Posted November 24, 2011 Author Posted November 24, 2011 "dfsdssdsdasd" name="heal gun" version="1.0.0" type="script"/>
Castillo Posted November 24, 2011 Posted November 24, 2011 See? you have both as server side... "dfsdssdsdasd" name="heal gun" version="1.0.0" type="script"/> San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
joedajoester Posted November 24, 2011 Author Posted November 24, 2011 I made a new meta and it works now... "dfsdssdsdasd" name="heal gun" version="1.0.0" type="script"/>
joedajoester Posted November 24, 2011 Author Posted November 24, 2011 Thank you, and would it be possible for it to heal physical damage?
Castillo Posted November 24, 2011 Posted November 24, 2011 What do you mean? I don't understand. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
joedajoester Posted November 24, 2011 Author Posted November 24, 2011 If a car crashes and it has physical damage would it be possible for it to repair that? And for players to give them health also. And im on my 1.2 server now if u wanna join and i can show u
Castillo Posted November 24, 2011 Posted November 24, 2011 Doesn't setElementHealth repair that too? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
joedajoester Posted November 24, 2011 Author Posted November 24, 2011 Come on my server please i will show you.
50p Posted November 24, 2011 Posted November 24, 2011 Doesn't setElementHealth repair that too? setElementHealth only gives health. You have to fixVehicle to get the visual damage to get changed. https://wiki.multitheftauto.com/wiki/FixVehicle - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Castillo Posted November 24, 2011 Posted November 24, 2011 Oh, well, I didn't know that . San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now