Thread: Shove Mod
View Single Post
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-25-2007 , 04:28   Re: Shove Mod
Reply With Quote #10

Nice plugin ;)


I guess you should replace :
Code:
isCooldown[id] = true     set_task(get_pcvar_float(cCooldown), "endCooldown", id, "", 0, "")
with something like :
Code:
g_lastshove_time[id] = get_systime()


and replace
Code:
if(isCooldown[id])     {         client_print(id, print_chat, "[Shove Mod] Your muscles are weak from shoving the player. You must wait to do it again.")         return PLUGIN_HANDLED     }
with
Code:
if( get_systime() - g_lastshove_time[id] < get_pcvar_num(cCooldown) ) {         client_print(id, print_chat, "[Shove Mod] Your muscles are weak from shoving the player. You must wait to do it again.")         return PLUGIN_HANDLED     }



Then you don't need a task.

Last edited by ConnorMcLeod; 09-25-2007 at 04:33.
ConnorMcLeod is offline