Sometimes (not all the time, i guess this "bug" pops up when in server are 14 - 16~ players) some of the players dont get things they must to (debends on the chosen day).
For e.g. they dont get guns on DAY_CTSHIELD, heres the code:
Code:
#define IsPlayer(%1) (1<=%1<=g_max_clients)
new g_max_clients
public plugin_init() {
g_max_clients = get_maxplayers()
}
public do_specialday(id)
{
new name[33]; get_user_name(id, name, charsmax(name))
for(new i = 0; i < g_max_clients; i++)
{
switch(specialday[20])
{
case DAY_CTSHLD:
{
if(IsPlayer(i) && is_user_alive(i))
{
switch(cs_get_user_team(i))
{
case CS_TEAM_T:
{
strip_weapons(i)
give_item(i, "weapon_deagle")
give_item(i, "weapon_m4a1")
cs_set_user_bpammo(i, CSW_DEAGLE, 9999)
cs_set_user_bpammo(i, CSW_M4A1, 9999)
if(!(pev(i, pev_flags) & FL_FROZEN))
{
client_print(i, print_center, "U'v been frozen for 6s!");
freeze = true
set_pev(i, pev_flags, (pev(i, pev_flags) | FL_FROZEN));
set_task(7.0, "unfreeze", TASK_unfreeze + id)
}
}
case CS_TEAM_CT:
{
strip_weapons(i)
give_item(i, "weapon_deagle")
give_item(i, "weapon_shield")
cs_set_user_bpammo(i, CSW_DEAGLE, 35)
}
}
}
client_print(i, print_chat, "%s started CT SHIELD day", name)
set_task(2.0, "specdaytxtprad", id, "", 0, "b", TASK_specd)
set_task(6.0, "specdaytxtprad1", id)
jail_open()
}
}
}
}
Is there any misstake??
Im basicly talking about this part of code, becouse the rest of code i think is fine.
Code:
#define IsPlayer(%1) (1<=%1<=g_max_clients)
new g_max_clients
public plugin_init() {
g_max_clients = get_maxplayers()
}
public do_specialday(id)
{
new name[33]; get_user_name(id, name, charsmax(name))
for(new i = 0; i < g_max_clients; i++)
{
switch(specialday[20])
{