Raised This Month: $ Target: $400
 0% 

Save user team on disconnect - the best way?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 07-10-2014 , 20:34   Re: Save user team on disconnect - the best way?
Reply With Quote #6

It's simple for everyone, it's a simple hashtable, not rocket science.

PHP Code:
new Trie:g_Teams

public plugin_init()
{
    
g_Teams TrieCreate()
}

public 
plugin_end()
{
    
//apparently tries aren't destroyed automatically anymore
    
TrieDestroy(g_Teams)
}

public 
client_disconnect(id)
{
    new 
Authid[34]
    
get_user_authid(idAuthidcharsmax(Authid))

    
TrieSetCell(g_TeamsAuthidget_user_team(id))
}

public 
client_connect(id)
{
    new 
Authid[34]
    
get_user_authid(idAuthidcharsmax(Authid))

    new 
Team
    TrieGetCell
(g_TeamsAuthidTeam)


Last edited by Backstabnoob; 07-10-2014 at 20:35.
Backstabnoob 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 21:07.


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