SA-MP Forums Archive
[HELP] Height Limit & Remove in-game pickup - 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: [HELP] Height Limit & Remove in-game pickup (/showthread.php?tid=420644)



[HELP] Height Limit & Remove in-game pickup - Baltazar - 06.03.2013

How to set a height limit for a certain player, so he could fly higher? How to remove a jetpack pickup, which appears after a player leaves it?


Re: [HELP] Height Limit - SuperViper - 06.03.2013

You can't.


Re: [HELP] Height Limit & Remove in-game pickup - [MG]Dimi - 06.03.2013

First impossible. Second you need to use SetPlayerSpecialAction(playerid, 0); while he is still using it. On key change check is his special action 2, if yes set it to 0


Re: [HELP] Height Limit & Remove in-game pickup - Baltazar - 06.03.2013

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
First impossible. Second you need to use SetPlayerSpecialAction(playerid, 0); while he is still using it. On key change check is his special action 2, if yes set it to 0
When a player presses F, jetpack pickup appears. I can't SetPlayerAction(playerid, 0) just before he presses F because I don't know when he is going to press the key. If I apply some code after he presses F key, there is no meaning in setting special action to 0, because it's already 0 and it also doesn't help to remove the jetpack pickup. Maybe your technique works and it's me, who don't get the idea. Thanks for further explanation.


Re: [HELP] Height Limit & Remove in-game pickup - SuperViper - 06.03.2013

Set a variable which indicates whether the player has a jetpack or not. This variable should be set to false under OnPlayerKeyStateChange when the person presses the F key and when you set it to 0, teleport the player to a random position in the sky and then teleport them back. The pickup should be gone.


Re: [HELP] Height Limit & Remove in-game pickup - Baltazar - 08.03.2013

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Set a variable which indicates whether the player has a jetpack or not. This variable should be set to false under OnPlayerKeyStateChange when the person presses the F key and when you set it to 0, teleport the player to a random position in the sky and then teleport them back. The pickup should be gone.
Changed position as you said, interior, virtual world as well and it did not help. You solution is simply not working at all. Any other suggestions?


Re: [HELP] Height Limit & Remove in-game pickup - Threshold - 09.03.2013

It's not likely possible without having the pickup streamed out (usually by players walking far distances away from it), because the 'Press F to remove jetpack' is hard-coded into GTA itself and therefore is being called before any callbacks like OnPlayerKeyStateChange... You are correct when you say, 'by the time OnPlayerKeyStateChange is even being called, the jetpack is already removed'.


Re: [HELP] Height Limit & Remove in-game pickup - MP2 - 09.03.2013

It doesn't actually even destroy when it streams out.