help with rob system - 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: help with rob system (
/showthread.php?tid=563897)
help with rob system -
1fret - 18.02.2015
Im making a cop and robbers server and i just start making the stores that can be robbed but i have a small problem.
Can someone tell me how to make this
http://i.imgur.com/XjAsDNV.png?1
It works like this the player stands in a checkpoint and type /robstore then that comes up and start counting from 15 secs(shown at the bottom) and at robbed(shown at the top) it shows how much money you robbed withing the 15seconds and in the middile it gives an estimated amount that can be robbed within the 15 seconds and at the top it tells the name of the place being robbed.
If anyone knows how to do it can you show me like an example of the code are like leave a link to an tutorial so i can see how to do it.
Re: help with rob system -
Ritzy2K - 18.02.2015
That image is a textdraw man.
Re: help with rob system -
1fret - 18.02.2015
Quote:
Originally Posted by DopeX
That image is a textdraw man.
|
I know that buddy, but i want to know how to make a robbing system like that.
Re: help with rob system -
CalvinC - 18.02.2015
You could create a command that shows a textdraw, and sets a variable to 10:
pawn Код:
new robtime[MAX_PLAYERS];
new robtextdraw;
CMD:rob(playerid, params[])
{
TextDrawShowForPlayer(playerid, robtextdraw);
return robtime[playerid] = 10;
}
Then a timer, to decrease the variable by 1 each second, and updates the textdraw:
pawn Код:
forward robcheck();
public robcheck()
{
foreach(Player, i)
{
if(robtime[i] > 0)
{
robtime[i] --;
new string[128];
format(string, 128, "Time left: %i seconds.", robtime[i]);
TextDrawSetString(robtextdraw, string);
}
}
return 1;
}
Using zcmd and foreach in the example.