SA-MP Forums Archive
[Help] Dialog - 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] Dialog (/showthread.php?tid=256923)



[Help] Dialog - farmer1710 - 23.05.2011

pawn Код:
public OnPlayerSelectedMenuRow(playerid,row)//----------------------------What all menus do
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if (CurrentMenu == FactionMenu)
{
switch(row)
{
case 0://Pilots
{
    SetSpawnInfo(playerid,0,61,1262.9125,40.6773,14.1392,222.5061,371,1,346,500,0,0);
    SetPlayerInterior(playerid,0);
    SendClientMessage(playerid,COLOR_WHITE,"Start your life as a Fly Boy. Will you become an ace? Or die a discrase?");
}
case 1://Marines
{
    SetSpawnInfo(playerid,0,287,291.2855,2041.9082,17.6406,198.7344,356,1000,348,500,0,0);
    SetPlayerArmour(playerid,100);
    SetPlayerInterior(playerid,0);
    SendClientMessage(playerid,COLOR_WHITE,"Start your life as a Marine. Will you rise the ranks and live the war? Or die as a lowly private.");
}
case 2://Gangs Black
{
    SetSpawnInfo(playerid,0,106,213.1244,-183.4817,1.5781,359.8532,355,1000,0,0,0,0);
    SetPlayerInterior(playerid,0);
    SendClientMessage(playerid,COLOR_WHITE,"Start your life as a gangster. Will you raise to be a true OG' or fall as just another soldier.");
}
case 3://Regular
{
    SetSpawnInfo(playerid,0,101,1290.6151,175.4240,20.4609,65.2012,0,0,0,0,0,0);
    SetPlayerInterior(playerid,0);
    SendClientMessage(playerid,COLOR_WHITE,"Start your journey off as a regular.Will you become a billionare? Or go into debt?");
} //LINE  110

Error:
Код:
C:\Users\Zack Farmer\Desktop\Scripting stuff\OLRP Script\FRP.pwn(111) : error 002: only a single statement (or expression) can follow each "case"



Re: [Help] Dialog - Norn - 23.05.2011

What have you got after case 3, anything else?


Re: [Help] Dialog - farmer1710 - 23.05.2011

Nope the closing bracket is the edge of my script


Re: [Help] Dialog - farmer1710 - 23.05.2011

*bump*


Re: [Help] Dialog - Vince - 23.05.2011

Indent properly and close your callback properly. I cannot stress enough that you should properly indent your code at all times. Not only is it easier to read, but it's also a lot less error prone.