Quote:
Originally Posted by RealCop228
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!