This what i tried:-
At top of the script:-
PHP код:
PlayerBar:Bomb[MAX_PLAYERS];
The script:-
PHP код:
CMD:wbomb(playerid, parmas[])
{
if(gTeam[playerid] == TEAM_DEFENDERS) return SendClientMessage(playerid, -1, " What are you doing soldier! You have to protect the bomb sites not to destroy them!");
if(IsPlayerInRangeOfPoint(playerid, 1.5, -1954.2892, 291.3032, 41.0471))
{
if(IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,-1,"You cant plant bomb while youre On Vehicle!");
if(HtCB[WANG] == gTeam[playerid])return SendClientMessage(playerid,-1,"This bomb area already bombed by your Team!");
if(HUnderBomb[WANG] == 1)return SendClientMessage(playerid,-1,"This area is already bombed by someone else!");
if(!IsPlayerInDynamicCP(playerid, HBCP[WANG]))return SendClientMessage(playerid,-1,"You are not on bomb CP!");
HIsPlayerBombing[WANG] = 1;
HBombed[WANG] = 0;
HUnderBomb[WANG] = 1;
SendClientMessageToAll(COLOR_ORANGE, "[BOMB]: {FFFFFF}Bomb has been planted at {FF0000}'Wang Cars'{FFFFFF}. Defenders go defuse it before it's to late!");
Bomb[playerid] = CreatePlayerProgressBar(playerid, 74.00, 330.00, 61.50, 3.50, -1061109590, BAR_DIRECTION_RIGHT);
SetPlayerProgressBarMaxValue(playerid, Bomb[playerid], 100.0);
ShowPlayerProgressBar(playerid, Bomb[playerid]);
HTimer[WANG] = SetTimerEx("wangbomb",120000,false,"i",playerid);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://k003.kiwi6.com/hotlink/eg5ozskbs1/10*******.com_Bomb-Has-Been-Planted-Sound-Effect-CSGO_llCmtgvIqcY.mp3");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "[BOMB]: You are not on the bomb checkpoint!");
}
return 1;
}
forward wangbomb(playerid);
public wangbomb(playerid)
{
KillTimer(HTimer[WANG]);
SetPlayerProgressBarValue(playerid, Bomb[playerid], 0.0);
HidePlayerProgressBar(playerid, Bomb[playerid]);
HBombed[WANG] = 1;
HtCB[WANG] = gTeam[playerid];
HUnderBomb[WANG] = 0;
CreateExplosion(-1954.2892, 291.3032, 41.0471, 0, 40.0);
SendClientMessage(playerid,-1,"Congratulation, you have Bombed this zone! ans earned 10 score and $2000");
SendClientMessageToAll(COLOR_ORANGE, "[BOMB]:{FFFFFF} The bomb successfully exploded at {FF0000}'Wang Cars'{FFFFFF}. Good Job Attackers!");
GivePlayerMoney(playerid,2000);
SetPlayerScore(playerid,GetPlayerScore(playerid)+10);
return 1;
}
The bar is created, but the value in the bar does not decrease, and simply when the timer ends, it gets destoyed, just tell me how do I decrease the value according to the timer