Menu problem
#1

Hello, i want to know if it is possible to make a function in a menu that makes the old menu hide and a new one show up.

i mean

i made a command to only work at 24/7 and everything is cool and that , and theres an action i added because the items list is too long which is called 'next'

Well, 'next' works to hide menu1 and show menu2, but when i scripted it and the menu1 hides, but the menu2 doesn't shows up, also the 'baseball' 'dildo' dont work. they take your money but dont give you the weapon

heres the code

if(GetPlayerMenu(playerid) == Store)
{
switch(row)
{
case 0:
{
PlayerData[playerid][Cigarettes] = 10;
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a box of cigarettes, it costs 50 bucks, type /ciga to use them");
GivePlayerMoney(playerid,-50);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 1:
{
PlayerData[playerid][Beer] = 1;
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a beer, it costs 15 bucks");
GivePlayerMoney(playerid,-15);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 2:
{
PlayerData[playerid][Wine] = 1;
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a wine bottle, it costs 15 bucks");
GivePlayerMoney(playerid,-15);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 3:
{
PlayerData[playerid][Sprunk] = 1;
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a sprunk can, it costs 15 bucks");
GivePlayerMoney(playerid,-15);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 4:
{
GivePlayerWeapon(playerid,336,-1);
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a baseball bat, it costs 45 bucks");
GivePlayerMoney(playerid,-45);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 5:
{
GivePlayerWeapon(playerid,321,-1);
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a dildo, what you gonna do with that thing?");
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 6:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Store, playerid);
ShowMenuForPlayer(Store2,playerid);
}
case 7:
{
TogglePlayerControllable(playerid, 1);
HideMenuForPlayer(Store, playerid);
}

}
}




if(GetPlayerMenu(playerid) == Store2)
{
switch(row)
{
case 0:
{
PlayerData[playerid][Skimask] = 1;
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a ski-mask, it costs 500 bucks, read /ski-maskhelp or /burglaryhelp for information.");
GivePlayerMoney(playerid,-500);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 1:
{
PlayerData[playerid][Mask] = 1;
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a mask, it costs 250 bucks, read /maskhelp for information.");
GivePlayerMoney(playerid,-250);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 2:
{
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a chocolate bar, it costs 20 bucks");
GivePlayerMoney(playerid,-20);
new Float:health;
GetPlayerHealth(playerid,health);if(health >= 0)
SetPlayerHealth(playerid,100); else SetPlayerHealth(playerid, floatround(health) + 35);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 3:
{
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a cellphone, it costs 120 bucks.");
PlayerData[playerid][Cellphone] = 1;
GivePlayerMoney(playerid,-120);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 4:
{
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought dices, to use them type /roledice, it costs 40 bucks");
GivePlayerMoney(playerid,-40);
PlayerData[playerid][Dices] = 1;
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
}
case 5:
{
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a spraycan, go and make a tag , baby");
GivePlayerMoney(playerid,-50);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store, playerid);
GivePlayerWeapon(playerid,365,300);
}
case 6:
{
TogglePlayerControllable(playerid, 1);
HideMenuForPlayer(Store2, playerid);
}

}
}
Reply
#2

Use dialogs, they are much easier and they look better. Also, use [ PAWN] [ /PAWN]tags so your script is easier to read on the forum.
Reply
#3

No, thanks.

The whole script is done and i don't want to make anything else , so i got 2 questions.

Why the options 'Dildo' and 'Baseball bat' dont give the guns but take the money?

How to make so the menu1 closes and the menu2 shows up?
Reply
#4

answer please, few hours passed away.
Reply
#5

By changing -1 to 1 as ammo value.. ?
Reply
#6

ok what about the other problem

to hide menu1 and make menu2 show up
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)