Jump to content

toggleControl - fire


tosfera

Recommended Posts

Posted

Hey,

So I'm having a little problem, I'm disabling the 'fire' control in some circumstances but whenever you aim ( right click ) and press tab, it'll still shoot. Even though the shoot control is disabled. Is this a bug, did anyone else also encounter this problem?

Love to hear from you guys,

- Tosfera

Posted
Could you post your script to we can help you thank you.

Kidding, right? Why should I post my script is it's always happening? Whenever you disable the fire using;

toggleControl ( thePlayer, 'fire', false ); 

you'll still be able to shoot while holding your RMB and pressing TAB.

I think you can disable "action"

Let me try and find that. :)

  • 5 years later...
Posted (edited)
18 minutes ago, xFabel said:

this topic is too old I think it closes better

 

I hope it's closed but still dont work this toggleControl 'fire' how can I block mouse1 button?

Edited by C4N
  • 1 year later...
Posted

Cara eu fiz uma simples função e não consigo desativar o jogador de atirar, o jogador fica bloqueado com todos os outros comandos menos o de atirar, alguem sabe se isso é um erro do mta?

function tiro(thePlayer)
toggleControl(thePlayer, "fire", false)
toggleControl(thePlayer, "action", false)
toggleControl(thePlayer, "jump", false)
outputChatBox("a", thePlayer)
end
addCommandHandler("teste", tiro)

function tiro2(thePlayer)
toggleControl(thePlayer, "fire", true)
toggleControl(thePlayer, "action", true)
toggleControl(thePlayer, "jump", true)
outputChatBox("b", thePlayer)
end
addCommandHandler("testee", tiro2)

 

Posted
On 10/09/2021 at 15:26, KiritoAguiar said:

Cara eu fiz uma simples função e não consigo desativar o jogador de atirar, o jogador fica bloqueado com todos os outros comandos menos o de atirar, alguem sabe se isso é um erro do mta?

Verify that your script is assigned to run server-side by looking into your meta.xml file.

<script src="script.lua" type="server" />

This is important because you are using the serverside versions of functions.

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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