Raised This Month: $32 Target: $400
 8% 

[SOLVED] bit enum - trie cell


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 05-07-2014 , 19:51   [SOLVED] bit enum - trie cell
Reply With Quote #1

Is it possible to set enum value as trie cell?

Code:
enum _:Files ( <<=1 ) {     FILE = 1,     FILE1,     FILE2 } new const global_sFiles[ ][ ] = {     "file.mdl",     "file1.mdl",     "file2.mdl" } new global_iFlags[ 33 ]; new Trie:global_tFiles; public plugin_init( ) {     global_tFiles = TrieCreate( );         for( new i = 0; i < sizeof global_sFiles; i++ )         TrieSetCell( global_tFiles, global_sFiles[ i ], /* ENUM VALUE */ ); } public setFlag( id, sFile[ ] ) {     new iCell;     if( TrieGetCell( global_tFiles, sFile, iCell ) )     {         global_iFlags[ id ] |= iCell; /* I GET TAG MISMATCH IF I SET I + 1 AS CELL */     }    }

Last edited by OvidiuS; 05-08-2014 at 07:28.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-07-2014 , 20:04   Re: bit enum - trie cell
Reply With Quote #2

Works fine for me. Could you check and make sure you give us the correct plugin test. Show it without modifying so we can test at it is.
__________________

Last edited by Arkshine; 05-07-2014 at 20:05.
Arkshine is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 05-07-2014 , 21:03   Re: bit enum - trie cell
Reply With Quote #3

Weird. I tried to compile with web compiler, everything is working fine :s
Code:
#include < amxmodx > enum _:Files ( <<=1 ) {     FILE,     FILE1,     FILE2 } new const global_sFiles[ ][ ] = {     "file.mdl",     "file1.mdl",     "file2.mdl" } new global_iFlags[ 33 ]; new Trie:global_tFiles; public plugin_init( ) {     global_tFiles = TrieCreate( );         for( new i = 0; i < sizeof global_sFiles; i++ )         TrieSetCell( global_tFiles, global_sFiles[ i ], i ); } public client_putinserver( id ) {     setFlag( id, "file.mdl" ); } public setFlag( id, sFile[ ] ) {     new iCell;     if( TrieGetCell( global_tFiles, sFile, iCell ) )     {         global_iFlags[ id ] |= iCell;     }    }
I'll check later on local compiler.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Reply


Thread Tools
Display Modes

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


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