Menu Problem
#1

Hey All!
I need a little help! I can't solve this problem:
Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:weapon = GetPlayerMenu(playerid);

if(weapon == gun)
{
switch(row)
{
case 0:
{
if(GetPlayerMoney(playerid) >= 1500)
{
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid, 24, 100);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Desert Eagle-t.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 1:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 26, 50);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy SawnOff-ot.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 2:
{
if(GetPlayerMoney(playerid) >= 3500)
{
GivePlayerMoney(playerid, -3500);
GivePlayerWeapon(playerid, 34, 50);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy SniperRifle-t.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 3:
{
if(GetPlayerMoney(playerid) >= 4500)
{
GivePlayerMoney(playerid, -4500);
GivePlayerWeapon(playerid, 31, 200);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy M4-et.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 4:
{
if(GetPlayerMoney(playerid) >= 5500)
{
GivePlayerMoney(playerid, -5500);
GivePlayerWeapon(playerid, 32, 200);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy TEC9-et.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 5:
{
if(GetPlayerMoney(playerid) >= 8500)
{
GivePlayerMoney(playerid, -8500);
GivePlayerWeapon(playerid, 9, 1);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Lбncfűrйszt.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 6:
{
if(GetPlayerMoney(playerid) >= 100)
{
GivePlayerMoney(playerid, -100);
GivePlayerWeapon(playerid, 4, 1);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Kйst.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 7:
{
if(GetPlayerMoney(playerid) >= 10500)
{
GivePlayerMoney(playerid, -10500);
GivePlayerWeapon(playerid, 33, 200);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Rifle-t.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 8:
{
if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerMoney(playerid, -500);
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Pajzsot.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 9:
{
if(GetPlayerMoney(playerid) >= 100)
{
GivePlayerMoney(playerid, -100);
GivePlayerWeapon(playerid, 46, 1);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Ejtőernyőt.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 10:
{
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
}
return 1;
}
if(weapon == sexshop)
{
switch(row)
{
case 0:
{
if(GetPlayerMoney(playerid) >= 1500)
{
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid, 24, 100);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Desert Eagle-t.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 1:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 26, 50);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy SawnOff-ot.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
}
return 1;
}
Errors:
D:\TEST\filterscripts\pickupok.pwn(115 : error 010: invalid function or declaration
D:\TEST\filterscripts\pickupok.pwn(1160) : error 010: invalid function or declaration
D:\TEST\filterscripts\pickupok.pwn(1162) : error 010: invalid function or declaration
D:\TEST\filterscripts\pickupok.pwn(1164) : error 010: invalid function or declaration
D:\TEST\filterscripts\pickupok.pwn(1171) : error 010: invalid function or declaration
D:\TEST\filterscripts\pickupok.pwn(117 : error 010: invalid function or declaration
D:\TEST\filterscripts\pickupok.pwn(1180) : error 010: invalid function or declaration
D:\TEST\filterscripts\pickupok.pwn(1187) : error 010: invalid function or declaration
D:\TEST\filterscripts\pickupok.pwn(1195) : error 010: invalid function or declaration

Please help me!
Reply
#2

Can you show us line 1158-1195?
Reply
#3

Here you are:
Код:
if(weapon == sexshop)
{
switch(row)
{
case 0:
{
if(GetPlayerMoney(playerid) >= 1500)
{
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid, 24, 100);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Desert Eagle-t.");
ShowMenuForPlayer(sexshop,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(sexshop, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 1:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 26, 50);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy SawnOff-ot.");
ShowMenuForPlayer(sexshop,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(sexshop, playerid);
TogglePlayerControllable(playerid, 1);
}
}
}
return 1;
}
Reply
#4

You have to delete the "invalid funtion or declarition" Line I think
Reply
#5

No it isn't solve the errors.
Reply
#6

Please label the line numbers
Reply
#7

Quote:
Originally Posted by bpeterson
Here you are:
Код:
if(weapon == sexshop) //1158
{
switch(row)
{
case 0:
{
if(GetPlayerMoney(playerid) >= 1500)
{
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid, 24, 100);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Desert Eagle-t.");
ShowMenuForPlayer(sexshop,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(sexshop, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 1:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 26, 50);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy SawnOff-ot.");
ShowMenuForPlayer(sexshop,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(sexshop, playerid);
TogglePlayerControllable(playerid, 1);
}
}
}
return 1;
} //1196
Reply
#8

Give us the code of the menus. Maybe there is not any rows in that menu.
Reply
#9

Here you are:
Код:
public OnFilterScriptInit()
{
sexshopmenu = CreatePickup(1318, 1, -103.6693,-22.6749,1000.7188);
sexshop = CreateMenu("SexShop", 2, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(sexshop, 0, "Lila Vibrator - $2000");
AddMenuItem(sexshop, 0, "Kicsi Feher Vibrator - $3000");
AddMenuItem(sexshop, 0, "Nagy Feher Vibrator - $4000");
AddMenuItem(sexshop, 0, "Ezust Vibrator - $5000");
AddMenuItem(sexshop, 0, "Viagra - $4000");
AddMenuItem(sexshop, 0, "<KILEPES>");
//
ammunationgun = CreatePickup(1318, 1, 295.7091,-80.8102,1001.5156);
gun = CreateMenu("Ammunation", 2, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(gun, 0, "Desert Eagle - $150");
AddMenuItem(gun, 0, "Sawn Off - $2500");
AddMenuItem(gun, 0, "Sniper - $3500");
AddMenuItem(gun, 0, "M4 - $4500");
AddMenuItem(gun, 0, "Tec9 - $5500");
AddMenuItem(gun, 0, "Lancfuresz - $8500");
AddMenuItem(gun, 0, "Kes - $100");
AddMenuItem(gun, 0, "Rifle - $10500");
AddMenuItem(gun, 0, "Pajzs - $500");
AddMenuItem(gun, 0, "Ejtoernyo - $100");
AddMenuItem(gun, 0, "<KILEPES>");
return 1;
}
//
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:weapon = GetPlayerMenu(playerid);

if(weapon == gun)
{
switch(row)
{
case 0:
{
if(GetPlayerMoney(playerid) >= 1500)
{
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid, 24, 100);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Desert Eagle-t.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 1:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 26, 50);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy SawnOff-ot.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 2:
{
if(GetPlayerMoney(playerid) >= 3500)
{
GivePlayerMoney(playerid, -3500);
GivePlayerWeapon(playerid, 34, 50);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy SniperRifle-t.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 3:
{
if(GetPlayerMoney(playerid) >= 4500)
{
GivePlayerMoney(playerid, -4500);
GivePlayerWeapon(playerid, 31, 200);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy M4-et.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 4:
{
if(GetPlayerMoney(playerid) >= 5500)
{
GivePlayerMoney(playerid, -5500);
GivePlayerWeapon(playerid, 32, 200);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy TEC9-et.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 5:
{
if(GetPlayerMoney(playerid) >= 8500)
{
GivePlayerMoney(playerid, -8500);
GivePlayerWeapon(playerid, 9, 1);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Lбncfűrйszt.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 6:
{
if(GetPlayerMoney(playerid) >= 100)
{
GivePlayerMoney(playerid, -100);
GivePlayerWeapon(playerid, 4, 1);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Kйst.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 7:
{
if(GetPlayerMoney(playerid) >= 10500)
{
GivePlayerMoney(playerid, -10500);
GivePlayerWeapon(playerid, 33, 200);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Rifle-t.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 8:
{
if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerMoney(playerid, -500);
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Pajzsot.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 9:
{
if(GetPlayerMoney(playerid) >= 100)
{
GivePlayerMoney(playerid, -100);
GivePlayerWeapon(playerid, 46, 1);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Ejtőernyőt.");
ShowMenuForPlayer(weapon,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 10:
{
HideMenuForPlayer(weapon, playerid);
TogglePlayerControllable(playerid, 1);
}
}
}
return 1;
}
if(weapon == sexshop)
{
switch(row)
{
case 0:
{
if(GetPlayerMoney(playerid) >= 1500)
{
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid, 24, 100);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Lila Vibrбtort.");
ShowMenuForPlayer(sexshop,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(sexshop, playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 1:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 26, 50);
SendClientMessage(playerid, COLOUR_YELLOW, "Vettйl egy Kicsi Fehйr Vibrбtort.");
ShowMenuForPlayer(sexshop,playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nincs eleg penzed!", 2000, 5);
HideMenuForPlayer(sexshop, playerid);
TogglePlayerControllable(playerid, 1);
}
}
}
return 1;
}
Reply
#10

***FIXED!***
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)