Raised This Month: $ Target: $400
 0% 

How to call function every second?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 04-09-2011 , 05:04   How to call function every second?
Reply With Quote #1

I know it's something about set_task.
I found this, but I don't understand a few things.
set_task ( Float:time, const function[], id = 0, parameter[]="", len = 0, flags[]="", repeat = 0 )

1. Where do I need to put id if I want to make the function repeat on server and not bind on some player?
2. What is a "parameter" and "len" in set_task?

Thanks
KviZ is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 04-09-2011 , 05:19   Re: How to call function every second?
Reply With Quote #2

set_task(1.0, "function",_, _, _, "b")
reinert is offline
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 04-09-2011 , 05:21   Re: How to call function every second?
Reply With Quote #3

Thanks
KviZ is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 04-09-2011 , 09:08   Re: How to call function every second?
Reply With Quote #4

Quote:
Originally Posted by KviZ View Post
2. What is a "parameter" and "len" in set_task?
sample:
PHP Code:
// store Parameters
static param[2]
param[0] = weapon
param
[1] = id

// Set task with params
set_task(1.0"sample"_param2)



public 
sample(param[2])
{
    
// param[0] = weapon
    // param[1] = client
    
    
new weapon param[0]
    new 
id param[1]

so u can work with multi vars stored in one set_task
__________________

Working on:
nothing
schmurgel1983 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 19:47.


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