Posts: 512
Threads: 121
Joined: Sep 2013
Can you please help me make a "if key Pressed" Like when I press the "B" from the keyboard there should be a dialog will show. Is that possible? Because I want to make shortcut so players would not hesitate to type the whole command or something..
Thanks looking forward.
Posts: 512
Threads: 121
Joined: Sep 2013
Thanks for your reply guys. But may I ask to if you can make a simple demo with what I wanted? If key press H then showplayerdialog? So I can review them after. Thanks!
Posts: 512
Threads: 121
Joined: Sep 2013
Quote:
Originally Posted by Konstantinos
pawn Code:
#define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(PRESSED(KEY_CROUCH)) { // ShowPlayerDialog( ... ); } return 1; }
Note that when a player is in vehicle, the key is H/Caps Lock. Although, if a player is on foot, the key is C.
|
tnx. also may I ask if there is any single key that can trigger invehicle at the same time onfoot? If there none. then I will use what you gave.