Rob Bank - 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)
+--- Thread: Rob Bank (
/showthread.php?tid=430150)
Rob Bank -
Zumba - 12.04.2013
How to make cmd in ZCMD for robing bank, to rob on some coordinates and when to start robing first to wait 2minutes and then to give player money, i want to make go give player random money and when start robing to send message to other players that bank is robing, also to setplayer wanted level and bank can be robed every 3hours.
How to make this because am begginer ?
Re: Rob Bank -
zDivine - 12.04.2013
pawn Код:
new RobBankAble = 3;
new RobbingBank[MAX_PLAYERS] = 120;
pawn Код:
CMD:robbank(playerid, params[])
{
if(RobBankAble == 0)
{
RobbingBank[playerid] = 120;
SendClientMessageToAll(-1, "The bank is being robbed.");
}
}
Using YSI\y_timers:
pawn Код:
timer BankRobTimer[1000]()
{
for(new i; i < MAX_PLAYERS; i++)
{
if(RobbingBank[i] > 0)
{
RobbingBank[i]--;
}
}
}
timer BankHourWait[3600]()
{
if(RobBankAble > 0)
{
RobBankAble--;
}
}
This is just a basic setup, I won't give you all the code straight up, you need to figure a little bit out on your own. Hope this helps.
Re: Rob Bank -
Zumba - 12.04.2013
What mean 180 and 120 ? and i dont know how to setplayerwanted level an how to make random money /?
Re: Rob Bank -
zDivine - 12.04.2013
Quote:
Originally Posted by Zumba
What mean 180 and 120 ? and i dont know how to setplayerwanted level an how to make random money /?
|
You mean 3 and 120? And those are just integers assigned to the variables. They are set to decrease with the timers.
3 is interpreted as 3 hours.
120 is interpreted as 120 seconds.
The random money is in the timer, take a look.
Use:
pawn Код:
SetPlayerWantedLevel(playerid, level);