[Help] JetPack (will +rep)
#9

Yes HY's code will set a timer that will make it disappear after 5 seconds.
pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_SECONDARY_ATTACK))
    {
        if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
        {
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid, X, Y, Z);
            SetPlayerPos(playerid, X, Y, Z+1);
            SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
        }
    }
    return 1;
}

CMD:jetpack(playerid, params[])
{
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
    return 1;
}
This is without timer if you don't want it.
Reply


Messages In This Thread
[Help] JetPack (will +rep) - by Arxalan - 31.12.2014, 12:13
Re: [Help] JetPack (will +rep) - by CalvinC - 31.12.2014, 12:19
Re: [Help] JetPack (will +rep) - by Pasa - 31.12.2014, 12:26
Re: [Help] JetPack (will +rep) - by Arxalan - 31.12.2014, 14:29
Re: [Help] JetPack (will +rep) - by CalvinC - 31.12.2014, 14:47
Re: [Help] JetPack (will +rep) - by HY - 31.12.2014, 15:01
Re: [Help] JetPack (will +rep) - by Arxalan - 31.12.2014, 15:05
Re: [Help] JetPack (will +rep) - by Arxalan - 31.12.2014, 15:12
Re: [Help] JetPack (will +rep) - by CalvinC - 31.12.2014, 15:17
Re: [Help] JetPack (will +rep) - by Arxalan - 31.12.2014, 15:36

Forum Jump:


Users browsing this thread: 1 Guest(s)