Raised This Month: $ Target: $400
 0% 

two basic questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 07-23-2013 , 13:31   two basic questions
Reply With Quote #1

1st Q. What is the most efficient way of seting the first set_task?

Example 1.
PHP Code:
public plugin_init() 
{    
   
set_task 20.0"Taskworker"50""0);
}
public 
firsTtask(id)
{

     
// code here..
}
public 
Taskworker () 
{
   new 
players[32], numplayersid;
   
get_players playersnumplayers );
   for ( new 
i=0i<numplayersi++ ) {
   
id=players[i];
   
firsTtaskid );
 }

or

Example 2.
PHP Code:
public client_putinserver(id
{
          
set_task(15.0,"firsTtask",id)
}
public 
firsTtask(id)
{

     
// code here..

2nd Q. what is an less resource hungry method to flip an switch?
using an bool variable per client or introducing an new client cvar?

Last edited by vamppa; 07-23-2013 at 13:37.
vamppa is offline
 



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 06:24.


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