Hotkeys IN-Game
#9

Quote:
Originally Posted by RealCop228
View Post
pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(EnteredInterior[playerid]) return cmd_exit(playerid, "");
        else return cmd_enter(playerid, "");
    }
    return 1;
}
The above code will basically call /enter or /exit depending on the validity of this bool statement:

pawn Code:
EnteredInterior[playerid]
You will want to make this a true statement in your /enter command, so towards the bottom or something, do this:

pawn Code:
EnteredInterior[playerid] = true;
... and you'll want to make this a false statement in your /exit command, so towards the bottom or something, add this:

pawn Code:
EnteredInterior[playerid] = false;
Don't forget to add this at the top of your script...

pawn Code:
new bool:EnteredInterior[MAX_PLAYERS] = false;
Appreciate it, testing it now!
Reply


Messages In This Thread
Hotkeys IN-Game - by Vinninho - 07.02.2013, 17:51
Re: Hotkeys IN-Game - by Scenario - 07.02.2013, 17:57
Re: Hotkeys IN-Game - by Vinninho - 07.02.2013, 18:12
Re: Hotkeys IN-Game - by Scrillex - 07.02.2013, 18:14
Re: Hotkeys IN-Game - by Vinninho - 07.02.2013, 18:34
Re: Hotkeys IN-Game - by Scenario - 07.02.2013, 18:39
Re: Hotkeys IN-Game - by Vinninho - 07.02.2013, 18:41
Re: Hotkeys IN-Game - by Scenario - 07.02.2013, 18:45
Re: Hotkeys IN-Game - by Vinninho - 07.02.2013, 18:58
Re: Hotkeys IN-Game - by Vinninho - 07.02.2013, 19:20

Forum Jump:


Users browsing this thread: 1 Guest(s)