Close something - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Close something (
/showthread.php?tid=75237)
Close something -
Justsmile - 30.04.2009
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
Re: Close something -
Andom - 30.04.2009
Top of your script:
When somebody is robbing:
When somebody is done with robbing:
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.");
}
Re: Close something -
Justsmile - 30.04.2009
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?
Re: Close something -
Think - 30.04.2009
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
Re: Close something -
Justsmile - 30.04.2009
how can i make a checkpoint for cops where the gas station robber is? thanks
Re: Close something -
Justsmile - 30.04.2009
I need helpt pls.