help with menus
#1

Hello,i have problem,i made some menus,but if i use cmd to enter the menu,it will show options,but when i click on them,they wont work
heres the code



Код:
if(CurrentMenu == Information)
{
switch(row)
{
case 0:
{
SendClientMessage(playerid,COLOR_WHITE,"Welcome to University" uniname);
TogglePlayerControllable(playerid, 1);
return 1;
}
case 1:
{
SendClientMessage(playerid,COLOR_WHITE,"0.00 : Mathematics");
SendClientMessage(playerid,COLOR_WHITE,"1.00 : English");
SendClientMessage(playerid,COLOR_WHITE,"2.00 : Biology");
TogglePlayerControllable(playerid, 1);
return 1;
}
case 2:
{
//SendClientMessage(playerid,COLOR_WHITE,"Mathematics: "MathMark);
//SendClientMessage(playerid,COLOR_WHITE,"English: "EngMark);
//SendClientMessage(playerid,COLOR_WHITE,"Biology: "BioMark);
TogglePlayerControllable(playerid, 1);
return 1;
}
case 3:
{
ShowMenuForPlayer(Buy,playerid);
SetPlayerInterior(playerid,15);
TogglePlayerControllable(playerid, 0);
return 1;
}
}
Reply
#2

BUMP
Reply
#3

Actually pretty cool, i like it, but i don't know what i could help, i suck at this.(Helping)
Reply
#4

The
Код:
return 1;
passes a value back, take that off

pawn Код:
if(CurrentMenu == Information)
{
switch(row)
{
case 0:
{
SendClientMessage(playerid,COLOR_WHITE,"Welcome to University" uniname);
TogglePlayerControllable(playerid, 1);
}
case 1:
{
SendClientMessage(playerid,COLOR_WHITE,"0.00 : Mathematics");
SendClientMessage(playerid,COLOR_WHITE,"1.00 : English");
SendClientMessage(playerid,COLOR_WHITE,"2.00 : Biology");
TogglePlayerControllable(playerid, 1);
}
case 2:
{
//SendClientMessage(playerid,COLOR_WHITE,"Mathematics: "MathMark);
//SendClientMessage(playerid,COLOR_WHITE,"English: "EngMark);
//SendClientMessage(playerid,COLOR_WHITE,"Biology: "BioMark);
TogglePlayerControllable(playerid, 1);
}
case 3:
{
ShowMenuForPlayer(Buy,playerid);
SetPlayerInterior(playerid,15);
TogglePlayerControllable(playerid, 0);
}
return 1;
}
Reply
#5

but i get
Код:
C:\Documents and Settings\xx\Desktop\Uus kaust (5)\gamemodes\schoolrp.pwn(400) : error 002: only a single statement (or expression) can follow each "case"
is this prob in my other menu or with still same?
the line 400 is return 1; from the menu ya gave
edit: its with urs what ya gave,cuz i deleted other ones and still same error
EDIT AGAIN: GOT IT WORKING THANKS!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)