Bank Robbery!!
#1

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(playeridparams[])
{
    
#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(playeridCOLOR_ERROR"You Cannot Use This Command In Jail.");
    return 
1;
    }
    if(
PlayerInfo[playerid][pAJailed] == 1)
    {
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command In Jail.");
    return 
1;
    }
    if(
PlayerInfo[playerid][pHoldup] > 0)
    {
    
SendClientMessage(playeridCOLOR_ERROR"You Are Currently Robbing The Bank.  Exit The Checkpoint To End The BankRob.");
    return 
1;
    }
    if(
PlayerInfo[playerid][pHoldupWaitTime] > 0)
    {
    
SendClientMessage(playeridCOLOR_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(playeridCOLOR_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"0128128);
    
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.0000001);
    
SendClientMessage(playeridCOLOR_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"50003);
    
SetPlayerScore(playerid,GetPlayerScore(playerid) + 1);
    
format(stringsizeof(string), "Crime: Robbery In Progress");
    
ReportCrimeTOPolice(playerid,string);
    
SetPlayerWantedStats(playerid,"Robbery");
    }else{
    
format(stringsizeof(string), "You Can Only Rob The Bank In %s While Playing %s.",ServerInfo[sMapName],ServerInfo[sMapName]);
    
SendClientMessage(playeridCOLOR_ERRORstring);
    }
    }else{
    
SendClientMessage(playeridCOLOR_ERROR"You Must Be Inside A Bank To Begin A Robbery.");
    }
    }else{
    
SendClientMessage(playeridCOLOR_ERROR"Law Enforcement Agents Cannot Rob Places.");
    }
    }else{
    
SendClientMessage(playeridCOLOR_ERROR"You Cannot Use This Command When You're Dead.");
    }
    return 
1;

Reply
#2

you should give more code (code which checks is player in checkpoint)
Reply
#3

I have
PHP код:
if (IsPlayerInGamemodeArea(playerid)) 
in the script or Ifplayerinpoint
Reply
#4

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)