| LostSkill |
11-17-2010 04:28 |
Re: New map
PHP Code:
#include <amxmodx>
#include <fun>
new gVoteMenu;
new gVotes[2];
new gVoting;
public plugin_init()
{
register_plugin("Vote Hs mode","1.0","James Romeril")
register_concmd("aim_prac", "aim_prac", ADMIN_LEVEL_A, "aim_prac <on|off> or <1|0>")
set_task(60.0, "hs_mode")
}
public aim_prac(id)
{
if (id && !((get_user_flags(id) & ADMIN_LEVEL_A)))
{
client_print(id, print_console, "[AMXX] You do not have access to this command")
return PLUGIN_CONTINUE
}
new arg[8]
read_argv(1, arg, 7)
if((equali(arg, "on"))||(equali(arg, "1")))
{
set_user_hitzones(0 ,0, 2)
client_print(id, print_console, "[AMXX] ENABLED Headshot only mode")
client_print(0, print_chat, "[AMXX] ENABLED Headshot only mode")
}
else
{
set_user_hitzones(0, 0, 255)
client_print(id, print_console, "[AMXX] DISABLED Headshot only mode")
client_print(0, print_chat, "[AMXX] DISABLED Headshot only mode")
}
return PLUGIN_HANDLED
}
public hs_mode(id)
{
gVoteMenu = menu_create("\rIjunkti HS moda?", "menu_handler");
menu_additem(gVoteMenu, "Taip", "0", 0);
menu_additem(gVoteMenu, "Ne", "1", 0);
new players[32], pnum, tempid;
get_players(players, pnum);
for( new i; i<pnum; i++ )
{
tempid = players[i];
menu_display(tempid, gVoteMenu, 0);
gVoting++;
}
set_task(15.0, "EndVote");
return PLUGIN_HANDLED;
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT || !gVoting )
{
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new voteid = str_to_num(data);
gVotes[voteid]++;
return PLUGIN_HANDLED;
}
public EndVote()
{
if( gVotes[0] > gVotes[1] )
client_print(0, print_chat, "Uz TAIP balsavo (%d) dabar bus ijunktas hs mode", gVotes[0] );
set_cvar_num("aim_prac", 1)
else if( gVotes[0] < gVotes[1] )
client_print(0, print_chat, "Uz NE balsavo (%d) todel HS mode nebus ijunktas", gVotes[1] );
set_cvar_num("aim_prac", 0)
else
client_print(0, print_chat, "Buvo lygiosios %d todel nebus ijunktas HS mode.", gVotes[0] );
set_cvar_num("aim_prac", 0);
menu_destroy(gVoteMenu);
gVoting = 0;
}
After this:
PHP Code:
set_cvar_num("aim_prac", 1)
I lose identification on this line and compile fails :\
PHP Code:
else if( gVotes[0] < gVotes[1] )
|