error...invalid function or declaration..:/ -
Ritzy2K - 23.12.2014
m getting error at lines 25264 and 25268...
Line 25264 -
}else{
Line 25268-
return 1;
Here goes a bit total of it -
}else{
SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command When You're Dead.");
}
return 1;
}
these are the errors
(25264) : error 010: invalid function or declaration
(2526
: error 010: invalid function or declaration
Help Meee
Re: error...invalid function or declaration..:/ -
AdHaM612 - 23.12.2014
Paste some lines before line 25264.
Re: error...invalid function or declaration..:/ -
Ritzy2K - 23.12.2014
dcmd_bankrob(playerid, params[])
{
#pragma unused params
if (PlayerInfo[playerid][pSpawn] == 1){
if (PlayerInfo[playerid][pTeam] == TEAM_CIVILIAN && PlayerInfo[playerid][pVigilante] == 0){
new string[256];
if (GetPlayerVirtualWorld(playerid) > 0)
{
new Houseid = PlayerInfo[playerid][pCheckpoint];
/*if (PlayerInfo[playerid][pWantedLevel] > 0)
{
SendClientMessage(playerid,COLOR_ERROR, "You Must Be Innocent To Begin A Holdup.");
return 1;
}*/
if(PlayerInfo[playerid][pJailed] == 1)
{
SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command In Jail.");
return 1;
}
if(PlayerInfo[playerid][pAJailed] == 1)
{
SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command In Jail.");
return 1;
}
if(PlayerInfo[playerid][pHoldup] > 0)
{
SendClientMessage(playerid, COLOR_ERROR, "You Are Currently Robbing The Store. Exit The Checkpoint To End The Holdup.");
return 1;
}
if(PlayerInfo[playerid][pHoldupWaitTime] > 0)
{
SendClientMessage(playerid, COLOR_ERROR, "Please Wait Before Robbing A Store Again.");
return 1;
}
if (HouseData[Houseid][h_RobWaitTime] > 0)
{
//You Cannot Rob This Store Twice In A Row.
//The Xoomer Gas Station Has Been Robbed Recently. Try Again Later.
SendClientMessage(playerid, COLOR_ERROR, "This Location Has Been Robbed Recently. Try Again Later.");
return 1;
}
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);
}
}else{
SendClientMessage(playerid, COLOR_ERROR, "You Must Be Inside A Bank To Begin A Robbery.");
}
}else{
SendClientMessage(playerid, COLOR_ERROR, "Law Enforcement Agents Cannot Rob Places.");
}
}else{
SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command When You're Dead.");
}
return 1;
}
Re: error...invalid function or declaration..:/ -
Threshold - 24.12.2014
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.