How to kick people from their vehicle when they shoot with Hydra - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to kick people from their vehicle when they shoot with Hydra (
/showthread.php?tid=164670)
How to kick people from their vehicle when they shoot with Hydra -
KennethRandall - 01.08.2010
How to kick people when they shoot with Hydra (rockets), I've tried GetPlayerKeys and OnPlayerKeyStateChange,
still I can press W and Shoot, who can help me?
Re: How to kick people from their vehicle when they shoot with Hydra -
Ash. - 01.08.2010
Why dont you just do it if the player gets kicked when they kill someone? - If thats availiable anyway
Then you can just do (In OnPlayerDeath) kick(killerid)
Re: How to kick people from their vehicle when they shoot with Hydra -
Mauzen - 01.08.2010
You have to check the keys with '&' instead of '==', then it also returns true, if other keys are pressed.
So to check if someone presses the firekey you can use this:
pawn Код:
if( (newkeys & KEY_FIRE) && !(newkeys & KEY_FIRE) )
(Checks if KEY_FIRE is in newkeys, but not in oldkeys)
Re: How to kick people from their vehicle when they shoot with Hydra -
KennethRandall - 01.08.2010
Quote:
Originally Posted by Mauzen
You have to check the keys with '&' instead of '==', then it also returns true, if other keys are pressed.
So to check if someone presses the firekey you can use this:
pawn Код:
if( (newkeys & KEY_FIRE) && !(newkeys & KEY_FIRE) )
(Checks if KEY_FIRE is in newkeys, but not in oldkeys)
|
Ahah, thanks man, gotta check it out later
Re: How to kick people from their vehicle when they shoot with Hydra -
Niixie - 01.08.2010
Remember to check first if the player is in a hydra
Else it would be a mess