dewu Posted January 11, 2014 Share Posted January 11, 2014 Hi guys. I was added new weapon (Crossbow) and now i want to set reload after one shot, is this possible? Weapon ID: 29 (MP5 in GTA). Link to comment
zixxonx Posted January 11, 2014 Share Posted January 11, 2014 onClientPlayerWeaponFire https://wiki.multitheftauto.com/wiki/On ... WeaponFire ReloadPedWeapon https://wiki.multitheftauto.com/wiki/ReloadPedWeapon Link to comment
dewu Posted January 11, 2014 Author Share Posted January 11, 2014 Could you give me whole of script? I am newbie Link to comment
TwiX! Posted January 11, 2014 Share Posted January 11, 2014 Could you give me whole of script?I am newbie Just learn LUA, don't be lazy Link to comment
dewu Posted January 11, 2014 Author Share Posted January 11, 2014 Could you give me whole of script?I am newbie Just learn LUA, don't be lazy Thanks. Link to comment
dewu Posted January 11, 2014 Author Share Posted January 11, 2014 (edited) I write something like that, but's not works, why? function rWep(source) local ammo = onClientPlayerWeaponFire ( source ) local wep = getPedWeapon( source ) if wep == 29 then if ammo then reloadPedWeapon ( source ) end end end end Edited January 11, 2014 by Guest Link to comment
pa3ck Posted January 11, 2014 Share Posted January 11, 2014 Just use setWeaponProperty Link to comment
dewu Posted January 11, 2014 Author Share Posted January 11, 2014 Just use setWeaponProperty I don't understand. How? Link to comment
DiSaMe Posted January 11, 2014 Share Posted January 11, 2014 setWeaponProperty("weapon_name", "weapon_skill_level_to_affect", "property_name", property_value) ... Link to comment
Forrest Posted January 11, 2014 Share Posted January 11, 2014 Are you even trying to learn? All I've seen so far from you since you started posting is you basically asking people to write the scripts for you. Link to comment
dewu Posted January 11, 2014 Author Share Posted January 11, 2014 Are you even trying to learn? All I've seen so far from you since you started posting is you basically asking people to write the scripts for you. Yeah, I've tried and I'm still learing from few days. But not understand how can I use setWeaponProperty to receive the desired effect. I asked for whole of that script, because my scripts don't works. And when I asked what's wrong in that what i wrote, but there where people helps other - you tell me to Learn the LUA If I had no had problems with it, i was never wrote there. Also, i've tried that: addEventHandler('onClientPlayerWeaponFire', localPlayer, function(weapon) if (getPedAmmoInClip == -1 ) then if( weapon == 29 ) then reloadPedWeapon ( weapon ) end end end) and it's too not works. Link to comment
dewu Posted January 12, 2014 Author Share Posted January 12, 2014 Refresh Also i've tried by use setWeaponProperty: function doammo() setWeaponProperty(29, "pro", "maximum_clip_ammo", 1) setWeaponProperty(29, "std", "maximum_clip_ammo", 1) setWeaponProperty(29, "poor", "maximum_clip_ammo", 1) end addEventHandler("onClientResourceStart", getResourceRootElement(), doammo) nothing. Link to comment
dewu Posted January 12, 2014 Author Share Posted January 12, 2014 Problem resolved, thanks for "help". Link to comment
Forrest Posted January 12, 2014 Share Posted January 12, 2014 thanks for "help". Sarcasm will get you no where here, just because we won't write your scripts for you it doesn't mean you have to be an ass. Link to comment
Recommended Posts