Jump to content

toggleControl - fire


tosfera

Recommended Posts

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

Link to comment
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. :)

Link to comment
  • 5 years later...
  • 1 year later...

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)

 

Link to comment
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.

Link to comment
  • 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...