Quote:
Originally Posted by Norn
pawn Code:
//top of script new HMenuStarted[MAX_PLAYERS]; //OnPlayerConnect HMenuStarted[playerid] = 0;
public OnPlayerPickUpPickup(playerid, pickupid) { if(GetHouseID(playerid) != -255) { if(HMenuStarted[playerid] == 0) { TogglePlayerControllable(playerid, 0); ShowMenuForPlayer(EnterHousePickup, playerid); HMenuStarted[playerid] = 1; return 1; } } return 1; }
Make sure to set HMenuStarted[playerid] to 0 when the player exits the menu.
|
he can only enter the menu once now
that's why you'll need a 'OnPlayerLeavePickup', to set HMenuStarted[playerid] to 0 again when he leaves the pickup