Compiler crashes with this code! Help
#1

What is wrong with this code that is making my pawn compiler crash?

pawn Код:
if(dialogid == SUBMENU)
    {
        if(!response) return 1;
        switch(listitem)
        {
            case 0;
            {
                if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
                {
                    SendClientMessageEx(playerid, COLOR_WHITE,"Submarine is now currently {00FF00} DOCKED"};
                    SubDocked[i] = 0;
                }
            }
            case 1;
            {
                if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
                {
                    SendClientMessageEx(playerid, COLOR_WHITE,"Submarine is now currently {FF0000} UN-DOCKED"};
                    SubDocked[i] = 1;
                }
            }
        }
    }
Reply
#2

It's case 0: and case 1:

not case 0; and case 1;
Reply
#3

pawn Код:
if(dialogid == SUBMENU)
{
    if(!response) return 1;
    if(response)
    {
        switch(listitem)
        {
            case 0:
            {
                if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
                {
                    SendClientMessageEx(playerid, COLOR_WHITE,"Submarine is now currently {00FF00} DOCKED"};
                    SubDocked[playerid] = 0;
                }
            }
            case 1:
            {
                if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
                {
                    SendClientMessageEx(playerid, COLOR_WHITE,"Submarine is now currently {FF0000} UN-DOCKED"};
                    SubDocked[playerid] = 1;
                }
            }
        }
    }
}
I found 3 mistakes, haha.
Reply
#4

still crashing
pawn Код:
if(dialogid == SUBMENU)
    {
        if(!response) return 1;
        switch(listitem)
        {
            case 0:
            {
                if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
                {
                    SendClientMessageEx(playerid, COLOR_WHITE,"Submarine is now currently {00FF00}DOCKED"};
                    SubDocked[i] = 0;
                }
            }
            case 1:
            {
                if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
                {
                    SendClientMessageEx(playerid, COLOR_WHITE,"Submarine is now currently {FF0000}UN-DOCKED"};
                    SubDocked[i] = 1;
                }
            }
        }
    }
Reply
#5

Try my code. ;]]
Reply
#6

EDIT:

D: didnt notice there was no i variable

damn you fasties.
Reply
#7

Still crashes
pawn Код:
if(dialogid == SUBMENU)
    {
        if(!response) return 1;
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
                    {
                        SendClientMessageEx(playerid, COLOR_WHITE,"Submarine is now currently {00FF00} DOCKED"};
                        SubDocked[playerid] = 0;
                    }
                }
                case 1:
                {
                    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
                    {
                        SendClientMessageEx(playerid, COLOR_WHITE,"Submarine is now currently {FF0000} UN-DOCKED"};
                        SubDocked[playerid] = 1;
                    }
                }
            }
        }
    }
Reply
#8

Perhaps you have lost a bracket.
Reply
#9

well I removed the coding and it compiles fine , but when I add that coding in it crashes the compiler. I dont know what is causing it
Reply
#10

LOL i found another mistake in this code.
pawn Код:
if(dialogid == SUBMENU)
    {
        if(!response) return 1;
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
                    {
                        SendClientMessageEx(playerid, COLOR_WHITE,"Submarine is now currently {00FF00} DOCKED");
                        SubDocked[playerid] = 0;
                    }
                }
                case 1:
                {
                    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
                    {
                        SendClientMessageEx(playerid, COLOR_WHITE,"Submarine is now currently {FF0000} UN-DOCKED");
                        SubDocked[playerid] = 1;
                    }
                }
            }
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)