24.09.2016, 07:16
How does your signature say that you're a server scripter, while you don't even know where to put a public function...? I just woke up and this already messed my brain up lol
A public function goes anywhere in your gamemode, as long as it's below your includes and main {} function. It should also be outside of any function. In this case, there is probably a ' OnPlayerKeyStateChange' existing somewhere. If you can find 'OnPlayerKeyStateChange' in your gamemode, you should place
inside the existing function.
On a side note, this code might not exactly work when the enter command teleports you onto an exit. It might teleport you straight out again. If that's the case, there are a few other things to do, but I just hope for you that this works.
A public function goes anywhere in your gamemode, as long as it's below your includes and main {} function. It should also be outside of any function. In this case, there is probably a ' OnPlayerKeyStateChange' existing somewhere. If you can find 'OnPlayerKeyStateChange' in your gamemode, you should place
Код:
//This is the code taken from Marricio's post if (newkeys & KEY_SECONDARY_ATTACK) { cmd_enter(playerid, ""); cmd_exit(playerid, ""); }
On a side note, this code might not exactly work when the enter command teleports you onto an exit. It might teleport you straight out again. If that's the case, there are a few other things to do, but I just hope for you that this works.