Controlling the menu. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Controlling the menu. (
/showthread.php?tid=188198)
Controlling the menu. -
OldDirtyBastard - 06.11.2010
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?
Re: Controlling the menu. -
Hiddos - 06.11.2010
Yarp, use OnPlayerKeyStateChange so that when a player presses 'F', it shows him the previous menu.
Re: Controlling the menu. -
OldDirtyBastard - 06.11.2010
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?
Re: Controlling the menu. -
MadeMan - 06.11.2010
Use OnPlayerSelectedMenuRow