PHP Code:
#include <amxmodx>
new szRound, pCvar, maxpl;
public plugin_init() {
register_plugin("Slap every X round", "1.0", "OnePL");
pCvar = register_cvar("amx_slap_round", "2");
register_logevent("RoundEnd", 2, "1=Round_End");
register_logevent("RoundStart", 2, "1=Round_Start");
register_logevent("RestartContin", 2, "1=Game_Commencing");
register_event("TextMsg", "RestartGame", "a", "2&#Game_w");
maxpl = get_maxplayers();
}
public RoundEnd() szRound += 1;
public RestartGame() szRound = 0;
public RestartContin() szRound = -1;
public RoundStart() {
if(szRound%7 == get_pcvar_num(pCvar)) {
for(new i = 1; i <= maxpl; i++) {
if(!is_user_alive(i)) continue;
server_cmd("amx_slap #%i 5", get_user_userid(i));
//5 - power
}
}
}
cvar amx_slap_round
plugin splits for 7 rounds (such as days of the week)
if amx_slap_round is equates 2 to execute a command on the second day of the week (Tuesday)