In certain situacion i want to freeze every alive T or CT and after 15sec unfreeze them.
Am i doing it correctly?
Terrorist freeze/unfreeze
PHP Code:
switch(cs_get_user_team(tid))
{
case CS_TEAM_T:
{
if(!(pev(tid, pev_flags) & FL_FROZEN))
{
client_print(tid, print_center, "You have been frozen for 15sec");
set_pev(tid, pev_flags, (pev(tid, pev_flags) | FL_FROZEN));
set_task(15.0, "UnFreezeT", TASK_UNFREEZET);
}
}
}
public UnFreezeT()
{
new players[32], num, tid;
get_players(players, num, "ae", "TERRORIST");
for(new i; i < num; i++)
{
tid = players[i]
set_pev(tid, pev_flags, (pev(tid, pev_flags) & ~FL_FROZEN));
}
}
CT freeze/unfreeze
PHP Code:
switch(cs_get_user_team(tid))
{
case CS_TEAM_CT:
{
if(!(pev(tid, pev_flags) & FL_FROZEN))
{
client_print(tid, print_center, "You have been frozen for 15sec");
set_pev(tid, pev_flags, (pev(tid, pev_flags) | FL_FROZEN));
set_task(15.0, "UnFreezeCT", TASK_UNFREEZECT);
}
}
}
public UnFreezeCT()
{
new players[32], num, tid;
get_players(players, num, "ae", "CT");
for(new i; i < num; i++)
{
tid = players[i];
set_pev(tid, pev_flags, (pev(tid, pev_flags) & ~FL_FROZEN));
}
}
I need all that "Swith" thing, becouse i'm doing some stuff with opposite team too.