Quote:
Originally Posted by Bugsy
PHP Code:
new szBuffer[ 35 ];
formatex( szBuffer , charsmax( szBuffer ) , "[ Countdown ends in: %.02f ]" , g_iCounter);
replace( szBuffer , charsmax( szBuffer ) , "." , ":" );
show_hudmessage(0 , szBuffer );
|
Bugsy Hello, thank you for your reply
Now I have a problem, please help me to see what the code is wrong
I now add the code to the miscstats code
It only shows the milliseconds on the left
C4: 35:0
Cannot display the milliseconds on the right
C4: 35:00
Is there an incorrect code somewhere?
Code:
new Float:g_iC4Timer
public bombcountdown()
{
new bt_ppl[32], plnum = 0
get_players(bt_ppl,plnum)
g_iC4Timer -= 0.1
for (new a=0; a<plnum; a++) {
if ( !g_justKilled[bt_ppl[a]] ) {
if(g_iC4Timer < 7) set_hudmessage(150, 0, 0, -1.0, 0.75, 0, 1.0, 1.0, 0.01, 0.01, -1)
if(g_iC4Timer > 6) set_hudmessage(150, 150, 0, -1.0, 0.75, 0, 1.0, 1.0, 0.01, 0.01, -1)
if(g_iC4Timer > 11) set_hudmessage(0, 150, 0, -1.0, 0.75, 0, 1.0, 1.0, 0.01, 0.01, -1)
new szBuffer[35]
formatex(szBuffer, 34, "C4: %0.1f", g_iC4Timer)
replace(szBuffer, 34, ".", ":")
ShowSyncHudMsg(bt_ppl[a], g_bombcounthud_sync, szBuffer)
}
}
if(g_iC4Timer < 0.1) {
remove_task(951010)
}
}
public bomb_planted(planter)
{
g_Defusing = 0
if (BombPlanted)
announceEvent(planter, "")
if (BombPlantedSound)
play_sound("djeyl/c4start")
if(g_roundended) return
g_C4Timer = get_cvar_num("mp_c4timer")
bombTimer()
set_task(1.0, "bombTimer", 8038, "", 0, "b")
g_iC4Timer = get_cvar_float("mp_c4timer")
bombcountdown()
set_task(0.1, "bombcountdown", 951010, "", 0, "b")
}
__________________