PHP Code:
public cmdCancelVote(id, level, cid)
{
if (!cmd_access(id, level, cid, 0))
return PLUGIN_HANDLED
if (task_exists(99889988, 1))
{
new authid[32], name[32]
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
log_amx("Vote: ^"%s<%d><%s><>^" cancel vote session", name, get_user_userid(id), authid)
if(get_user_flags(id) & ADMIN_LEVEL_G)
show_activity_key("SILVER_CANC_VOTE_1", "SILVER_CANC_VOTE_2", name, get_user_userid(id), authid)
else if(get_user_flags(id) & ADMIN_BAN)
show_activity_key("ADMIN_CANC_VOTE_1", "ADMIN_CANC_VOTE_2", name, get_user_userid(id), authid)
else if(get_user_flags(id) & ADMIN_LEVEL_H)
show_activity_key("GOLDEN_CANC_VOTE_1", "GOLDEN_CANC_VOTE_2", name, get_user_userid(id), authid)
new maxpl=get_maxplayers();
new msg[256];
for (new i = 1; i <= maxpl; i++)
{
if (is_user_connected(i) && !is_user_bot(i))
{
// HACK: ADMIN_CANC_VOTE_{1,2} keys were designed very poorly. Remove all : and %s in it.
LookupLangKey(msg, charsmax(msg), "ADMIN_CANC_VOTE_1", i);
replace_all(msg, charsmax(msg), "%s", "");
replace_all(msg, charsmax(msg), ":", "");
trim(msg);
show_activity_id(i, id, name, msg);
}
}
console_print(id, "%L", id, "VOTING_CANC")
client_print(0,print_chat,"%L",LANG_PLAYER,"VOTING_CANC")
remove_task(99889988, 1)
set_cvar_float("amx_last_voting", get_gametime())
}
else
console_print(id, "%L", id, "NO_VOTE_CANC")
return PLUGIN_HANDLED
}
public delayedExec(cmd[])
server_cmd("%s", cmd)
public autoRefuse()
{
log_amx("Vote: %L", "en", "RES_REF")
client_print(0, print_chat, "%L", LANG_PLAYER, "RES_REF")
if(get_user_flags(id) & SILVER)
client_print(0, print_chat, "Result refused by Silver Player: %s", name)
else if(get_user_flags(id) & ADMIN)
client_print(0, print_chat, "Result refused by Administrator: %s", name)
else if(get_user_flags(id) & GOLDEN)
client_print(0, print_chat, "Result refused by Golden Player: %s", name)
}
public actionResult(id, key)
{
remove_task(4545454)
switch (key)
{
case 0:
{
set_task(2.0, "delayedExec", 0, g_Execute, g_execLen)
log_amx("Vote: %L", "en", "RES_ACCEPTED")
client_print(0, print_chat, "%L", LANG_PLAYER, "RES_ACCEPTED")
if(get_user_flags(id) & SILVER)
client_print(0, print_chat, "Result accepted by Silver Player: %s", name)
else if(get_user_flags(id) & ADMIN)
client_print(0, print_chat, "Result accepted by Administrator: %s", name)
else if(get_user_flags(id) & GOLDEN)
client_print(0, print_chat, "Result accepted by Golden Player: %s", name)
}
case 1: autoRefuse()
}
return PLUGIN_HANDLED
}
Here is the error that I get from the compiler.