Raised This Month: $ Target: $400
 0% 

two basic questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 07-23-2013 , 20:42   Re: two basic questions
Reply With Quote #4

why should setinfo be avoided?
and I can not create an client cvar or client variable?

PHP Code:
register_cvar("spec_auto","0"
PHP Code:
#define SCREENSHOT_PER_DEATHS random_num( 1, 35) 

new bool:g_bDeathScreenShotTaken[33] <----

public 
plugin_init() 

    
register_event("DeathMsg" "xDeathMsg" "a"); 


public 
client_putinserver(id

    
g_bDeathScreenShotTaken[id] = false 


public 
xDeathMsg()  
{  
    new 
id read_data(2)  
    if ( !
g_bDeathScreenShotTaken[id] && ! (++gDeaths[id] % SCREENSHOT_PER_DEATHS) )  
    {  
          
client_cmd(id"snapshot")  
          
g_bDeathScreenShotTaken[id] = true 
    
}  

In what ways are the first two code examples different?
the first: setting an global timed task from the server then cycling through the users to get an ID?
the 2nd: setting an user timed task directly on id? (does the set_task in this example use the clients CPU for calculating when to fire off the task aswell?

Last edited by vamppa; 07-23-2013 at 20:49.
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