Raised This Month: $ Target: $400
 0% 

Memory Usage Optimizing, static and new


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 05-07-2011 , 16:44   Memory Usage Optimizing, static and new
Reply With Quote #1

I've already searched the forums, here http://forums.alliedmods.net/showthread.php?t=107303 and here http://forums.alliedmods.net/showthread.php?t=106358

but i didn't understand exactly what i am looking for.

I made a function to the AMX Match Deluxe so that the plugin can set the players nick like so a.Nick or b.Nick for Team A or Team B, similar to the Gather Network concept, checked once per round, at the spawn.

And .. after a small delay, i start the for loop. What is recommended here ? static or new ?

Ex:
PHP Code:
public CheckNames()
{
    static 
name[32];
    for(new 
i=1;i<=12;i++)
    {
        
get_user_name(iname31);
        
format(name31"a.%"name);
        and 
so onetc.
    }

Also, can i use static instead of
PHP Code:
new CsTeams:team
?

And in conclusion, from what i understand from the 2 topic posted in the beggining, the static function are overwritten over and over again. Then if i replace in my sample "static name" with "new name" the memory usage wouldn't be the same ? if not, what's the difference between static and new in mu sample above. Thank you.
DjOptimuS is offline
 


Thread Tools
Display Modes

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 04:27.


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