RSSy MYGO.pl Opublikowano Grudzień 22, 2023 o 03:14 RSSy Udostępnij Opublikowano Grudzień 22, 2023 o 03:14 How to add a colon between seconds and milliseconds I am using the Fast Countdown plugin created by bugsy. But there's a question, I need to add a colon between seconds and milliseconds. How should I add a colon? Now the countdown is displayed like this If the countdown starts from 15 seconds [Countdown ends in: 1500] I want to change it to display like this Add: colon between seconds and milliseconds [Countdown ends in: 15:00] I also want to add milliseconds to the C4 countdown. How do I get milliseconds from g_C4Timer = get_cvar_num("mp_c4timer") thank Code: #include <amxmodx> #include <engine> new const Version[] = "0.1" const iCountTime = 1500 new g_iCountdownEntity new g_iCounter public plugin_init() { register_plugin("Fast Countdown" , Version , "bugsy") g_iCountdownEntity = create_entity("info_target") entity_set_string(g_iCountdownEntity , EV_SZ_classname , "countdown_entity") register_think("countdown_entity" , "fw_CountdownEntThink") register_clcmd("say /countdown" , "ShowCountdown") } public ShowCountdown() { g_iCounter = iCountTime entity_set_float(g_iCountdownEntity , EV_FL_nextthink , get_gametime() + 0.01) } public fw_CountdownEntThink(iEntity) { if (iEntity == g_iCountdownEntity) { set_hudmessage(255 , 255 , 255 , -1.0 , -1.0 , 0 , 0.1 , 0.1) show_hudmessage(0 , "[ Countdown ends in: %d ]" , --g_iCounter) if (g_iCounter) entity_set_float(g_iCountdownEntity , EV_FL_nextthink , get_gametime() + 0.01) else server_cmd("sv_restartround 1") } } Attached Files Get Plugin or Get Source (Fast_Countdown.sma - 989 Bytes) Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi