View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-02-2017 , 07:05   Re: Progressive spawn protect
Reply With Quote #2

1.
Code:
new activated[33]

- 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 ; }
__________________

Last edited by edon1337; 04-02-2017 at 07:06.
edon1337 is offline