Error 014
#1

Hey I need help with this

Код:
C:\Users\Robinson\Downloads\New folder\gamemodes\RP.pwn(3376) : warning 217: loose indentation
C:\Users\Robinson\Downloads\New folder\gamemodes\RP.pwn(3376) : error 014: invalid statement; not in switch
C:\Users\Robinson\Downloads\New folder\gamemodes\RP.pwn(3376) : warning 215: expression has no effect
C:\Users\Robinson\Downloads\New folder\gamemodes\RP.pwn(3376) : error 001: expected token: ";", but found ":"
C:\Users\Robinson\Downloads\New folder\gamemodes\RP.pwn(3376) : error 029: invalid expression, assumed zero
C:\Users\Robinson\Downloads\New folder\gamemodes\RP.pwn(3376) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
heres the code

pawn Код:
stock GetPlayerFactionInfo(targetid, rank[64], division[64], employer[64]) {
    switch(PlayerInfo[targetid][pFaction])
    {
        case 1: {
            employer = "LSPD";
            switch(PlayerInfo[targetid][pRank]) {
                case 1: rank = "Officer";
                case 2: rank = "Corporal";
                case 3: rank = "Sergeant";
                case 4: rank = "Lieutenant";
                case 5: rank = "Captain";
                case 6: rank = "Chief";
                default: rank = "Cadet";
            }
            switch(PlayerInfo[targetid][pDivision]) {
                case 1: division = "None";
                case 2: division = "DET";
                case 3: division = "TE";
                case 4: division = "FTO";
                case 5: division = "SWAT";
                case 6: division = "IA";
                default: division = "None";
            }
        }
        case 2: {
            employer = "FBI";
            switch(PlayerInfo[targetid][pRank]) {
                case 1: rank = "Agent";
                case 2: rank = "Senior Agent";
                case 3: rank = "Special Agent";
                case 4: rank = "Supervisory Agent";
                case 5: rank = "Assistant Director";
                case 6: rank = "Director";
                default: rank = "Intern";
            }
            switch(PlayerInfo[targetid][pDivision]) {
                case 1: division = "None";
                case 2: division = "GU";
                case 3: division = "FAN";
                case 4: division = "CID";
                case 5: division = "IA";
                case 6: division = "NSB";
                default: division = "None";
            }
        }
        case 3: {
            employer = "LSFMD";

            switch(PlayerInfo[targetid][pRank]) {
                case 0: rank = "Probationary";
                case 1: rank = "EMT Intermediate";
                case 2: rank = "EMT Paramedic";
                case 3: rank = "Lieutenant";
                case 4: rank = "Captain";
                case 5: rank = "Deputy Chief";
                case 6: rank = "Chief";
                default: rank = "Volunteer";
            }
           
            switch(PlayerInfo[targetid][pDivision]) {
                case 1: division = "T&R";
                case 2: division = "LF";
                case 3: division = "FD";
                default: division = "None";
            }
        }
        case 4: {
            employer = "Hitman Agency";
            switch(PlayerInfo[targetid][pRank])
            {
                case 1: rank = "Freelancer";
                case 2: rank = "Marksman";
                case 3: rank = "Agent";
                case 4: rank = "Special Agent";
                case 5: rank = "Vice Director";
                case 6: rank = "Director";
                default: rank = "Freelancer";
            }
            division = "None";
        }
        case 5: {
            employer = "Government";
            switch(PlayerInfo[targetid][pRank]) {
                case 1: {
                    if(PlayerInfo[targetid][pDivision] == 5)
                        rank = "Intern";
                    else
                        rank = "Employee";
                }
                case 2: {
                    if(PlayerInfo[targetid][pDivision] == 5)
                        rank = "Bodyguard";
                    else
                        rank = "Public Advocate";
                }
                case 3: {
                    if(PlayerInfo[targetid][pDivision] == 5)
                        rank = "Agent";
                    else
                        rank = "Secretary";
                }
                case 4: {
                    if(PlayerInfo[targetid][pDivision] == 5)
                        rank = "Special Agent";
                    else
                        rank = "Councilor";
                }
                case 5: {
                    if(PlayerInfo[targetid][pDivision] == 5)
                        rank = "Head of Security";
                    else
                        rank = "Vice Mayor";
                }
                case 6: rank = "Mayor";
                default: rank = "Staff";
            }

            division = "None";
            switch(PlayerInfo[targetid][pDivision]) {
                case 1: division = "None";
                case 2: division = "Executive";
                case 3: division = "Judicial";
                case 4: division = "Legislative";
                case 5: division = "SS";
                default: division = "None";
            }
        }
        case 9: {
            employer = "SA News";
            switch(PlayerInfo[targetid][pRank]) {
                case 1: rank = "Intern";
                case 2: rank = "Local Journalist";
                case 3: rank = "Local Reporter";
                case 4: rank = "Network Anchor";
                case 5: rank = "Asst. Network Producer";
                case 6: rank = "Network Producer";
                default: rank = "Intern";
            }
           
            division = "None";
            switch(PlayerInfo[targetid][pDivision]) {
                case 1: division = "Security";
                default: division = "";
            }
        }
        default: { employer = "None"; division = "None"; rank = "None"; }
        }
        case 10: // Problem in this line
        {
            employer = "ARES";
            switch(PlayerInfo[targetid][pRank])
            {
                case 0: rank = "Probationary Agent";
                case 1: rank = "Agent";
                case 2: rank = "Special Agent";
                case 3: rank = "Liutenant";
                case 4: rank = "Captain";
                case 5: rank = "Deputy Director";
                case 6: rank = "Director";
                default: rank = "Probationary Agent";
            }
            switch(PlayerInfo[targetid][pDivision])
            {
                case 1: division = "IA";
                case 2: division = "ATT";
                case 3: division = "TAR";
                case 4: division = "FO";
            }
            default: division = "None";
            }
        }
    }
    return 1;
}
GetFactionName goes here

