Jump to content

getPedControlState


kasya85

Recommended Posts

       Help, please.  getPedControlState is not working 

getPedControlState(localPlayer, "radar_move_south") 
getPedControlState(localPlayer, "radar_move_north")
getPedControlState(localPlayer, "radar_move_west") 
getPedControlState(localPlayer, "radar_move_east")

code: 

 

function drawMap()
        if  getPedControlState(localPlayer, "radar_move_north") then 
			--action
        elseif getPedControlState(localPlayer, "radar_move_south") then 
			--action
        elseif  getPedControlState(localPlayer, "radar_move_west") then 
			--action
        elseif  getPedControlState(localPlayer, "radar_move_east") then 
			--action
        end
    end
end
addEventHandler("onClientRender",getRootElement(),drawMap)		

 

Link to comment

MTA hard-coded commands

The following are names of hard-coded MTA commands which do not use bindKey, but can act as bindKey by using them in an addCommandHandler. Other than that, this control list will only work with the functions toggleControl and toggleAllControls. Please note that toggleControl can't disable screenshot.

 

Probably you can't use "radar_move_x" with getPedControlState since they're MTA hard-coded commands.

Link to comment
28 minutes ago, pa3ck said:

MTA hard-coded commands

The following are names of hard-coded MTA commands which do not use bindKey, but can act as bindKey by using them in an addCommandHandler. Other than that, this control list will only work with the functions toggleControl and toggleAllControls. Please note that toggleControl can't disable screenshot.

 

Probably you can't use "radar_move_x" with getPedControlState since they're MTA hard-coded commands.

I need an example

Link to comment
20 minutes ago, xMKHx said:

You can find all MTA Contro Names here

https://wiki.multitheftauto.com/wiki/Control_names

No offence, but you are just copy-pasting links and stuff, did you actually check that link yourself? 

47 minutes ago, kasya85 said:

I need an example

In my post I referenced MTA wiki, but I'll quote it again,  this control list will only work with the functions toggleControl and toggleAllControls

So I guess you can't use it with getPedControlState. The code you posted should work with every other controls, but not these ones. So whatever you tried to achieve, you'll need to find a different solution or if you tell us your goal, we might be able to help you.

  • Like 1
Link to comment

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