AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   trie array edit (https://forums.alliedmods.net/showthread.php?t=100634)

Owyn 08-16-2009 11:21

trie array edit
 
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

Alka 08-16-2009 12:24

Re: trie array edit
 
Go to -> amxmodx\scripting\testsuite and open trietest.sma, there you can see some trie manipulations and tests.

Owyn 08-16-2009 12:53

Re: trie array edit
 
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?

Alka 08-16-2009 15:44

Re: trie array edit
 
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 ?! :/

Owyn 08-17-2009 04:28

Re: trie array edit
 
i did, but not much explanation there)) i think i get it now, how to fully work with tries and how they work


All times are GMT -4. The time now is 15:01.

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