SA-MP Forums Archive
Simple problem, please assist - 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: Simple problem, please assist (/showthread.php?tid=273463)



Simple problem, please assist - Shockey HD - 01.08.2011

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    case DIALOG_SPAWN://This is the "Error Line"
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerColor(playerid, 0x0000BBAA);
                    SetPlayerTeam(playerid, 1);
                    PlayerInfo[playerid][pTeam] = 1;
                    SetSpawnInfo(playerid, 0, 287, -253.1229, 2604.2446, 62.8582, 0, 24, 50, 31, 200, 16, 2);
                    SpawnPlayer(playerid);
                    SendClientMessage(playerid, COLOR_WHITE, "You can view your stats by using /stats.");
                    SendClientMessage(playerid, COLOR_RED, "To save your stats, you must register a new account!");
                    SendClientMessage(playerid, COLOR_GREEN, "You can achieve medals and achievements by killing the enemy team!");
                    SendClientMessage(playerid, COLOR_YELLOW, "If you catch someone breaking server offenses such as Hacking, use /report.");
                    SendClientMessage(playerid, COLOR_ORANGE, "Join our Teamspeak, se-gaming.clants.net:6688!");
                    SendClientMessage(playerid, COLOR_BLUE, "You can /buy at the briefcases to buy some weapons!");
                    SendClientMessage(playerid, COLOR_OLIVE, "You can now use /r(adio) to chat with your team mates!");
                    SendClientMessage(playerid, COLOR_PURPLE, "You can now purchase VIP Membership at the shop by visiting shop.se-gaming.net!");
                }
                case 1:
                {
                    SetPlayerColor(playerid, 0xAA3333AA);
                    SetPlayerTeam(playerid, 2); //preventing team kill
                    PlayerInfo[playerid][pTeam] = 2;
                    SetSpawnInfo(playerid, 0, 285, -1514.8345, 2523.0137, 55.8215, 0, 24, 50, 29, 200, 35, 1);
                    SpawnPlayer(playerid);
                    SendClientMessage(playerid, COLOR_WHITE, "You can view your stats by using /stats.");
                    SendClientMessage(playerid, COLOR_RED, "To save your stats, you must register a new account!");
                    SendClientMessage(playerid, COLOR_GREEN, "You can achieve medals and achievements by killing the enemy team!");
                    SendClientMessage(playerid, COLOR_YELLOW, "If you catch someone breaking server offenses such as Hacking, use /report.");
                    SendClientMessage(playerid, COLOR_ORANGE, "Join our Teamspeak, se-gaming.clants.net:6688!");
                    SendClientMessage(playerid, COLOR_BLUE, "You can /buy at the briefcases to buy some weapons!");
                    SendClientMessage(playerid, COLOR_OLIVE, "You can now use /r(adio) to chat with your team mates!");
                    SendClientMessage(playerid, COLOR_PURPLE, "You can now purchase VIP Membership at the shop by visiting shop.se-gaming.net!");
                }
            }
        }
    }
pawn Код:
C:\Documents and Settings\Chris\Desktop\Gamemode\gamemodes\ModernWarefare3.pwn(851) : error 014: invalid statement; not in switch
C:\Documents and Settings\Chris\Desktop\Gamemode\gamemodes\ModernWarefare3.pwn(851) : warning 215: expression has no effect
C:\Documents and Settings\Chris\Desktop\Gamemode\gamemodes\ModernWarefare3.pwn(851) : error 001: expected token: ";", but found ":"
C:\Documents and Settings\Chris\Desktop\Gamemode\gamemodes\ModernWarefare3.pwn(851) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\Desktop\Gamemode\gamemodes\ModernWarefare3.pwn(851) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.



Re : Simple problem, please assist - Soumi - 01.08.2011

What's the problem? can you show us the error?


Re: Simple problem, please assist - alpha500delta - 01.08.2011

You didn't use a switch statement before case DIALOG_SPAWN:


Re: Re : Simple problem, please assist - Shockey HD - 01.08.2011

Quote:
Originally Posted by Soumi
Посмотреть сообщение
What's the problem? can you show us the error?
Whoops, sorry Edited


Re : Simple problem, please assist - Soumi - 01.08.2011

Try this

Код:
if(dialogid == DIALOG_SPAWN)



Re: Re : Simple problem, please assist - alpha500delta - 01.08.2011

Quote:
Originally Posted by Soumi
Посмотреть сообщение
Try this

Код:
if(dialogid == DIALOG_SPAWN)
That's slower than a switch statement. He just forgot to add switch before the case .


Re: Simple problem, please assist - Kush - 01.08.2011

I fixed it for him on Teamviewer...