15.05.2009, 09:22
I noticed that when i made it so you weren't frozen, you could get into vehicles, but it was only when you closed the menu you couldn't get into any vehicle.
Here are the only two ways to close it:
PINFO[playerid][CWMENU] is equal to 1 when they type the command to bring up the category menu. There is no other way to make it equal to 1.
And the other way is by selecting the exit option in the category menu:
Option 11 (case 10) is the exit option.
Here are the only two ways to close it:
pawn Code:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if((PINFO[playerid][CWMENU]==1)&&(newkeys==KEY_SECONDARY_ATTACK)){
TogglePlayerControllable(playerid,1);
ResetPlayerWeapons(playerid);
PINFO[playerid][CWMENU]=0;
PINFO[playerid][CW]=0;
}
return 1;
}
And the other way is by selecting the exit option in the category menu:
pawn Code:
new Menu:CMenu=GetPlayerMenu(playerid);
if(CMenu==Category)
{
switch(row)
{
case 0:{HideMenuForPlayer(Category,playerid);ShowMenuForPlayer(Category,playerid);}
case 1:{HideMenuForPlayer(Category,playerid);ShowMenuForPlayer(Melee,playerid);}
case 2:{HideMenuForPlayer(Category,playerid);ShowMenuForPlayer(Melee2,playerid);}
case 3:{HideMenuForPlayer(Category,playerid);ShowMenuForPlayer(Pistols,playerid);}
case 4:{HideMenuForPlayer(Category,playerid);ShowMenuForPlayer(Shotguns,playerid);}
case 5:{HideMenuForPlayer(Category,playerid);ShowMenuForPlayer(SMGs,playerid);}
case 6:{HideMenuForPlayer(Category,playerid);ShowMenuForPlayer(Rifles,playerid);}
case 7:{HideMenuForPlayer(Category,playerid);ShowMenuForPlayer(Heavy,playerid);}
case 8:{HideMenuForPlayer(Category,playerid);ShowMenuForPlayer(Thrown,playerid);}
case 9:{HideMenuForPlayer(Category,playerid);ShowMenuForPlayer(Special,playerid);}
case 10://The exit option
{
HideMenuForPlayer(Category,playerid);
TogglePlayerControllable(playerid,1);
ResetPlayerWeapons(playerid);
PINFO[playerid][CWMENU]=0;
}
}
}