pawn Код:
stock GetFactionName(factionid) {
    new
        employer[64];
    switch(factionid) {
        case 1: employer = "LSPD";
        case 2: employer = "FBI";
        case 3: employer = "LSFMD";
        case 4: employer = "Hitman Agency";
        case 5: employer = "Government";
        case 9: employer = "SA News";
        case 10: employer = "ARES";
    }
    return employer;
}
Reply
#2

Try this

pawn Код:
case 9:
        {
            employer = "SA News";
            switch(PlayerInfo[targetid][pRank])
            {
                case 1: rank = "Intern";
                case 2: rank = "Local Journalist";
                case 3: rank = "Local Reporter";
                case 4: rank = "Network Anchor";
                case 5: rank = "Asst. Network Producer";
                case 6: rank = "Network Producer";
                default: rank = "Intern";
            }

            division = "None";
            switch(PlayerInfo[targetid][pDivision])
            {
                case 1: division = "Security";
                default: division = "";
            }
            default:
            {
                employer = "None"; division = "None"; rank = "None";
            }
        }
        case 10: // Problem in this line
        {
            employer = "ARES";
            switch(PlayerInfo[targetid]
Reply
#3

and this one too
pawn Код:
stock GetPlayerFactionInfo(targetid, rank[64], division[64], employer[64])
{
    switch(PlayerInfo[targetid][pFaction])
    {
        case 1:
        {
            employer = "LSPD";
            switch(PlayerInfo[targetid][pRank])
            {
                case 1: rank = "Officer";
                case 2: rank = "Corporal";
                case 3: rank = "Sergeant";
                case 4: rank = "Lieutenant";
                case 5: rank = "Captain";
                case 6: rank = "Chief";
                default: rank = "Cadet";
            }
            switch(PlayerInfo[targetid][pDivision])
            {
                case 1: division = "None";
                case 2: division = "DET";
                case 3: division = "TE";
                case 4: division = "FTO";
                case 5: division = "SWAT";
                case 6: division = "IA";
                default: division = "None";
            }
        }
        case 2:
        {
            employer = "FBI";
            switch(PlayerInfo[targetid][pRank]) {
                case 1: rank = "Agent";
                case 2: rank = "Senior Agent";
                case 3: rank = "Special Agent";
                case 4: rank = "Supervisory Agent";
                case 5: rank = "Assistant Director";
                case 6: rank = "Director";
                default: rank = "Intern";
            }
            switch(PlayerInfo[targetid][pDivision]) {
                case 1: division = "None";
                case 2: division = "GU";
                case 3: division = "FAN";
                case 4: division = "CID";
                case 5: division = "IA";
                case 6: division = "NSB";
                default: division = "None";
            }
        }
        case 3:
        {
            employer = "LSFMD";

            switch(PlayerInfo[targetid][pRank]) {
                case 0: rank = "Probationary";
                case 1: rank = "EMT Intermediate";
                case 2: rank = "EMT Paramedic";
                case 3: rank = "Lieutenant";
                case 4: rank = "Captain";
                case 5: rank = "Deputy Chief";
                case 6: rank = "Chief";
                default: rank = "Volunteer";
            }

            switch(PlayerInfo[targetid][pDivision]) {
                case 1: division = "T&R";
                case 2: division = "LF";
                case 3: division = "FD";
                default: division = "None";
            }
        }
        case 4:
        {
            employer = "Hitman Agency";
            switch(PlayerInfo[targetid][pRank])
            {
                case 1: rank = "Freelancer";
                case 2: rank = "Marksman";
                case 3: rank = "Agent";
                case 4: rank = "Special Agent";
                case 5: rank = "Vice Director";
                case 6: rank = "Director";
                default: rank = "Freelancer";
            }
            division = "None";
        }
        case 5:
        {
            employer = "Government";
            switch(PlayerInfo[targetid][pRank]) {
                case 1: {
                    if(PlayerInfo[targetid][pDivision] == 5)
                        rank = "Intern";
                    else
                        rank = "Employee";
                }
                case 2: {
                    if(PlayerInfo[targetid][pDivision] == 5)
                        rank = "Bodyguard";
                    else
                        rank = "Public Advocate";
                }
                case 3: {
                    if(PlayerInfo[targetid][pDivision] == 5)
                        rank = "Agent";
                    else
                        rank = "Secretary";
                }
                case 4: {
                    if(PlayerInfo[targetid][pDivision] == 5)
                        rank = "Special Agent";
                    else
                        rank = "Councilor";
                }
                case 5: {
                    if(PlayerInfo[targetid][pDivision] == 5)
                        rank = "Head of Security";
                    else
                        rank = "Vice Mayor";
                }
                case 6: rank = "Mayor";
                default: rank = "Staff";
            }

            division = "None";
            switch(PlayerInfo[targetid][pDivision]) {
                case 1: division = "None";
                case 2: division = "Executive";
                case 3: division = "Judicial";
                case 4: division = "Legislative";
                case 5: division = "SS";
                default: division = "None";
            }
        }
        case 9: {
            employer = "SA News";
            switch(PlayerInfo[targetid][pRank]) {
                case 1: rank = "Intern";
                case 2: rank = "Local Journalist";
                case 3: rank = "Local Reporter";
                case 4: rank = "Network Anchor";
                case 5: rank = "Asst. Network Producer";
                case 6: rank = "Network Producer";
                default: rank = "Intern";
            }

            division = "None";
            switch(PlayerInfo[targetid][pDivision]) {
                case 1: division = "Security";
                default: division = "";
            }
        }
        //default: { employer = "None"; division = "None"; rank = "None"; }
       
        case 10: // Problem in this line
        {
            employer = "ARES";
            switch(PlayerInfo[targetid][pRank])
            {
                case 0: rank = "Probationary Agent";
                case 1: rank = "Agent";
                case 2: rank = "Special Agent";
                case 3: rank = "Liutenant";
                case 4: rank = "Captain";
                case 5: rank = "Deputy Director";
                case 6: rank = "Director";
                default: rank = "Probationary Agent";
            }
            switch(PlayerInfo[targetid][pDivision])
            {
                case 1: division = "IA";
                case 2: division = "ATT";
                case 3: division = "TAR";
                case 4: division = "FO";
            }
            default: division = "None";
        }
        default: { employer = "None"; division = "None"; rank = "None"; }// ???????
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Quickie
Посмотреть сообщение
and this one too
I thought of the same, But i'm sure he have that default there because he wants to have it :P
Reply
#5

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

pawn Код:
case 9:
        {
            employer = "SA News";
            switch(PlayerInfo[targetid][pRank])
            {
                case 1: rank = "Intern";
                case 2: rank = "Local Journalist";
                case 3: rank = "Local Reporter";
                case 4: rank = "Network Anchor";
                case 5: rank = "Asst. Network Producer";
                case 6: rank = "Network Producer";
                default: rank = "Intern";
            }

            division = "None";
            switch(PlayerInfo[targetid][pDivision])
            {
                case 1: division = "Security";
                default: division = "";
            }
            default:
            {
                employer = "None"; division = "None"; rank = "None";
            }
        }
        case 10: // Problem in this line
        {
            employer = "ARES";
            switch(PlayerInfo[targetid]
Thankyou Rudy__ you're the best .
Only . I edited this Line

pawn Код:
switch(PlayerInfo[targetid]
Changed it to
pawn Код:
switch(PlayerInfo[targetid][pRank])
+Rep
Reply
#6

No problem but i'm sure you're doing something wrong here

pawn Код:
switch(PlayerInfo[targetid][pDivision])
            {
                case 1: division = "Security";
                default: division = ""; //Setting  division to empty, when case 1.
            }
            default: //When do you want to set them all to none? As i think this is not called anywhere
            {
                employer = "None"; division = "None"; rank = "None";
            }
Reply
#7

So how can i fix this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)