Raised This Month: $ Target: $400
 0% 

Killstreak plugin - problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-12-2013 , 22:41   Re: Killstreak plugin - problem
Reply With Quote #5

The g_Kills[33] creates 33 an array of variables that are separated.
We use these to store the 32 players in index 1-32, index 0 is never used for readability. We don't use id-1 just to save some memory.

This is of course instead of using separate variables for everyone, because that would just be stupid. For example:
Code:
new g_Kills1 new g_Kills2 new g_Kills3 // ... new g_Kills31 new g_Kills32 // And when it's called: if ( id == 1 )     g_Kills1++ if ( id == 2 )     g_Kills2++ if ( id == 3 )     g_Kills3++ // ... if ( id == 31 )     g_Kills31++ if ( id == 32 )     g_Kills32++

So when g_Kills[id] is called, and lets say id is 4 then the 4th index of the variable will be read. The limit of the variable is way more than what you will achieve before a mapchange or the server crashes by random.
__________________

Last edited by Black Rose; 08-12-2013 at 22:43.
Black Rose 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 16:00.


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