Raised This Month: $ Target: $400
 0% 

Using BuildPath()


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-18-2012 , 11:54   Re: Using BuildPath()
Reply With Quote #8

I added a quick example to the Client Preferences API wiki page.

Anyway, so you want to do something like this?

PHP Code:
#include <clientprefs>
new Handle:g_hMoneyCookie;
new 
g_Money[MAXPLAYERS+1] = { -1, ... };

public 
OnPluginStart()
{
    
g_hMoneyCookie RegClientCookie("myplugin_money""MyPlugin Money"CookieAccess_Protected);
}

public 
OnClientCookiesCached(client)
{
    
decl String:sMoney[11];
    
GetClientCookie(clientg_hMoneyCookiesMoneysizeof(sMoney));
    
g_Money[client] = StringToInt(sMoney);
}

public 
OnClientDisconnect_Post(client)
{
    
decl String:sMoney[11];
    
IntToString(g_Money[client], sMoneysizeof(sMoney));
    
SetClientCookie(clientg_hMoneyCookiesMoney);
    
g_Money[client] = -1;

Assuming you're storing the client's money in g_Money that is.
__________________
Not currently working on SourceMod plugin development.
Powerlord 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 11:42.


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