SA-MP Forums Archive
Jetpack - 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: Jetpack (/showthread.php?tid=409856)



Jetpack - Neil. - 23.01.2013

.....


Re: Jetpack - B-Matt - 23.01.2013

SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE); ?


Re: Jetpack - Neil. - 23.01.2013

Quote:
Originally Posted by B-Matt
Посмотреть сообщение
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE); ?
Yes, but I want it once the player presses "enter" while on jetpack


Re: Jetpack - -=Dar[K]Lord=- - 23.01.2013

Hmm as far as i know i think thats not possible as thats not an object nor a pickup that can be removed . There might be some solution ...


Re: Jetpack - Neil. - 23.01.2013

okayy then. Thanks for your comments but might as well use /exitjp instead.


Re: Jetpack - antonio112 - 23.01.2013

How about using 'OnPlayerKeyStateChange', check when a player press ENTER and use GetPlayerSpecialAction to see if they use 'SPECIAL_ACTION_USEJETPACK' and then clear the special action?

Here's an example:

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SECONDARY_ATTACK))
    {
        if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
        {
                SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
                SendClientMessage(playerid, -1, "You're no longer using JETPACK.");
        }
    }
    return 1;
}

LE: Oh, sorry, misread your whole post ... My solution won't work for your problem. I doubt you can 'remove', delete, the jetpack object.


Re: Jetpack - Threshold - 23.01.2013

Well, you can't remove the jetpack by detecting a key, as it is already hard coded into GTA, so it will probably already take effect before OnPlayerKeyStateChange is even called. You can do it by command however, which is basically your only option, or you could try making an alternative key bind, like the crouch key or something? I'm fairly sure by setting the players position it removes the jetpack.