SA-MP Forums Archive
How do I change interiors by pressing buttons on keyboard? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How do I change interiors by pressing buttons on keyboard? (/showthread.php?tid=659998)



How do I change interiors by pressing buttons on keyboard? - Shamal - 22.10.2018

I have made a command to teleport player to different interiors. Using /int [id] the player can go to the interior to which the [id] belongs to. But I want to bind this command to a keyboard button (Such as Y a.k.a KEY_YES) so that when Y is pressed, cmd_int(playerid, id); is called and the player is teleported to the interior. How do I do this? Please help me.

I tried doing it in OnPlayerKeyStateChange and OnPlayerUpdate + GetPlayerKeys but I'm unable to bind the command to the key


Re: How do I change interiors by pressing buttons on keyboard? - Kane - 22.10.2018

Just check if their newkey is KEY_YES under OnPlayerKeyStateChange and proceed from there?


Re: How do I change interiors by pressing buttons on keyboard? - Shamal - 22.10.2018

Yes it worked. Thanks