Raised This Month: $ Target: $400
 0% 

Optimize code, menu and nvault


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 06-10-2012 , 01:44   Re: Optimize code, menu and nvault
Reply With Quote #8

try this.... in the Load() function
Code:
static space = 0
//for loop
if(szData[i] == ' ') 
            space++
This is assuming you actually want to count the spaces from the retrieved data....

also
g_iSave[33][33]

g_iSave[33][32]
SteamIDs are only 32, you don't need to set it to 33, its one extra bit you don't need. Relatively negligible in the long run, but an optimization, if you care about it.

EDIT: looking at how hornet fixed your code.....the first half of this is obsolete. The second half is still just a little something.

Oh...and instead of using client_putinserver() use client_authorized(id) because this is based completely on the authorization of the client (using their SteamID) you want to make sure they actually have one when you execute the body of it. doing it this way will ensure that.
client_putinserver(id) is called when the client gets prompted the MOTD, while client_authorized() is called when the client has a proper SteamID placed to his credentials.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 06-10-2012 at 01:51.
Liverwiz 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 00:21.


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