SA-MP Forums Archive
help with menus - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help with menus (/showthread.php?tid=139607)



help with menus - WardenCS - 05.04.2010

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;
}
}



Re: help with menus - WardenCS - 05.04.2010

BUMP


Re: help with menus - Steven82 - 05.04.2010

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


Re: help with menus - Khelif - 05.04.2010

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;
}



Re: help with menus - WardenCS - 09.04.2010

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!