Bank Robbery Hideouts
#1

Hello so i have a system in which when you rob a bank or casino you have to go to the hideout or a specific place to get the money it works fine but how to switch the Checkpoints/Places randomly that 1st time it sets your CP to Red County and next time some other place it switch's place randomly can anybody help
My Code:
PHP код:
switch (CURRENT_GAMEMODE)
                
                    case 
LOS_SANTOS:
                    {
                    
SetPlayerRaceCheckpoint(i21105.455688, -306.72000173.9921870.00.00.0,4);//Robbery Hide Out in Hilltop Farm
                    
strmid(PlayerInfo[i][pHideout], "Hilltop Farm"0256256);
                    
                    
PlayerInfo[i][pGPSX] = 1105.455688;
                    
PlayerInfo[i][pGPSY] = -306.720001;
                    
PlayerInfo[i][pGPSZ] = 73.992187;
                    
PlayerInfo[i][pGPS] = 1;
                    
                    } 
Reply
#2

How is CURRENT_GAMEMODE declared? Judging by your code, you should be able to simply add this code above your switch:
pawn Код:
new iCurrentGamemode = random(40) + 1; // Replace 40 with the amount of gamemodes you have
For your switch, replace the CURRENT_GAMEMODE variable to iCurrentGamemode inside the brackets of your switch code.

I may not fully understand the context of your code, but I believe this is what you asked for? Each case represents a new location which a bank robbery can take place at.
Reply
#3

It's Like this

PHP код:
switch (CURRENT_GAMEMODE)
                {
                    case 
LOS_SANTOS:
                    {
                    
SetPlayerRaceCheckpoint(i21105.455688, -306.72000173.9921870.00.00.0,4);//Robbery Hide Out in Hilltop Farm
                    
strmid(PlayerInfo[i][pHideout], "Hilltop Farm"0256256);
                    
PlayerInfo[i][pGPSX] = 1105.455688;
                    
PlayerInfo[i][pGPSY] = -306.720001;
                    
PlayerInfo[i][pGPSZ] = 73.992187;
                    
PlayerInfo[i][pGPS] = 1;
                    }
                    case 
LAS_VENTURAS:
                    {
                    
SetPlayerRaceCheckpoint(i2, -154.0400542727.95922861.9065620.00.00.0,4);//Robbery Hide Out in Las Payasadas
                    
strmid(PlayerInfo[i][pHideout], "Las Payasadas"0256256);
                    
PlayerInfo[i][pGPSX] = -154.040054;
                    
PlayerInfo[i][pGPSY] = 2727.959228;
                    
PlayerInfo[i][pGPSZ] = 61.906562;
                    
PlayerInfo[i][pGPS] = 1;
                    }
                    case 
SAN_FIERRO:
                    {
                    
SetPlayerRaceCheckpoint(i2,-2078.076660, -2555.93798830.4218750.00.00.0,4);//Robbery Hide Out in Angel Pine
                    
strmid(PlayerInfo[i][pHideout], "Angel Pine"0256256);
                    
PlayerInfo[i][pGPSX] = -2078.076660;
                    
PlayerInfo[i][pGPSY] = -2555.937988;
                    
PlayerInfo[i][pGPSZ] = 30.421875;
                    
PlayerInfo[i][pGPS] = 1;
                    }
                } 
Reply
#4

Nope i tryedbut didn't work..... Anything else?
Reply
#5

Bump Anyone ?
Reply
#6

