Controlling the menu.
#1

HI,
Today i made a menu, the thing is then i fress the 'F' the menu exits straigh away.
I've got couple submenus so i need to make that if i press F it wont exit the entire
munu, but just go back to the previous one.
Does the solution has anything to do with the OnPlayerKeyStateChange callback?
Reply
#2

Yarp, use OnPlayerKeyStateChange so that when a player presses 'F', it shows him the previous menu.
Reply
#3

It works nicely , but theres a problem, i have already TogglePlayerControllable when the menu comes up,
but when i go into a submenu press F key, it thinks ive already exited the menu and alows me to move again..
ive tried to do seomthing like this to prevent from it but still it alows me to move
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new Menu:current;
    current = GetPlayerMenu(playerid);
    if(current == pistols)
    {
        if (PRESSED(KEY_SECONDARY_ATTACK))
        {
            ShowMenuForPlayer(wepmenu, playerid);
            TogglePlayerControllable(playerid,0);
        }
    }
    return 1;
}
Any suggestions please?
Reply
#4

Use OnPlayerSelectedMenuRow
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)