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



About JetPack... - MasterJoker - 28.01.2012

i'm creating /getjetpack. i created

pawn Код:
IsPlayerInJetPack[MAX_PLAYERS];

/* JetPack Command */

if(IsPlayerInJetPack[playerid] == 1) return //message goes here
IsPlayerInJetPack[playerid] = 1;
the problem is i want when player leaves jetpack. IsPlayerInJetPack[playerid] will set to 0 i trying to make it onplayerkey but i'm sure everytime i press leave key (even i didn't leave in jetpack yet) the system will set the IsPlayerInJetPack to 0.


Re: About JetPack... - Ballu Miaa - 28.01.2012

Could you please paste the full code over here? Im not able to understand the problem as well as any solution for it brother!


Re: About JetPack... - MasterJoker - 28.01.2012

here you go

pawn Код:
/* top of script */

new IsPlayerInJetPack[MAX_PLAYERS];

COMMAND:getjetpack(playerid, params[])
{
    if(GetPlayerScore(playerid) > 100)
    {
        if(IsPlayerInJetPack[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You already have your JetPack!");
        SendClientMessage(playerid, COLOR_GREEN, "Enjoy with your jetpack!");
        IsPlayerInJetPack[playerid] = 1;
        SetPlayerSpecialAction(playerid, 2);
    }
    else return SendClientMessage(playerid, COLOR_RED, "You do not have enough score to ride a JetPack!");
    return 1;
}



Re: About JetPack... - Ballu Miaa - 28.01.2012

Quote:
Originally Posted by MasterJoker
Посмотреть сообщение
here you go

pawn Код:
/* top of script */

new IsPlayerInJetPack[MAX_PLAYERS];

COMMAND:getjetpack(playerid, params[])
{
    if(GetPlayerScore(playerid) > 100)
    {
        if(IsPlayerInJetPack[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You already have your JetPack!");
        SendClientMessage(playerid, COLOR_GREEN, "Enjoy with your jetpack!");
        IsPlayerInJetPack[playerid] = 1;
        SetPlayerSpecialAction(playerid, 2);
    }
    else return SendClientMessage(playerid, COLOR_RED, "You do not have enough score to ride a JetPack!");
    return 1;
}
Allright this is all good. It has no problems in my view. This should work fine. But Can you give the Keystate or any code where it Set's IsPlayerInJetPack[playerid] to 0?


Re: About JetPack... - MasterJoker - 28.01.2012

i don't have one thats why i create this to give some suggestion


Re: About JetPack... - [ABK]Antonio - 28.01.2012

You could put - https://sampwiki.blast.hk/wiki/GetPlayerSpecialAction somewhere then set it to 0


Re: About JetPack... - MasterJoker - 28.01.2012

Well one question what is the key for ENTER


Re: About JetPack... - =WoR=Varth - 28.01.2012

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange


Re: About JetPack... - Ballu Miaa - 28.01.2012

Quote:
Originally Posted by MasterJoker
Посмотреть сообщение
i don't have one thats why i create this to give some suggestion
Thats strange as hell! When the Player leave's the Jetpack it set's IsPlayerInJetpack[playerid] to zero.
Let me check your code in my server , ill tell you what to do. Ill create an alternative if i can!!


Re: About JetPack... - MasterJoker - 28.01.2012

anyone know what is the key for ENTER i tried KEY_RETURN but it gives me error