30.08.2010, 22:10
My script used to work perfectly, but now it shows up the shit and everything, but the options have no effect, you pick an option and nothing happens , the menu hides and you stay frozen, it used to work but after a restart i have this bug.
can anyway tell me whats the problem?
can anyway tell me whats the problem?
pawn Код:
new Menu:Store;
new Menu:Store2;
new Menu:Store3;
new Menu:Taco;
DestroyMenu(Menu:Store);
DestroyMenu(Menu:Store2);
DestroyMenu(Menu:Store3);
DestroyMenu(Menu:Taco);
Store = CreateMenu("24/7",1,20,120,150,40);
Store2 = CreateMenu("24/7",1,20,120,150,40);
Store3 = CreateMenu("24/7",1,20,120,150,40);
Taco = CreateMenu("Taco Bell",1,20,120,150,40);
SetMenuColumnHeader(Store, 0, "Available Items");
SetMenuColumnHeader(Store2, 0, "Available Items");
SetMenuColumnHeader(Store3, 0, "Available Items");
SetMenuColumnHeader(Taco, 0, "Taco's Menu");
AddMenuItem(Store,0,"Box of Cigarettes");
AddMenuItem(Store,0,"Beer");
AddMenuItem(Store,0,"Wine");
AddMenuItem(Store,0,"Sprunk");
AddMenuItem(Store,0,"Bat");
AddMenuItem(Store,0,"Next");
AddMenuItem(Store,0,"Exit");
AddMenuItem(Store2,0,"Ski-mask");
AddMenuItem(Store2,0,"Mask");
AddMenuItem(Store2,0,"Chocolate Bar");
AddMenuItem(Store2,0,"Cellphone");
AddMenuItem(Store2,0,"Dices");
AddMenuItem(Store2,0,"Spraycan");
AddMenuItem(Store2,0,"Ducktape");
AddMenuItem(Store2,0,"Previous");
AddMenuItem(Store2,0,"Next");
AddMenuItem(Store2,0,"Exit");
AddMenuItem(Store3,0,"Lefty Ciga");
AddMenuItem(Store3,0,"Backpack");
AddMenuItem(Store3,0,"Basket-ball");
AddMenuItem(Store3,0,"40z");
AddMenuItem(Store3,0,"Previous");
AddMenuItem(Store3,0,"Exit");
AddMenuItem(Taco,0,"Classic Taco");
AddMenuItem(Taco,0,"Taco with salad");
AddMenuItem(Taco,0,"Chicken Taco");
AddMenuItem(Taco,0,"Meat Taco");
AddMenuItem(Taco,0,"Taco with mayo");
AddMenuItem(Taco,0,"Exit");
if(GetPlayerMenu(playerid) == Store)
{
switch(row)
{
case 0:
if(GetPlayerMoney(playerid) >= 50)
{
PlayerData[playerid][Cigarettes] = 2;
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:
if(GetPlayerMoney(playerid) >= 15)
{
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:
if(GetPlayerMoney(playerid) >= 15)
{
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:
if(GetPlayerMoney(playerid) >= 15)
{
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:
if(GetPlayerMoney(playerid) >= 45)
{
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:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Store, playerid);
ShowMenuForPlayer(Store2,playerid);
}
case 7:
{
TogglePlayerControllable(playerid, 1);
HideMenuForPlayer(Store, playerid);
}
}
}
else if(GetPlayerMenu(playerid) == Store2)
{
switch(row)
{
case 0:
if(GetPlayerMoney(playerid) >= 500)
{
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(Store2, playerid);
}
case 1:
if(GetPlayerMoney(playerid) >= 250)
{
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(Store2, playerid);
}
case 2:
if(GetPlayerMoney(playerid) >= 20)
{
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(Store2, playerid);
}
case 3:
if(GetPlayerMoney(playerid) >= 120)
{
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(Store2, playerid);
}
case 4:
if(GetPlayerMoney(playerid) >= 40)
{
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(Store2, playerid);
}
case 5:
if(GetPlayerMoney(playerid) >= 150)
{
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a spraycan, go tag a wall homie");
GivePlayerMoney(playerid,-150);
GivePlayerWeapon(playerid,365,500);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store2, playerid);
}
case 6:
if(GetPlayerMoney(playerid) >= 150)
{
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a ducktape, /dtape to put it on and /dtapeoff to remove it");
GivePlayerMoney(playerid,-150);
PlayerData[playerid][Ducktape] = 1;
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store2, playerid);
}
case 7:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Store2, playerid);
ShowMenuForPlayer(Store,playerid);
}
case 8:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Store2, playerid);
ShowMenuForPlayer(Store3,playerid);
}
case 9:
{
TogglePlayerControllable(playerid, 1);
HideMenuForPlayer(Store2, playerid);
}
}
}
else if(GetPlayerMenu(playerid) == Store3)
{
switch(row)
{
case 0:
if(GetPlayerMoney(playerid) >= 30)
{
PlayerData[playerid][Lefty] = 1;
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a cigarette, to use it type /ciga2.");
GivePlayerMoney(playerid,-30);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store3, playerid);
}
case 1:
if(GetPlayerMoney(playerid) >= 80)
{
PlayerData[playerid][Backpack] = 1;
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a backpack, use it to carry your items.");
GivePlayerMoney(playerid,-80);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store3, playerid);
}
case 2:
if(GetPlayerMoney(playerid) >= 50)
{
PlayerData[playerid][Bball] = 1;
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a basket-ball, go and show these niggas you're Michael Jackson.");
GivePlayerMoney(playerid,-50);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store3, playerid);
}
case 3:
if(GetPlayerMoney(playerid) >= 30)
{
PlayerData[playerid][Fourty] = 1;
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a 40z like a real grove street homie.");
GivePlayerMoney(playerid,-30);
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Store3, playerid);
}
case 4:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Store3, playerid);
ShowMenuForPlayer(Store2,playerid);
}
case 5:
{
TogglePlayerControllable(playerid, 1);
HideMenuForPlayer(Store3, playerid);
}
}
}
else if(GetPlayerMenu(playerid) == Taco)
{
switch(row)
{
case 0:
if(GetPlayerMoney(playerid) >= 10)
{
new Float:health;
GivePlayerMoney(playerid,-10);
SetPlayerHealth(playerid, floatround(health) + 20);
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a classic taco, [COST:10$]");
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Taco, playerid);
}
case 1:
if(GetPlayerMoney(playerid) >= 15)
{
GivePlayerMoney(playerid,-20);
new Float:health;
SetPlayerHealth(playerid, floatround(health) + 30);
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've a taco with salad, health man [COST:20$]");
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Taco, playerid);
}
case 2:
if(GetPlayerMoney(playerid) >= 20)
{
GivePlayerMoney(playerid,-20);
new Float:health;
SetPlayerHealth(playerid, floatround(health) + 45);
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a chicken taco, [COST:45$]");
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Taco, playerid);
}
case 3:
if(GetPlayerMoney(playerid) >= 30)
{
GivePlayerMoney(playerid,-30);
new Float:health;
SetPlayerHealth(playerid, floatround(health) + 60);
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a meat taco, [COST:60$]");
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Taco, playerid);
}
case 4:
if(GetPlayerMoney(playerid) >= 35)
{
GivePlayerMoney(playerid,-35);
new Float:health;
SetPlayerHealth(playerid, floatround(health) + 85);
SendClientMessage(playerid,COLOR_RED, "SERVER MESSAGE: You've bought a taco with mayo [COST:35$]");
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Taco, playerid);
}
case 5:
{
TogglePlayerControllable(playerid, 1);
HideMenuForPlayer(Taco, playerid);
}
}
}