Close something
#1

Hello,

I have got on Question. For Example:
Guy one rob the Bank, and Guy two wants to Rob two, but the bank is robbed by guy one. How can I script this
Reply
#2

Top of your script:
pawn Code:
new BankIsRobbed;
When somebody is robbing:
pawn Code:
BankIsRobbed = 1;
When somebody is done with robbing:
pawn Code:
BankIsRobbed = 0;
When somebody wants to rob (/rob or something?)
pawn Code:
if(BankIsRobbed == 0)
{
  // Here your rob code
}
else
{
  SendClientMessage(playerid, COLOR_RED, "The bank is already being robbed by some guy.");
}
Reply
#3

Ok thats good. But I have the gas station how can I do it there. That every Gas Station have got another robtime. for example:
A robb gas station 1 b cant ( you knwo), Then A cant rob gas station 2. You understand?
Reply
#4

Quote:
Originally Posted by Justsmile
Ok thats good. But I have the gas station how can I do it there. That every Gas Station have got another robtime. for example:
A robb gas station 1 b cant ( you knwo), Then A cant rob gas station 2. You understand?
just edit some codes.. and make it like this:

pawn Code:
forward UnRob(id);

new Places[2][3] = {
{X,Y,Z}, // This one would be ID 0
{X,Y,Z} // This one would be ID 1
};

new BankIsRobbed[sizeof(Places)];

for(new i=0;i<SizeOf(places);i++)
{
if(playertopoint(10.0, playerid, Places[i][0], Places[i][1], Places[i][2])
{
if(BankIsRobbed[i] == 0)
{
   // Here your rob code
   BankIsRobbed[i] = 1;
   SetTimerEx("UnRob", 30000, false, "d", i);
}
else
{
   SendClientMessage(playerid, COLOR_RED, "The bank is already being robbed by some guy.");
}

public UnRob(id)
{
 BankIsRobbed[id] = 0;
}

something like that, this is just an extension on Andom's code, so play with it a littlebit
Reply
#5

how can i make a checkpoint for cops where the gas station robber is? thanks
Reply
#6

I need helpt pls.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)