This is the code if anyone can help me?
PHP код:
case MISSION_TYPE_BANK_ROBBERY_1:
                {
                if (
PlayerInfo[i][pHoldup] > 0)
                {
                
/*if (PlayerInfo[i][pHoldup] > 70)
                {
                PlayerInfo[i][pHoldup] --;
                //GameTextForPlayer(i,"~w~ROBBERY IN PROGRESS~n~~y~STAY IN THE~n~~r~RED CHECKPOINT", 5000, 3);
                //}//OPENING SAFE
                if (PlayerInfo[i][pHoldup] == 70 || PlayerInfo[i][pHoldup] == 65 || PlayerInfo[i][pHoldup] == 60 || PlayerInfo[i][pHoldup] == 55 || PlayerInfo[i][pHoldup] == 50 || PlayerInfo[i][pHoldup] == 45
                || PlayerInfo[i][pHoldup] == 40 || PlayerInfo[i][pHoldup] == 35 || PlayerInfo[i][pHoldup] == 30 || PlayerInfo[i][pHoldup] == 25 || PlayerInfo[i][pHoldup] == 20 || PlayerInfo[i][pHoldup] == 15 || PlayerInfo[i][pHoldup] == 10 || PlayerInfo[i][pHoldup] == 5)
                {
                PlayerInfo[i][pHoldupAmount] += RobberyCash;
                }*/
                
if (PlayerInfo[i][pHoldup] > 2)// && PlayerInfo[i][pHoldup] <= 70
                
{
                
PlayerInfo[i][pHoldup] --;
                
//format(string, sizeof(string), "~w~ROBBERY IN PROGRESS~n~~y~ROBBED $%d",PlayerInfo[i][pHoldupAmount]);
                //GameTextForPlayer(i,string, 5000, 3);
                
GameTextForPlayer(i,"~w~ROBBERY IN PROGRESS~n~~y~STAY IN THE~n~~r~RED CHECKPOINT"50003);
                
PlayerInfo[i][pHoldupAmount] += random(5000) + random(500) + random(500) + random(5000) + random(5000);
                }
                if (
PlayerInfo[i][pHoldup] == 2)
                {
                 new 
Houseid PlayerInfo[i][pLastOutSideID];
                
                
                
HouseData[Houseid][h_Robberies] ++;
                
HouseData[Houseid][h_RobWaitTime] = 300;
                
PlayerInfo[i][pHoldupWaitTime] = 500;
                
format(stringsizeof(string), "%s",HouseInfo[Houseid][h_HouseIntName]);
                
strmid(PlayerInfo[i][pHoldupVictim], string0128128);
                
//Bank = strval(tmp);
                //if (Bank < 1 || Bank > 2)
                //{
                //SendClientMessage(i, COLOR_ERROR, "Enter A Sit Style 1 - 10");
                //return 1;
                //}
                
switch (CURRENT_GAMEMODE)
                {
                    case 
LOS_SANTOS:
                    {
                    
SetPlayerRaceCheckpoint(i21105.455688, -306.72000173.9921870.00.00.0,4);//Robbery Hide Out in Hilltop Farm
                    
strmid(PlayerInfo[i][pHideout], "Hilltop Farm"0256256);
                    
PlayerInfo[i][pGPSX] = 1105.455688;
                    
PlayerInfo[i][pGPSY] = -306.720001;
                    
PlayerInfo[i][pGPSZ] = 73.992187;
                    
PlayerInfo[i][pGPS] = 1;
                    }
                    case 
LAS_VENTURAS:
                    {
                    
SetPlayerRaceCheckpoint(i2, -154.0400542727.95922861.9065620.00.00.0,4);//Robbery Hide Out in Las Payasadas
                    
strmid(PlayerInfo[i][pHideout], "Las Payasadas"0256256);
                    
                    
PlayerInfo[i][pGPSX] = -154.040054;
                    
PlayerInfo[i][pGPSY] = 2727.959228;
                    
PlayerInfo[i][pGPSZ] = 61.906562;
                    
PlayerInfo[i][pGPS] = 1;
                    }
                    case 
SAN_FIERRO:
                    {
                    
SetPlayerRaceCheckpoint(i2,-2078.076660, -2555.93798830.4218750.00.00.0,4);//Robbery Hide Out in Angel Pine
                    
strmid(PlayerInfo[i][pHideout], "Angel Pine"0256256);
                    
PlayerInfo[i][pGPSX] = -2078.076660;
                    
PlayerInfo[i][pGPSY] = -2555.937988;
                    
PlayerInfo[i][pGPSZ] = 30.421875;
                    
PlayerInfo[i][pGPS] = 1;
                    }
                }
                
GameTextForPlayer(i,"~y~BRING THE SAFE TO THE~n~~r~RED CHECKPOINT"50003);
                 
ShowTextDrawMenu(iTD_MENU_INFO,"~g~Bank Robbery"80);
                
format(stringsizeof(string), "~w~You Have Successfully Robbed The Safe~n~From ~p~%s~n~~w~Bring The Safe To Your Hideout In ~p~%s~n~Enter The ~r~Checkpoint ~w~To Collect The Money~n~~w~You Have ~g~4 Hours ~w~To Reach Your Hideout",PlayerInfo[i][pHoldupVictim],PlayerInfo[i][pHideout]);//~n~~w~Loose The ~b~Police ~w~To Lower Your Wanted Level~n~~w~Press ~y~2 ~w~For Robbery Information
                
ShowTextDrawMenuItems(i0string" "" ",0);
                    
                
TextDrawSetString(StatsDisplay[i], "~b~Bank Robbery ~w~- ~g~Get To Hideout");
                
TextDrawShowForPlayer(iStatsDisplay[i]);
                
//format(string, sizeof(string), "Crime: Robbery");
                //ReportCrimeTOPolice(i,string);
                
PlayerInfo[i][pHoldupHour] = 4;
                
PlayerInfo[i][pHoldupMinute] = 0;
                
PlayerInfo[i][pHoldup] = 1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)