1.
- It should be a bool
Code:
new bool:activated[33]
2.
Code:
set_task(0.5, "start_protect", protected)
- You don't need a task.
3.
Code:
cs_plugin_task = register_cvar("cs_damage_blocker_task","5.0")
set_task(get_pcvar_float(cs_plugin_task), "end_protect", protected)
- To make it easier for users, you can do this :
Code:
cs_plugin_task = register_cvar("cs_damage_blocker_task","5")
set_task(float(get_pcvar_num(cs_plugin_task)), "end_protect", protected)
4.
Code:
!is_user_connected(victim)
- Remove that, victim may be an entity (worldspawn) .
5. Use id + Task_ID format of tasks because many tasks with same ID can get messed up. Example :
Code:
#define TASK_ID 555
public TestFunction( id ) {
set_task( 1.0, "TaskTest", id+TASK_ID ) ;
}
public TaskTest( id ) {
id -= TASK_ID ;
client_print( id, print_chat, "id+Task_ID method !" ) ;
}
6. - On client_putinserver reset the bool.
Code:
public client_putinserver( id ) {
activated[ id ] = false ;
}
__________________