ok now start from here add these at the top of your script:
PHP код:
new RobberyTime[MAX_PLAYERS];
new Text:RobberyTimer[MAX_PLAYERS];
new RobberySetTimer[MAX_PLAYERS];
forward RobberyTextDraw(playerid);
now you should make a textdraw for this like this one you can use it:
PHP код:
RobberyTimer[playerid] = TextDrawCreate(505.000000, 411.000000, "RobberyTime: 25");
TextDrawBackgroundColor(RobberyTimer[playerid], -1);
TextDrawFont(RobberyTimer[playerid], 3);
TextDrawLetterSize(RobberyTimer[playerid], 0.529999, 1.299999);
TextDrawColor(RobberyTimer[playerid], 65535);
TextDrawSetOutline(RobberyTimer[playerid], 1);
TextDrawSetProportional(RobberyTimer[playerid], 1);
TextDrawUseBox(RobberyTimer[playerid], 1);
TextDrawBoxColor(RobberyTimer[playerid], 255);
TextDrawTextSize(RobberyTimer[playerid], 633.000000, 0.000000);
now when you want to rob somewhere server will show you a dialog right?! so change ShowPlayerDialog
to this it's a timer for each second
PHP код:
RobberySetTimer[playerid] = SetTimerEx("RobberyTextDraw", 1000, true, "i", playerid);
RobberTime[playerid] = 25;
TextDrawShowForPlayer(playerid , RobberyTimer[playerid]);
now put this every where you want
PHP код:
public RobberyTextDraw(playerid)
{
RobberyTime[playerid] --;
new string[128];
format(string,sizeof(string),"RobberyTime : %d",RobberyTime[playerid]);
TextDrawSetString( RobberyTimer[playerid] , string);
if( RobberyTime[playerid] == 0)
{
KillTimer(RobberySetTimer[playerid]);
GivePlayerMoney(playerid , 10000);
TextDrawHideForPlayer(playerid , RobberyTimer[playerid]);
}
return 1;
}