[HELP] Error 010: Invalid Function or Declaration
#1

Help?

Here's my code:
pawn Код:
stock GetPlayerFakeFactionInfo(targetid, rank[64], employer[64])
{
    switch (PlayerInfo[targetid][pFakeBadge]) // employer/rank/division data is pulled from here
    {
        case 1:
        {
            employer = "LSPD";
            switch(PlayerInfo[targetid][pFakeRank])
            {
                case 0: rank = "Cadet";
                case 1: rank = "Officer";
                case 2: rank = "Senior Officer";
                case 3: rank = "Sergeant";
                case 4: rank = "Lieutenant";
                case 5: rank = "Deputy Chief of Police";
                case 6: rank = "Chief of Police";
                default: rank = "Cadet";
            }
        }
        case 2:
        {
            employer = "FBI";
            switch(PlayerInfo[targetid][pFakeRank])
            {
                case 0: rank = "Intern";
                case 1: rank = "Agent";
                case 2: rank = "Senior Agent";
                case 3: rank = "Special Agent";
                case 4: rank = "Agent in Charge;
                case 5: rank = "
Deputy Director";
                case 6: rank = "
Director";
                default: rank = "
Intern";
            }
        }
        case 3:
        {
            employer = "
SASP";
            switch(PlayerInfo[targetid][pFakeRank])
            {
                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";
            }
        }
        case 4:
        {
            employer = "
FDSA";
            switch(PlayerInfo[targetid][pFakeRank])
            {
                case 1: rank = "
Paramedic";
                case 2: rank = "
Senior Paramedic";
                case 3: rank = "
Advanced Paramedic";
                case 4: rank = "
Captain";
                case 5: rank = "
Deputy Commissioner";
                case 6: rank = "
Commissioner";
                default: rank = "
Intermediate";
            }
        }
        case 5:
        {
            employer ="
Judicial System";
            switch(PlayerInfo[targetid][pFakeRank])
            {
            case 1: rank = "
Clerk of Court";
            case 2: rank = "
District Attorney";
            case 3: rank = "
District Judge";
            case 4: rank = "
Appellate Judge";
            case 5: rank = "
Associate Justice of the Supreme Court";
            case 6: rank = "
Chief Justice of the Supreme Court";
            default: rank = "
Clerk of Court";
            }
        }
        case 6:
        {
            employer = "
Government";
            switch(PlayerInfo[targetid][pFakeRank])
            {
                case 1: rank = "
Junior Staff";
                case 2: rank = "
General Staff";
                case 3: rank = "
Senior Staff";
                case 4: rank = "
Head of Staff";
                case 5: rank = "
Vice President";
                case 6: rank = "
President";
                default: rank = "
Junior Staff";
            }
        }
        case 7:
        {
            employer = "
SADPS";
            switch(PlayerInfo[targetid][pFakeRank])
            {
                case 0: rank = "
Corporal";
                case 1: rank = "
Corporal";
                case 2: rank = "
Sergent";
                case 3: rank = "
Lieutenant";
                case 4: rank = "
Captain";
                case 5: rank = "
Commander";
                case 6: rank = "
Sherriff";
                default: rank = "
Corporal";
            }
        }
        case 9:
        {
            employer ="
SANews";
            switch(PlayerInfo[targetid][pFakeRank])
            {
                case 1: rank = "
Local Reporter";
                case 2: rank = "
Local Editor";
                case 3: rank = "
Network Anchor";
                case 4: rank = "
Network Editor";
                case 5: rank = "
Asst. Network Producer";
                case 6: rank = "
Network Producer";
                default: rank = "
Intern";
            }
        }
        case 11:
        {
            employer = "
National Guard";
            switch(PlayerInfo[targetid][pFakeRank])
            {
                case 0: rank= "
Private";
                case 1: rank = "
Corporal";
                case 2: rank = "
Sergeant";
                case 3: rank = "
Lieutenant";
                case 4: rank = "
Captain";
                case 5: rank = "
Major";
                case 6: rank = "
General";
                default: rank = "
Private";
            }
        }
        case 12:
        {
            employer = "
NOOSE";
            {
                switch(PlayerInfo[targetid][pFakeRank])
                {
                    case 0: rank = "
Ensign";
                    case 1: rank = "
Marksman";
                    case 2: rank = "
Elite Marksman";
                    case 3: rank = "
Operative";
                    case 4: rank = "
Elite Operative";
                    case 5: rank = "
Vice Commander";
                    case 6: rank = "
Supreme Commander";
                    default: rank = "
Ensign";
                }
            }
        }
        default: { employer = "
None"; rank = "N/A"; }
    }
    return 1;
}
pawn Код:
C:\Users\Mike\Desktop\UGRP\gamemodes\UGRP.pwn(6451) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Thanks in advance.
Reply
#2

In stocks arrays mustn't be with the size, do []
Reply
#3

Quote:
Originally Posted by kamiliuxliuxliux
Посмотреть сообщение
In stocks arrays mustn't be with the size, do []
That actually gave me 26 errors..
Reply
#4

'Cuz look at your code. You're missing one "
Reply
#5

Quote:
Originally Posted by kamiliuxliuxliux
Посмотреть сообщение
'Cuz look at your code. You're missing one "
I'll see.
Reply
#6

Quote:
Originally Posted by kamiliuxliuxliux
Посмотреть сообщение
'Cuz look at your code. You're missing one "
Hey, thank you! That actually solved it. +REP'd.
Reply
#7

Well, this is a new code:
pawn Код:
CMD:hshowbadge(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
    {
        new string[128], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hshowbadge [playerid]");

        if(giveplayerid != INVALID_PLAYER_ID) {
            if(ProxDetectorS(5.0, playerid, giveplayerid)) {

                switch(PlayerInfo[playerid][pFakeBadge]) {
                case 1 .. 4, 5, 6, 7, 9, 11, 12: {

                        new
                         infoArrays[3][64];

                        GetPlayerFakeFactionInfo(playerid, infoArrays[0], infoArrays[1]);

                        SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
                        format(string, sizeof(string), "%s %s is a duly sworn member of the %s.", infoArrays[0], GetPlayerNameEx(playerid), infoArrays[1]);
                        SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
                        SendClientMessageEx(giveplayerid, COLOR_WHITE, "Current Assignment: General Duties.");
                        switch(PlayerInfo[playerid][pFakeBadge]) {
                        case 1: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the City of Los Santos.");
                        case 2: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the United States Government.");
                        case 3: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the United States Government.");
                        case 12: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the Nation of United States Government.");
                        default: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the State of San Andreas.");
                        }
                        if(PlayerInfo[playerid][pMember] != 6 && PlayerInfo[playerid][pMember] != 12) SendClientMessageEx(giveplayerid, COLOR_WHITE, "Official has the authority to arrest.");
                        else if(PlayerInfo[playerid][pMember] == 12) SendClientMessageEx(giveplayerid, COLOR_WHITE, "Official has the authority to arrest.");
                        else SendClientMessageEx(giveplayerid, COLOR_WHITE, "Official has the authority to assist in arrests.");
                        SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
                        format(string, sizeof(string), "* %s shows their badge to %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        }
                default: SendClientMessageEx(playerid, COLOR_WHITE, "You do not have a fake badge enabled.");
                }
            }
            else SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
        }
        else SendClientMessageEx(playerid, COLOR_WHITE, "You do not have a fake badge enabled.");
    }
    return 1;
}
Errors I am getting:
pawn Код:
C:\Users\3ug3n1cz\Desktop\NGG\gamemodes\UGRP.pwn(6305) : error 029: invalid expression, assumed zero
C:\Users\3ug3n1cz\Desktop\NGG\gamemodes\UGRP.pwn(6320) : error 029: invalid expression, assumed zero
C:\Users\3ug3n1cz\Desktop\NGG\gamemodes\UGRP.pwn(6335) : error 029: invalid expression, assumed zero
C:\Users\3ug3n1cz\Desktop\NGG\gamemodes\UGRP.pwn(6349) : error 029: invalid expression, assumed zero
C:\Users\3ug3n1cz\Desktop\NGG\gamemodes\UGRP.pwn(6363) : error 029: invalid expression, assumed zero
C:\Users\3ug3n1cz\Desktop\NGG\gamemodes\UGRP.pwn(6377) : error 029: invalid expression, assumed zero
C:\Users\3ug3n1cz\Desktop\NGG\gamemodes\UGRP.pwn(6391) : error 029: invalid expression, assumed zero
C:\Users\3ug3n1cz\Desktop\NGG\gamemodes\UGRP.pwn(6406) : error 029: invalid expression, assumed zero
C:\Users\3ug3n1cz\Desktop\NGG\gamemodes\UGRP.pwn(6420) : error 029: invalid expression, assumed zero
C:\Users\3ug3n1cz\Desktop\NGG\gamemodes\UGRP.pwn(6436) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


10 Errors.
Reply
#8

Bumping..
Reply
#9

Anyone?
Reply
#10

Mark the lines with errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)