Raised This Month: $ Target: $400
 0% 

Reset value every 20 sec


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anupm
Senior Member
Join Date: May 2010
Old 06-14-2011 , 02:54   Reset value every 20 sec
Reply With Quote #1

Hi ,

I have one function
Code:
 
new NamesChangesNum[33]
 
 
public ClearChangesNum(id)
{
      NamesChangesNum[id] = 0
}
Now i want for every player after 20 sec this fucntion will be called.

I am trying

set_task(20.0,"ClearChangesNum",id,_,_,"b")

Will it do if i put it in init block ?
anupm is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-14-2011 , 03:03   Re: Reset value every 20 sec
Reply With Quote #2

No need to do it specifically for each player.

Code:
new NamesChangesNum[33] public plugin_init() {     set_task(20.0, "TaskResetNamesChangesNum", _, _, _, "b") } public TaskResetNamesChangesNum() {     arrayset(NamesChangesNum, 0, sizeof(NamesChangesNum)) }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
anupm
Senior Member
Join Date: May 2010
Old 06-14-2011 , 03:06   Re: Reset value every 20 sec
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
No need to do it specifically for each player.


Code:
new NamesChangesNum[33]</p><p>&nbsp;</p><p>public plugin_init()</p><p>{</p><p> set_task(20.0, "TaskResetNamesChangesNum", _, _, _, "b")</p><p>}</p><p>&nbsp;</p><p>public TaskResetNamesChangesNum()</p><p>{</p><p> arrayset(NamesChangesNum, 0, sizeof(NamesChangesNum))</p><p>}
Thank you ..
anupm is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode