How to make loop delay in this code?
I want to run this loop in a 1 second delay.
Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Restart and live!"
#define VERSION "1.0"
#define AUTHOR "HunTeR"
new roundcount = 0
new i = 60
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("RoundEnd", 2, "1=Round_End")
register_logevent("RoundStart", 2, "1=Round_Start")
}
public RoundEnd() {
if(roundcount == 0) {
server_cmd("sv_restart 1")
roundcount++
}
}
public RoundStart() {
if(roundcount == 0) {
for(i=60;i>=0;i--) {
if(i == 1) {
set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(0, "Live for 1 second!")
console_print(0, "Live for 1 second!")
}
else {
set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(0, "Live for %d seconds!",i)
console_print(0, "Live for %d seconds!",i)
}
}
}
else if(roundcount == 1) {
set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(0, "Game is now Live!!!")
}
}
Sorry for my bad english!