[SOLVED]Bank menu freeze command won't work, please help!
#1

Ok, I have a small problem this time guys, I would be happy if you could help me. I've read on wiki how to create a menu and everything went fine- and now it's created and located in the bank checkpoint. I wanted to create a menu where you have "Deposit" and "Withdraw" functions so when I open this, that another menu opens where you can select 1, 10 , 100, 1000, 100000 money, like how mutch you want to withdraw or deposit (just like on Littlewhiteys but without Depositall and Withdrawall functions). So the thing is that I didn't know how to create "menus-in-menu" thing so I've created 3 menus- 1st where's the main menu and you can see deposit/withdraw function, now when the user types shift on one of those, a menu pops up with those numbers 1, 10... I've used this cmd as I didn't know what to do CallLocalFunction("OnPlayerCommandText", "is", playerid, "/depositmenu"); for example now when I click shift on deposit now opens the another new Deposit menu.

So the whole thing of these is that I've made everything as in wiki and forums said, to freeze and unfreeze player when he enters/exits the menu, but the point is that he is freezed at the main bank menu (where you can see deposit and withdraw) but when I click shift on on one of those two, my character gets unfreezed, but I have called the command that he should be freezed at that (deposit or withdraw) menu too. I have also called a command that when I leave the main menu that he doesnt get unfreezed- actually i have tried every combination. So guys please help me, I want that my character doesn't get unfreezed when I click on one of this options (deposit/withdraw)

Here is a peace of my code, if you need anything else I'll post it:
Код:
//=============================Bank Menu========================================
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:current;
  current = GetPlayerMenu(playerid);
  if(current == depositmenu)
  {
  switch(row)
  {
    case 0:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 1");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 1:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 10");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 2:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 100");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 3:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 1000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 4:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 10000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 5:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 100000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
  }
}
  if(current == withdrawmenu)
  {
  switch(row)
  {
    case 0:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 1");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    case 1:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 10");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    case 2:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 100");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    case 3:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 1000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    case 4:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 10000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    case 5:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 100000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
  }
}
  if(current == bankmenu)
  {
  switch(row)
  {
    case 0:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 1:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    }
  }
  return 1;
}
BTW: Sorry guys that I wrote so much, but I always write so much so you can get the full info what I meant and so you can understand, so please don't be lazy to read... I always write so much
Reply
#2

I would think for menu's in menu's you could just have it open another menu of the same size and position and stuff
Reply
#3

pawn Код:
CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 1");
must be

pawn Код:
CallLocalFunction("OnPlayerCommandText", "d", playerid, "/deposit 1");
Reply
#4

Quote:
Originally Posted by MJφ
pawn Код:
CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 1");
must be

pawn Код:
CallLocalFunction("OnPlayerCommandText", "d", playerid, "/deposit 1");
That won't work. He is sending a number and a string to OnPlayerCommandText(playerid, cmdtext[]);

i is an integer, d is a whole number, so either will work
Reply
#5

Guys I really don't think that that's the prob... I can open menus just fine... I think that I should make some kind of freeze code when I enter the checkpoint, but how? Here is my callback if player isn't in checkpoint, otherwise if player is in checkpoint just change 0 to 1

Код:
if(IsPlayerInCheckpoint(playerid) == 0 || getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK_2 && getCheckpointType(playerid) != CP_BANK_3)
BTW it's just my suggestion but if you think anything else is causing this problem I will listen to you and try.

EDIT: I tried this one, but my character doesn't get freezed when I'm in checkpoint.
EDIT2: I need to go to sleep now lol, I will watch for replys after about 11-12 hours...

Код:
if(IsPlayerInCheckpoint(playerid) == 1 || getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK_2 && getCheckpointType(playerid) != CP_BANK_3)
{
TogglePlayerControllable(playerid, 0);
return 1;
}
Reply
#6

Quote:
Originally Posted by Lavamike
I would think for menu's in menu's you could just have it open another menu of the same size and position and stuff
I don't know what u r talking about caz I told ya that I have created 3 menus, so if u type /menu in bank checkpoint you will see the 1st menu. If u shift like deposit on it the second menu will be caled with the callback you disscused up there, /menu1
Reply
#7

Anybody, please? I still don't know how to freeze players, cause I don't know what code should I use, I tried everything. Again I used this codes...
Код:
//=============================Bank Menu========================================
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:current;
  current = GetPlayerMenu(playerid);
  if(current == depositmenu)
  {
  switch(row)
  {
    case 0:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 1");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 1:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 10");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 2:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 100");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 3:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 1000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 4:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 10000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 5:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/deposit 100000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
  }
}
  if(current == withdrawmenu)
  {
  switch(row)
  {
    case 0:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 1");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    case 1:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 10");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    case 2:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 100");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    case 3:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 1000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    case 4:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 10000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    case 5:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/withdraw 100000");
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
  }
}
  if(current == bankmenu)
  {
  switch(row)
  {
    case 0:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
    }
    case 1:
    {
      CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
    }
    }
  }
  return 1;
}
Код:
public OnPlayerExitedMenu(playerid)
{
  new Menu:current;
  current = GetPlayerMenu(playerid);
  if(current == bankmenu)
  {
  TogglePlayerControllable(playerid,0);
  }
  if(current == depositmenu)
  {
  CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu1");
  TogglePlayerControllable(playerid,0);
  }
  if(current == withdrawmenu)
  {
  CallLocalFunction("OnPlayerCommandText", "is", playerid, "/menu2");
  TogglePlayerControllable(playerid,0);
  }
  return 1;
}
Код:
//================================Bank (FIRST) Menu CMD=================================
	if (strcmp(cmdtext, "/menu", true)==0)
	{
	  if(IsPlayerInCheckpoint(playerid) == 0 || getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK_2 && getCheckpointType(playerid) != CP_BANK_3)
		{
	    SendClientMessage(playerid, COLOR_SYSTEM, "SERVER: Unknown Command.");
			return 1;
		}
		{
    TogglePlayerControllable(playerid, 0);
     }
		ShowMenuForPlayer(bankmenu,playerid);
		return 1;
	}
Код:
//================================Deposit (SECOND) Menu CMD==============================
	if (strcmp(cmdtext, "/menu1", true)==0)
	{
	  if(IsPlayerInCheckpoint(playerid) == 0 || getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK_2 && getCheckpointType(playerid) != CP_BANK_3)
		{
	    SendClientMessage(playerid, COLOR_SYSTEM, "SERVER: Unknown Command.");
			return 1;
		}
		ShowMenuForPlayer(depositmenu,playerid);
		return 1;
	}
Код:
//================================Withdraw (THIRD) Menu CMD=============================
	if (strcmp(cmdtext, "/menu2", true)==0)
	{
	  if(IsPlayerInCheckpoint(playerid) == 0 || getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK_2 && getCheckpointType(playerid) != CP_BANK_3)
		{
	    SendClientMessage(playerid, COLOR_SYSTEM, "SERVER: Unknown Command.");
			return 1;
		}
		ShowMenuForPlayer(withdrawmenu,playerid);
		return 1;
	}
The problem still remains, I tried everything. I would be glad if you could help me. My opinion is that u show me how to freeze the player when he enters the checkpoint, not the menu, and gets unfreezed when he presses alt or something like that. Help would be much appreciated.

EDIT: I have solved this "Bug". The problem was in some debug filterscript. I just turned that FS off, and it worked, thx guys you tried to help me, but you couldn't resolve this problem, as I didn't know too that it was the problem in that debug mode...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)