Hero192 Posted January 24, 2016 Share Posted January 24, 2016 Hey, How to stop player's weapon from shooting for example only silenced not all weapons for a moment? Link to comment
Castillo Posted January 24, 2016 Share Posted January 24, 2016 Disable the "fire" control with toggleControl. Link to comment
Hero192 Posted January 24, 2016 Author Share Posted January 24, 2016 Disable the "fire" control with toggleControl. But when I do that the player be forced to reload and I won't him to reload and It toggle for all weapons not only silenced Link to comment
Castillo Posted January 24, 2016 Share Posted January 24, 2016 You can disable weapon reloading aswell. Link to comment
Hero192 Posted January 24, 2016 Author Share Posted January 24, 2016 You can disable weapon reloading aswell. How can I do that? I want when I disable the fire, after the end of timer he can shoot again normaly without reloading Link to comment
Castillo Posted January 24, 2016 Share Posted January 24, 2016 Reload is just a resource in your server resources folder, you could edit it and make an exception for your script. Link to comment
Hero192 Posted January 24, 2016 Author Share Posted January 24, 2016 Reload is just a resource in your server resources folder, you could edit it and make an exception for your script. I am really confused , I don't know what I've to edit in this case, can you give me a hand please function forceReload(p) reloadPedWeapon (p) end addCommandHandler("Reload weapon",forceReload) function bindPlayerReloadKey(p) bindKey(p,"r","down","Reload weapon") end function bindReloadForAllPlayers() for k,v in ipairs(getElementsByType("player")) do bindPlayerReloadKey(v) end end addEvent("onPlayerReload",true) addEventHandler("onPlayerReload",getRootElement(), function() reloadPedWeapon (source) end) --client of reload resource: addCommandHandler("Reload weapon", function() triggerServerEvent("onPlayerReload",getLocalPlayer()) end) bindKey("r","down","Reload weapon") Link to comment
Chris!i! Posted January 24, 2016 Share Posted January 24, 2016 You need to to disable the silencer weapon ? only? Link to comment
Hero192 Posted January 24, 2016 Author Share Posted January 24, 2016 You need to to disable the silencer weapon ? only? Yeah ! Link to comment
Chris!i! Posted January 24, 2016 Share Posted January 24, 2016 local thePlayer = getLocalPlayer() function checkSilenced ( ) local weapon = getPedWeapon ( thePlayer ) if weapon == 23 then toggleControl ( "fire", false ) toggleControl ( "aim_weapon", false ) end end addEventHandler ( "onClientResourceStart", getRootElement(), checkSilenced ) Link to comment
Hero192 Posted January 24, 2016 Author Share Posted January 24, 2016 Yes, but I already explained to solidsnake that this function "toggleControl" "fire", force the player to reload after the end of the timer. and he recommend me to edit this reload resource which it in my server, If you know how please help me function forceReload(player) reloadPedWeapon (player) end addCommandHandler("Reload weapon",forceReload) function bindPlayerReloadKey(player) bindKey(player,"r","down","Reload weapon") end function bindReloadForAllPlayers() for index, player in ipairs(getElementsByType("player")) do bindPlayerReloadKey(player) end end addEvent("onPlayerReload",true) addEventHandler("onPlayerReload",getRootElement(), function() reloadPedWeapon (source) end) Link to comment
Chris!i! Posted January 24, 2016 Share Posted January 24, 2016 Im sorry i didnt understand what u mean .. Link to comment
Hero192 Posted January 24, 2016 Author Share Posted January 24, 2016 Im sorry i didnt understand what u mean .. Listen, I agree with using toggelControl function but when I use it, I set a Timer to the shooter and When the timer ends the player can't shoot again normaly, He need to "RELOAD" the weapon by pressing "R" key to shoot. And it's kinda annoying I want it to shoot after the timer ends without any reload.. Link to comment
Hero192 Posted January 24, 2016 Author Share Posted January 24, 2016 Anyone please!? I need it urgence Link to comment
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