Raised This Month: $ Target: $400
 0% 

trie array edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 08-16-2009 , 11:21   trie array edit
Reply With Quote #1

hi, i read the tutorial about tries and looked into plugins which uses it, but still i want to know about a command in amxx to edit trie cell and its usage, i need to edit some data in the trie array, few fields of it to be exact
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-16-2009 , 12:24   Re: trie array edit
Reply With Quote #2

Go to -> amxmodx\scripting\testsuite and open trietest.sma, there you can see some trie manipulations and tests.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 08-16-2009 , 12:53   Re: trie array edit
Reply With Quote #3

PHP Code:
TrieSetString(Trie:trie,key,value
PHP Code:
TrieSetCell(Trie:trie,key,value); 
looks like i need something of these, what is the difference? and how do i specify the key position in the array?


this way i get data
PHP Code:
static data[BannedData];
        
ArrayGetArray(trie_arrayarray_posdata); 
and how do i write changed data back?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-16-2009 , 15:44   Re: trie array edit
Reply With Quote #4

The difference is that one native is used for storing a string value and other for cell value.To retrieve a value from a key you must use a TrieGet* native not ArrayGet*, and the type of value you want: string/cell/array.For setting data back you just need to know the KeyName, it's like nvault, data will be overwrited.Didn't you read trietest.sma ?! :/
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 08-17-2009 , 04:28   Re: trie array edit
Reply With Quote #5

i did, but not much explanation there)) i think i get it now, how to fully work with tries and how they work
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
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 15:01.


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