joedajoester Posted November 23, 2011 Posted November 23, 2011 Hi all, i recently got mta 1.2 and it has new features like healing gun, look at this video its cool right? I need to know how to do this lol is this only for mta 1.2 not 1.1 ? please help me someone
0 12p Posted November 23, 2011 Posted November 23, 2011 It's easy. onClientPlayerWeaponFire getPedWeapon setElementHealth
0 Castillo Posted November 23, 2011 Posted November 23, 2011 This doesn't require MTA 1.2 if I'm right.
0 joedajoester Posted November 23, 2011 Author Posted November 23, 2011 What would the script be? I dont know how to do this sorry can you help?
0 Castillo Posted November 23, 2011 Posted November 23, 2011 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 ) Should work. P.S: Is client side. P.S2: You'll have to find a way to cancel the damage done, else it'll heal but also damage it .
0 joedajoester Posted November 23, 2011 Author Posted November 23, 2011 Thank you so much ill test it tomorrow i gotta get to bed thanks again
0 JR10 Posted November 23, 2011 Posted November 23, 2011 P.S2: You'll have to find a way to cancel the damage done, else it'll heal but also damage it . cancelEvent? Like 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 cancelEvent() 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 )
0 Castillo Posted November 23, 2011 Posted November 23, 2011 JR10, I think you can't cancel this event.
0 12p Posted November 23, 2011 Posted November 23, 2011 SolidSnake is right. In GMES I had to use toggleControl to prevent weapon firing on latest version. So the only way to do this is toggleControl plus onClientKey.
0 joedajoester Posted November 23, 2011 Author Posted November 23, 2011 How about this? srun setPedStat(getRandomPlayer(), 70, 500) crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "accuracy",2000) crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "damage",1000) crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "flags",0x000020) crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "flags",0x000800) crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "anim_group",13) crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "flags",0x000002)
0 Castillo Posted November 23, 2011 Posted November 23, 2011 The function: setPedWeaponInfo does not exists, maybe you meant: setWeaponProperty But, is server side only.
0 Spanish4Life Posted November 26, 2011 Posted November 26, 2011 No pal http://code.google.com/p/mtasa-blue/sou ... ail?r=3169 It's an old commit tho
0 Castillo Posted November 26, 2011 Posted November 26, 2011 Yes, I know about setPedWeaponInfo, I used it on a nightly of MTA 1.2, but they removed it, setWeaponProperty is the same function as far as I know.
0 Spanish4Life Posted November 27, 2011 Posted November 27, 2011 Yes, I know about setPedWeaponInfo, I used it on a nightly of MTA 1.2, but they removed it, setWeaponProperty is the same function as far as I know. Huh ok. Reasons? I've tested it and it work.
Question
joedajoester
Hi all, i recently got mta 1.2 and it has new features like healing gun, look at this video
14 answers to this question
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