help with rob system
#1

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.
Reply
#2

That image is a textdraw man.
Reply
#3

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.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)