Этот плагин под AMX а не AMXX
Код
#include <amxmodx>
#include <amxmisc>
new votefor = 0
new Float:vote_ratio
public restart_round(time[])
{
server_cmd("sv_restartround %s",time)
return PLUGIN_CONTINUE
}
public delay_msg() {
set_hudmessage(0, 255, 255, -1.0, 0.35, 1, 2.0, 6.0, 0.8, 0.8, 1)
show_hudmessage(0,"- FIGHT -")
return PLUGIN_CONTINUE
}
public check_votes() {
new players[32],inum
get_players(players,inum,"c")
new Float:voteresult = inum ? (float(votefor) / float(inum)) : 0.0
if (voteresult<vote_ratio){
client_print(0,print_chat,"* Restart round vote failed (yes ^"%d^") (no ^"%d^") (needed ^"%.2f^").",votefor,inum-votefor,vote_ratio)
return PLUGIN_HANDLED
}
set_task(2.0,"restart_round",0,"1",1)
set_task(4.0,"restart_round",0,"1",1)
set_task(6.0,"restart_round",0,"3",1)
set_task(12.0,"delay_msg")
client_print(0,print_chat,"* Restart round vote successful (ratio ^"%.2f^") (needed ^"%.2f^").",voteresult,vote_ratio)
client_print(0,print_chat,"* Restarting round 3 times...")
return PLUGIN_HANDLED
}
public count_votes(id,key){
new name[32]
get_user_name(id,name,31)
client_print(0,print_chat,"* %s voted %s restarting round.",name,key ? "against" : "for")
if (!key) ++votefor
return PLUGIN_HANDLED
}
public voterr(id,level,cid) {
new Float:voting = get_cvar_float("amx_last_voting")
if (voting > get_gametime()){
client_print(id,print_chat,"* There is already a voting on...")
return PLUGIN_HANDLED
}
if (voting && voting + get_cvar_float("amx_voterr_delay") > get_gametime()) {
client_print(id,print_chat,"* Restart round vote not allowed at this time.")
return PLUGIN_HANDLED
}
new msg[256]
new keys = (1<<0)|(1<<1)
if(cstrike_running())
format(msg,255,"\yRestart round?\w^n^n1. Yes^n2. No")
else
format(msg,255,"Restart round?^n^n1. Yes^n2. No")
new Float:vote_time = get_cvar_float("amx_voterr_time") + 2.0
set_cvar_float("amx_last_voting", get_gametime() + vote_time)
vote_ratio = get_cvar_float("amx_voterr_ratio")
show_menu(0,keys,msg,floatround(vote_time))
set_task(vote_time,"check_votes")
client_print(id,print_chat,"* Restart round vote has started...")
votefor = 0
return PLUGIN_HANDLED
}
public client_connect(id) {
client_cmd(id, "echo")
client_cmd(id, "echo ======================================================================")
client_cmd(id, "echo ^"AMX Public Restart Round Vote v1.0 by Marach <marach@phreaker.net>^"")
client_cmd(id, "echo")
client_cmd(id, "echo ^" say voterr -> starts a vote to restart round^"")
client_cmd(id, "echo ======================================================================")
client_cmd(id, "echo")
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin("AMX Public Restart Round Vote","1.0","Marach")
register_menucmd(register_menuid("Restart round?") ,(1<<0)|(1<<1),"count_votes")
register_clcmd("say voterr","voterr",0,"- starts a vote to restart round")
register_cvar("amx_voterr_delay","60")
register_cvar("amx_voterr_time","10")
register_cvar("amx_voterr_ratio","0.60")
register_cvar("amx_last_voting","0")
set_cvar_float("amx_last_voting",0.0)
new mod_name[32]
get_modname(mod_name,31)
return PLUGIN_CONTINUE
}
Вот люди что-то пробовали делать. Посмотри может откомпилируется...
Отредактировал: ARLEKIN, - 22.8.2008, 22:46