25.01.2014, 06:36
Hey guys i want to show you that when i starts to rob a bank it starts fine but when the time is over it says go to the hideout to crack the safe and it randomly gives a Checkpoint but the problem is when i leave the Checkpoint of bank it says failed robbery can u tell me whats wrong here is the code
PHP код:
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 (IsPlayerInGamemodeArea(playerid))
{
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 Bank. Exit The Checkpoint To End The BankRob.");
return 1;
}
if(PlayerInfo[playerid][pHoldupWaitTime] > 0)
{
SendClientMessage(playerid, COLOR_ERROR, "Please Wait Before Robbing The Bank 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, "The Bank Has Been Robbed Recently. Try Again Later.");
return 1;
}
HouseData[Houseid][h_RobWaitTime] = 30;
PlayerInfo[playerid][pHoldup] = 30;
PlayerInfo[playerid][pHoldupWaitTime] = 30;
PlayerInfo[playerid][pHoldupAmount] = 0;
strmid(PlayerInfo[playerid][pHoldupVictim], "The Bank", 0, 128, 128);
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;
}