Raised This Month: $ Target: $400
 0% 

Sharing Trie handle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 12-21-2011 , 13:48   Sharing Trie handle
Reply With Quote #1

Is it possible to share Trie handle between two plugins via natives and then retrieve data from it?

Sorry for not trying it out myself, I'm quite out of the server access now so I can't test it


I mean:

Code:
new Trie: TrieHandler public plugin_natives( )    register_native( "ShareTrie", "_ShareTrie" ) public _ShareTrie( Plugin, Params )    return _: TrieHandler

In another plugin:

Code:
new Trie: SharedHandle = ShareTrie( ) ... TrieGetString( SharedHandle, ... )

I think the example is not necessary, just to be sure everyone understands what I mean.

Thanks in advance
Backstabnoob is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-21-2011 , 15:53   Re: Sharing Trie handle
Reply With Quote #2

PHP Code:
#include <amxmodx>

public pTrie

public plugin_init()
{
    
pTrie _:TrieCreate()
    
TrieSetString(Trie:pTrie"hello""goodbye")

PHP Code:
#include <amxmodx>

public plugin_init()
{
    new 
pTrie get_xvar_num(get_xvar_id("pTrie"))
    
    new 
string[32]
    
TrieGetString(Trie:pTrie"hello"stringcharsmax(string))
    
    
server_print("Result: %s"string)

Result:

Code:
Result: goodbye
Quote:
Originally Posted by Backstabnoob View Post
Sorry for not trying it out myself, I'm quite out of the server access now so I can't test it
News Flash: Half-Life Servers are FREE.
__________________

Last edited by fysiks; 12-21-2011 at 15:55.
fysiks is offline
Reply



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:47.


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