Jump to content

Set reload after 1shot


dewu

Recommended Posts

Posted

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

Posted (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 by Guest
Posted

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.

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

Posted

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.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...