error...invalid function or declaration..:/
#4

pawn Код:
dcmd_bankrob(playerid, params[])
{
    #pragma unused params
    if(!PlayerInfo[playerid][pSpawn]) return SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command When You're Dead.");
    if(PlayerInfo[playerid][pTeam] != TEAM_CIVILIAN || PlayerInfo[playerid][pVigilante]) return SendClientMessage(playerid, COLOR_ERROR, "Law Enforcement Agents Cannot Rob Places.");
    if(!GetPlayerVirtualWorld(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You Must Be Inside A Bank To Begin A Robbery.");
    //if(PlayerInfo[playerid][pWantedLevel]) return SendClientMessage(playerid,COLOR_ERROR, "You Must Be Innocent To Begin A Holdup.");
    if(PlayerInfo[playerid][pJailed] || PlayerInfo[playerid][pAJailed]) return SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command In Jail.");
    if(PlayerInfo[playerid][pHoldup]) return SendClientMessage(playerid, COLOR_ERROR, "You Are Currently Robbing The Store. Exit The Checkpoint To End The Holdup.");
    if(PlayerInfo[playerid][pHoldupWaitTime]) return SendClientMessage(playerid, COLOR_ERROR, "Please Wait Before Robbing A Store Again.");
    new Houseid = PlayerInfo[playerid][pCheckpoint];
    if(HouseData[Houseid][h_RobWaitTime]) return SendClientMessage(playerid, COLOR_ERROR, "This Location Has Been Robbed Recently. Try Again Later.");
    HouseData[Houseid][h_RobWaitTime] = 60;
    PlayerInfo[playerid][pHoldup] = 30;
    PlayerInfo[playerid][pHoldupWaitTime] = 60;
    PlayerInfo[playerid][pHoldupAmount] = 0;
    strmid(PlayerInfo[playerid][pHoldupVictim], "The Bank", 0, 128, 12;
    PlayerInfo[playerid][pWantedLevel] = 6;
    PlayerInfo[playerid][pRobberies] ++;
    HideTextDrawMenu(playerid);
    PlayerInfo[playerid][pMission] = MISSION_TYPE_BANK_ROBBERY_1;
    PlayerInfo[playerid][pRaceCheckpoint] = 0;

    ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 3.0, 0, 0, 0, 0, 0, 1);
    SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, "Beginning Bank Robbery... Exit The Checkpoint To End The Robbery.");
    GameTextForPlayer(playerid,"~w~BEGINNING ROBBERY~n~~y~STAY IN THE~n~~r~RED CHECKPOINT", 5000, 3);
    SetPlayerScore(playerid,GetPlayerScore(playerid) + 1);
    format(string, sizeof(string), "Crime: Robbery In Progress");
    ReportCrimeTOPolice(playerid,string);
    SetPlayerWantedStats(playerid,"Robbery");
    /*
    else
    {
        format(string, sizeof(string), "You Can Only Rob The Bank In %s While Playing %s.",ServerInfo[sMapName],ServerInfo[sMapName]);
        SendClientMessage(playerid, COLOR_ERROR, string);
    }*/

    return 1;
}
Both of these statements:
pawn Код:
}else{
format(string, sizeof(string), "You Can Only Rob The Bank In %s While Playing %s.",ServerInfo[sMapName],ServerInfo[sMapName]);
SendClientMessage(playerid, COLOR_ERROR, string);
}

}else{
SendClientMessage(playerid, COLOR_ERROR, "You Must Be Inside A Bank To Begin A Robbery.");
}
Had closing braces corresponding to this 'if' statement:
pawn Код:
if (GetPlayerVirtualWorld(playerid) > 0)
{
Meaning you had too many closing braces and unmatched 'else' statements. Giving you this error.
Reply


Messages In This Thread
error...invalid function or declaration..:/ - by Ritzy2K - 23.12.2014, 10:32
Re: error...invalid function or declaration..:/ - by AdHaM612 - 23.12.2014, 10:41
Re: error...invalid function or declaration..:/ - by Ritzy2K - 23.12.2014, 10:46
Re: error...invalid function or declaration..:/ - by Threshold - 24.12.2014, 13:58

Forum Jump:


Users browsing this thread: 1 Guest(s)