Raised This Month: $12 Target: $400
 3% 

SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
splewis
Veteran Member
Join Date: Feb 2014
Location: United States
Old 08-22-2014 , 15:56   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #11

I've found myself reusing some cookie & menu int/bool functions recently.

Example with cookies and ints:
Code:
/**
 * Sets a cookie to an integer value by converting it to a string.
 */
public void SetCookieInt(int client, Handle cookie, int value) {
    char buffer[INTEGER_STRING_LENGTH];
    IntToString(value, buffer, sizeof(buffer));
    SetClientCookie(client, cookie, buffer);
}

/**
 * Fetches the value of a cookie that is an integer.
 */
public int GetCookieInt(int client, Handle cookie) {
    char buffer[INTEGER_STRING_LENGTH];
    GetClientCookie(client, cookie, buffer, sizeof(buffer));
    return StringToInt(buffer);
}

My question is: there is a way to get around doing things like this? The lack of something like this makes me thing I'm doing something wrong.

If not, would something like this be accepted into smlib? (with better naming and not-1.7 syntax of course)
__________________

Last edited by splewis; 08-23-2014 at 00:07.
splewis 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 17:16.


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