Imam robstore da mozes da pljackas banku i 24/7 ali moze neko da stavi da moze da se pljacka banka na svaka 6h i 24/7 na svaka 3h
/* /robstore command
thought of and scripted
by jazoj xD */
//==============================================================================
#include <a_samp>
#define Grey 0xAFAFAFAA
#define Red 0xFF6347AA
#define Yellow 0xFFFF00A
#define robumont 20000
new StoreRobed[MAX_PLAYERS];
new Robber[MAX_PLAYERS];
new have[MAX_PLAYERS];
new rob;
new rob1;
new rob2;
new rob3;
new rob4;
new robbing;
new wait;
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
forward StoreRob1();
forward StoreRob2();
forward StoreRob3();
forward RobAgain();
forward RobWait();
forward medd();
//=====================================================================================================
public OnFilterScriptInit()
{
robbing = 0;
print(" Ucitavanje /pljackaj komande ");
SetTimer("RobAgain2",1800000,1);
rob4 = SetTimer("medd", 1000, 1);
return 1;
}
public OnFilterScriptExit()
{
print(" Izcitavanje /pljackaj komande ");
KillTimer(rob4);
return 1;
}
public OnPlayerConnect(playerid)
{
StoreRobed[playerid] = 0;
Robber[playerid] = 0;
have[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/pljackaj", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(20, playerid, -28.4819,-89.3805,1003.5469))
{
}
else
{
SendClientMessage(playerid, Red,"Moras biti u marketu 24/7 da bi ga opljackao!");
return 1;
}
if (wait == 1)
{
SendClientMessage(playerid, Red,"Market je vec opljackan ! Pokusaj kasnije !");
return 1;
}
if (robbing == 1)
{
SendClientMessage(playerid, Red,"Neko trenutno pljacka market !");
return 1;
}
if(StoreRobed[playerid] == 0)
{
SendClientMessageToAll(Red,"Prodavnica je opljackana !!");
SendClientMessage(playerid, Yellow,"Poceo si pljackati prodavnicu , policija traga za tobom !");
SendClientMessage(playerid, Red,"Ostani u prodavnici 1 minut da bi pokupio novac !");
Robber[playerid] = 1;
robbing = 1;
StoreRobed[playerid] =1;
rob = SetTimer("StoreRob1", 20000, 1);
}
return 1;
}
return 0;
}
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
public StoreRob1()
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(Robber[i] == 1)
{
if(PlayerToPoint(30, i, -28.4819,-89.3805,1003.5469))
{
SendClientMessage(i, Yellow," 20 sekundi je proslo ");
KillTimer(rob);
rob1 = SetTimer("StoreRob2",20000,1);
return 1;
}
else
{
SendClientMessage(i, Grey,"Trci, trci, ne dozvoli da te policija uhvati");
rob3 = SetTimer("RobWait",90000,1);
StoreRobed[i] =0;
Robber[i] = 0;
robbing = 0;
wait = 1;
KillTimer(rob);
return 1;
}
}
return 1;
}
public StoreRob2()
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(Robber[i] == 1)
{
if(PlayerToPoint(30, i, -28.4819,-89.3805,1003.5469))
{
SendClientMessage(i, Yellow," 40 sekundi je proslo");
KillTimer(rob1);
rob2 = SetTimer("StoreRob3",20000,1);
return 1;
}
else
{
SendClientMessage(i, Grey,"Trci, trci, ne dozvoli da te policija uhvati");
rob3 = SetTimer("RobWait",90000,1);
StoreRobed[i] =0;
Robber[i] = 0;
robbing = 0;
wait = 1;
KillTimer(rob1);
return 1;
}
}
return 1;
}
public StoreRob3()
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(Robber[i] == 1)
{
if(PlayerToPoint(30, i, -28.4819,-89.3805,1003.5469))
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(i, pname, sizeof(pname));
new pcash = robumont;
new robcash = random(pcash);
new string[256];
GetPlayerName(i, pname, sizeof(pname));
format(string, sizeof(string), "Opljackao si prodavnicu, i ukrao si $%d", robcash);
SendClientMessage(i, Yellow, string);
GivePlayerMoney(i,robcash);
StoreRobed[i] =0;
Robber[i] = 0;
robbing = 0;
wait = 1;
rob3 = SetTimer("RobWait",90000,1);
KillTimer(rob2);
return 1;
}
else
{
SendClientMessage(i, Grey,"Trci, trci, ne dozvoli da te policija uhvati");
rob3 = SetTimer("RobWait",90000,1);
StoreRobed[i] =0;
Robber[i] = 0;
robbing = 0;
wait = 1;
KillTimer(rob2);
return 1;
}
}
return 1;
}
public RobWait()
{
wait = 0;
KillTimer(rob3);
}
public medd()
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(PlayerToPoint(30, i, -28.4819,-89.3805,1003.5469))
{
if(have[i] == 0)
{
SendClientMessage(i, Yellow,"Mozes opljackati ovaj market, kucaj /pljackaj !");
have[i] = 1;
}
}
else
{
have[i] = 0;
if(Robber[i] == 1)
{
SendClientMessage(i, Grey,"Trci, trci, ne dozvoli da te policija uhvati");
rob3 = SetTimer("RobWait",90000,1);
StoreRobed[i] =0;
Robber[i] = 0;
robbing = 0;
wait = 1;
KillTimer(rob2);
}
}
return 1;
}
public RobAgain()
{
for(new i = 0; i < MAX_PLAYERS; i++)
StoreRobed[i] =0;
}
Nauci Pravila...:S..
Ja mislim da je to ovaj timer koje je za to cekanje
rob3 = SetTimer("RobWait",90000,1);
E sada ti stavis ovako ali nisam siguran ali mislim da je to taj timer 6h ti je 21600 sekundi znaci posto se radi o milisekundama, a mili je 10 na -3 dodajemo jos 3 nule i to dodje 21600000
rob3 = SetTimer("RobWait",21600000,1);
Ti mozes da pritisnes CRTL i H i gore upises rob3 = SetTimer("RobWait",90000,1); a dole upises rob3 = SetTimer("RobWait",21600000,1); i onda samo ides yes to all i zamenice sa svima.
Procitaj pravila kako se posta u ovom pdf ;)