Posts: 515
Threads: 74
Joined: Feb 2010
Reputation:
0
What would be the keys for alt and tab? I want to make a tabbed system, per say. And the only way to make this, to my knowledge is detecting both keys being pressed together, so anyone know the keys? Would be much appreciated xD
-Anthony
Posts: 515
Threads: 74
Joined: Feb 2010
Reputation:
0
If im correct alt is KEY_SECONDARY_ATTACK but i dont know what tab is :S
Posts: 52
Threads: 3
Joined: Oct 2006
Reputation:
0
The value depens on the player's setting.
There is no value for ALT or TAB key, cause a player can have set any key to an action in GTA (like crouching)
If a player presses a key, the value of the action is posted to the Callback, not the key's value.
Most of players have ALT for slow walking, but some may use other keys.
Posts: 1,363
Threads: 14
Joined: Apr 2009
Reputation:
0
when a player is paused OnPlayerUpdate isn't called hint hint.
Posts: 52
Threads: 3
Joined: Oct 2006
Reputation:
0
cessil, I don't know what your "hint" is doing here.
And Fj0rtizFredde, this is just the default value, please note that.
Posts: 1,363
Threads: 14
Joined: Apr 2009
Reputation:
0
well OnPlayerUpdate is called ~40 times a second, if the player is alt+tabbed then it doesn't get called so if you had code under OnPlayerUpdate to set a variable to 30, and have a timer to decrease it every second, by the time it equals 0 30 seconds would have past.
Posts: 52
Threads: 3
Joined: Oct 2006
Reputation:
0
OnPlayerKeyStateChange!
Who mad this stupid example in wiki, this is ridiculous.
Anyway, if you want to check if a player is alt tabbing:
Forget it, it's impossible to make a good working solution with sa-mp.
Posts: 515
Threads: 74
Joined: Feb 2010
Reputation:
0
I have seen several servers with a perfect working alt tab check, for example underground roleplay. As soon as someone alt tabs, their name turns red and a 3dlabel goes on top of them saying alt tabbed
Posts: 1,363
Threads: 14
Joined: Apr 2009
Reputation:
0
well if you actually read my post you'd understand how to make one
Posts: 515
Threads: 74
Joined: Feb 2010
Reputation:
0
Tbh, you lost me in your post. What i planning is to use OnPlayerKeyStateChange.
Posts: 52
Threads: 3
Joined: Oct 2006
Reputation:
0
What if somebody hasn't assigned alt? (He can ALT TAB and you won't see it)
What if somebody has asigned another key to slow walking? (He will be shown as ALT Tabber, although hes isn't)
IT IS NOT WORKING!
If you want to make an AFK detection, you can do it with OnPlayerUpdate, but not with checking keys.
Edit: Don't use pVars!