Hello Guyz This Is The Rob Bank Dialog I Am Making now and working good and fine but my problem is the countdown of it when u click or choose the attemp robbery and the countdown dont move just stay 25 can anyone help me how to make it move pls thank you
Код:
if(listitem == 4)//rob bank
{
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned to use the Bank menu.");
return 1;
}
if(IsCuffed[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot rob the Bank while cuffed, how could you manage that?");
return 1;
}
if(IsFrozen[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot rob the Bank while frozen by an administrator, how could you manage that?");
return 1;
}
if(RobSkill[playerid] < 20)
{
SendClientMessage(playerid,COLOR_ERROR,"Your robbing skill is too low to rob the Drug House. You need level 20. See /robskill for what you can rob.");
return 1;
}
if(getCheckpointType(playerid) != CP_BankMain)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be in the Bank main checkpoint in order to rob it.");
return 1;
}
if(gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_MEDIC)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot rob things with your class/skill.");
return 1;
}
if(CityHallRobbedRecently >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"The Bank has been robbed recently. Please wait before robbing it again.");
return 1;
}
new current_zone;
current_zone = player_zone[playerid];
CityHallRobbedRecently =300;
RobbingCityHall[playerid] =25;
IncreaseWantedLevel(playerid,4);
IncreasePlayerScore(playerid,1);
format(string,sizeof(string),"Robbing the Drug House.\nFinish Robbery in: %d seconds.\nPolice are on the way.",RobbingCityHall[playerid]);
ShowPlayerDialog(playerid,DIALOG_DRUGHOUSE,DIALOG_STYLE_MSGBOX,"{FF0000}Drug House Robbery",string,"Ok","Cancel");
format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has begun to rob the Bank Location: %s.",pname,playerid,zones[current_zone][zone_name]);
SendClientMessageToAllCops(string);
format(string,sizeof(string),"[ROBBERY] %s(%d) has begun a robbery at the %s Bank ..",pname,playerid,zones[current_zone][zone_name]);
SendClientMessageToAll(COLOR_RED,string);
format(string,sizeof(string),"%s(%d) has begun to rob your Drug House at %s. Get over there and kill him.",PlayerName(playerid),playerid,zones[current_zone][zone_name]);
SendClientMessageToDHOwner(string);
format(string,sizeof(string),"4[ROBBERY] %s(%d) has begun a robbery at the %s Bank..",pname,playerid,zones[current_zone][zone_name]);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}
return 1;
}
}
pawn Код:
BankCounter[playerid] = SetTimerEx("BankCountDown",1000,false,"i",playerid); //add this when player attempt to rob the bank
pawn Код:
forward BankCountDown(playerid);
public BankCountDown(playerid)
{
bCount ++;
new string[120];
format(string, sizeof(string), "time left: %i", bCount);
GameTextForPlayer(playerid, string, 1000, 1);
if(bCount == 25)
{
SenClientMessage(playerid,-1,"You have successfully robbed the bank");
KillTimer(BankCounter[playerid]);
bCount = 0;
//and add here what will happen if he robbed the bank
}