ok thanks. but i cant understand why i dont have to - my counter?
i mean my counter is 30..
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>
#include <fakemeta>
#include <screenfade_util>
#define HNS_FLAG ADMIN_KICK
new team_ct = 1
new team_t = 0
new bool:enable = false
new team[32]
new points[2]
new bool:trueround = true
new round = 0
new bool:firstspawn[32]
new statusMsg
new counter
new maxplayers
public plugin_init()
{
register_plugin("Hide'n'Seek","6.0.1","One")
register_cvar("Hide'n'Seek","6.0.1",FCVAR_SERVER)
set_task(0.3,"load_cfg",0)
maxplayers = get_maxplayers()
register_clcmd("say /hns_on","hns_enable",HNS_FLAG)
register_clcmd("say /hns_off","hns_off",HNS_FLAG)
register_srvcmd("hns_on","hns_enable")
register_srvcmd("hns_off","hns_off")
register_event("ResetHUD","resethud","be")
register_logevent("startround",2,"0=World triggered","1=Round_Start")
register_logevent("endround",2,"0=World triggered","1=Round_End")
register_logevent("gamestart",2,"0=World triggered","1=Game_Commencing")
register_logevent("restartround",2,"1&Restart_Round_")
statusMsg = get_user_msgid("StatusText")
}
public reset_stats(id)
{
team[id-1] = 0
}
public Seeker_Nums()
{
new count = 0
for(new i=1;i<33;i++)
if(team[i-1] == 1 && is_user_connected(i) && is_user_alive(i))
count++
return count
}
public Hider_Num()
{
new count = 0
for(new i=1;i<33;i++)
if(team[i-1] == 0 && is_user_connected(i) && is_user_alive(i))
count++
return count
}
public The_teams(id)
{
if(get_user_team(id) == 1)
team[id-1] = team_t
else if(get_user_team(id) == 2)
team[id-1] = team_ct
}
public remove_hossis()
{
new ent = find_ent(0,"monster_hostage")
while(ent != 0)
{
cs_set_hostage_foll(ent,0)
ent = find_ent(ent,"monster_hostage")
}
ent = find_ent(0,"hostage_entity")
while(ent != 0)
{
cs_set_hostage_foll(ent,0)
ent = find_ent(ent,"hostage_entity")
}
}
public hns_enable(id,level,cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
hns_on(id)
return PLUGIN_HANDLED
}
public load_cfg()
{
new hns_cfg[256], cfgdir[128]
get_configsdir(cfgdir,127)
format(hns_cfg,255,"%s/hns.cfg",cfgdir)
if(file_exists(hns_cfg))
{
server_cmd("exec %s",hns_cfg)
server_exec()
}
}
public hns_on(id)
{
if(enable == true)
{
client_print(id,print_chat,"[ hns 6.0.1 ] The Mod is active !")
}
else
{
enable = true
for(new i=1;i<33;i++)
{
team_ct = 1
team_t = 0
reset_stats(i)
}
points[0] = 0
points[1] = 0
for(new i=1;i<=get_maxplayers();i++)
if(is_user_connected(i))
{
client_cmd(i,"cl_forwardspeed 9999")
client_cmd(i,"cl_sidespeed 9999")
client_cmd(i,"cl_backspeed 9999")
client_cmd(i,"hud_centerid 0")
}
set_cvar_num("sv_restartround",1)
}
}
public hns_off(id,level,cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
if(enable == false)
client_print(id,print_chat,"[ hns 6.0.1 ] The Mod is deactive!")
else
{
enable = false
remove_task(1000)
remove_task(6000)
remove_task(7000)
remove_task(8000)
trueround = true
round = 0
for(new i=1;i<33;i++)
if(is_user_connected(i))
set_user_rendering(i)
set_cvar_num("sv_restartround",1)
}
return PLUGIN_HANDLED
}
public show_message(id,text[])
{
message_begin(MSG_ONE,statusMsg,{0,0,0},id)
write_byte(0)
write_string(text)
message_end()
}
public resethud(id)
{
if(enable)
{
client_cmd(id,"cl_forwardspeed 9999")
client_cmd(id,"cl_sidespeed 9999")
client_cmd(id,"cl_backspeed 9999")
client_cmd(id,"hud_centerid 0")
set_task(0.1,"apply",id)
if(firstspawn[id-1])
{
client_print(id,print_chat,"[ hns 6.0.1 ] Welcome, [H]ave [F]un & [G]ood [L]uck !")
client_print(id,print_chat,"[ hns 6.0.1 ] Say '!stats' for see the Statesboard and '!help' if you need HELP!")
}
}
firstspawn[id-1] = false
}
public apply(id)
{
The_teams(id)
if(team[id-1] == 1)
{
UTIL_ScreenFade(id, _, 1.0, 30.0, 255, FFADE_OUT)
client_print(id,print_chat,"[ hns 6.0.1 ] You are now a SEEKER. You have to hns. Go,Go,Go...")
}
else
{
client_print(id,print_chat,"[ hns 6.0.1 ] You have now to HIDE,Take care...")
}
}
public client_PreThink(id)
{
if(enable)
{
//Give B-Hop?
}
}
public gamestart()
{
restartround()
}
public restartround()
{
for(new i=1;i<33;i++)
{
team_ct = 1
team_t = 0
reset_stats(i)
}
points[0] = 0
points[1] = 0
round = 0
trueround = true
}
public countdown(id)
{
set_hudmessage(255, 20, 0, 0.10, 0.50, 0, 1.0, 1.0, 0.2, 0.2, 9);
counter--;
if(counter >= 0)
{
show_hudmessage(0, "%d", counter);
}
else
{
remove_task(id)
for(id = 1; id <= maxplayers; id++)
{
if(team[id-1] == 1)
{
if(is_user_alive(id))
{
give_item(id, "weapon_knife");
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "ammo_50ae");
give_item(id, "weapon_m4a1");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
set_user_godmode(id,1)
}
}
else
{
if(is_user_alive(id))
{
set_user_health(id,10)
strip_user_weapons( id );
give_item( id, "weapon_knife" );
client_print(id,print_chat,"freeze!")
}
}
}
}
}
public startround()
{
if(enable)
{
if(trueround)
round++
trueround = false
counter = floatround(30.0);
set_task(1.0, "countdown", 412566, "", 0, "b")
}
}
public endround()
{
if(enable)
{
if(team_ct == 1)
{
team_ct = 0
team_t = 1
}
else
{
team_ct = 1
team_t = 0
}
trueround = true
}
}
public client_disconnect(id)
{
client_cmd(id,"cl_forwardspeed 400")
client_cmd(id,"cl_backspeed 400")
client_cmd(id,"cl_sidespeed 400")
reset_stats(id)
remove_task(id+10000)
firstspawn[id-1] = true
}
public client_putinserver(id)
{
reset_stats(id)
firstspawn[id-1] = true
}