Problem with TogglePlayerControllable... -
OldDirtyBastard - 10.11.2010
I need some help with this
pawn Код:
new Menu:current;
current = GetPlayerMenu(playerid);
if(current == wepmenu)
{
if (PRESSED(KEY_SECONDARY_ATTACK))
{
TogglePlayerControllable(playerid, 1);
}
}
I dont know if its just being a bitch or what, but as you can see i defined when it should happen,
now when ever i press the enter/exit key which i ment to make the menu to hide and give me
movemoment back it doest cares if the menu is showen or not, its just executes the function
which brings lots of troubles like you cant enter a single car because it autoaticly resets your
animations and stuff, if anyone could help me to solve this...
Thanks, best regards.
Re: Problem with TogglePlayerControllable... -
Hiddos - 10.11.2010
I can't quite fully understand what you mean, but from what I can see, you mean either:
1) When a player hits the 'secondary attack' key, he can walk again but the menu doesn't gets closed?
OR
2) The code gets executed each time the player presses the 'secondary attack' key.
Re: Problem with TogglePlayerControllable... -
OldDirtyBastard - 10.11.2010
Quote:
Originally Posted by Hiddos
2) The code gets executed each time the player presses the 'secondary attack' key.
|
Yes, thats it, but only after the code has been used, if not everything is normal.
Re: Problem with TogglePlayerControllable... -
SuperS82 - 10.11.2010
Go to
OnPlayerExitMenu....
{
//add
TogglePlayerControllable(playerid, 1);
return 1;
}
Re: Problem with TogglePlayerControllable... -
OldDirtyBastard - 10.11.2010
Quote:
Originally Posted by SuperS82
Go to
OnPlayerExitMenu....
{
//add
TogglePlayerControllable(playerid, 1);
return 1;
}
|
this works only for 1 menu, but i have 2 more submenus and i tried that way already.
ive tried like
pawn Код:
public OnPlayerExitedMenu(playerid)
{
new Menu:current;
current = GetPlayerMenu(playerid);
if(current == wepmenu)
{
TogglePlayerControllable(playerid, 1);
}
}
but dont know why, it didnt worked..
Re: Problem with TogglePlayerControllable... -
SuperS82 - 10.11.2010
Did you try just this?
Код:
public OnPlayerExitedMenu(playerid)
{
TogglePlayerControllable(playerid,1);
return 1;
}
Im pretty sure this will work on all menus
Re: Problem with TogglePlayerControllable... -
OldDirtyBastard - 10.11.2010
Yes i did. But let me explain a better, i have a menu, when i select a
row from it it brings me to a anoter in which i can select a row again
what brings me to a anoter menu so thats like 1 main menu + 2 more submenus.
Re: Problem with TogglePlayerControllable... -
rs.pect - 10.11.2010
Maybe try this:
When you're showing other menu available from other:
pawn Код:
SetPVarInt(playerid, "OnPlayerExitedMenu_Not", 1);
pawn Код:
public OnPlayerExitedMenu(playerid)
{
if(GetPVarInt(playerid, "OnPlayerExitedMenu_Not") != 1)
{
TogglePlayerControllable(playerid,1);
}
return 1;
}
Re: Problem with TogglePlayerControllable... -
[MWR]Blood - 10.11.2010
Wait, where did you add the thing in the first post?
Re: Problem with TogglePlayerControllable... -
OldDirtyBastard - 10.11.2010
Quote:
Originally Posted by ikarus
Wait, where did you add the thing in the first post?
|
At OnPlayerKeyStateChange.