Raised This Month: $ Target: $400
 0% 

[SolveD] nVault/Trie Help: Buggged


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-03-2010 , 13:22   [SolveD] nVault/Trie Help: Buggged
Reply With Quote #1

If I use: SlideRace_Load()
L 07/03/2010 - 20:15:23: [AMXX] Run time error 10: native error (native "TrieSetCell")
L 07/03/2010 - 20:15:23: [AMXX] [0] SlideRace.sma::SlideRace_Load (line 560)

Line: 560
PHP Code:
    TrieSetCell(MapRecordmapnameiTime
PHP Code:
public SlideRace_Save() {
    new 
mapname[32], data[129];
    new 
iTimeiPlayeriWins;
    
get_mapname(mapname31)

    
TrieGetCell(MapRecordmapnameiTime)
    
TrieGetCell(MapPlayermapnameiPlayer)
    
TrieGetCell(MapWinsmapnameiWins)

    new 
key[72], stats[34];
    
formatex(key71"%s-stats"mapname);
    
formatex(stats33"%i %i %i"iTimeiPlayeriWins);
    
nvault_set(g_srVaultkeystats);
    
nvault_set(g_srVaultmapnamedata);
    return 
PLUGIN_CONTINUE;
}
public 
SlideRace_Load() {
    new 
mapname[32], data[129];
    
get_mapname(mapname31)
    
    new 
key[72], stats[34], stat[3][12];
    
formatex(key71"%s-stats"mapname);
    
    
nvault_get(g_srVaultkeystats33);
    
parse(statsstat[0], 11stat[1], 11stat[2], 11);
    
    new 
iTime str_to_num(stat[0]);
    new 
iPlayer str_to_num(stat[1]);
    new 
iWins str_to_num(stat[2]);
    
TrieSetCell(MapRecordmapnameiTime)
    
TrieSetCell(MapPlayermapnameiPlayer)
    
TrieSetCell(MapWinsmapnameiWins)
    
nvault_get(g_srVaultmapnamedata128);
    return 
PLUGIN_CONTINUE;

__________________
Retired.

Last edited by Xalus; 07-03-2010 at 14:19.
Xalus is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 07-03-2010 , 13:47   Re: nVault/Trie Help: Buggged
Reply With Quote #2

You probably used invalid trie handle, but I'm not sure if it really is the cause, because that fragment of code is not enough and also the error log is incomplete.
__________________
Impossible is Nothing
Sylwester is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-03-2010 , 13:49   Re: nVault/Trie Help: Buggged
Reply With Quote #3

L 07/03/2010 - 20:15:23: Start of error session.
L 07/03/2010 - 20:15:23: Info (map "sr_gridded_final") (file "addons/amxmodx/logs/error_20100703.log")
L 07/03/2010 - 20:15:23: Invalid trie handle provided (0)
L 07/03/2010 - 20:15:23: [AMXX] Displaying debug trace (plugin "SlideRace.amxx")
L 07/03/2010 - 20:15:23: [AMXX] Run time error 10: native error (native "TrieSetCell")
L 07/03/2010 - 20:15:23: [AMXX] [0] SlideRace.sma::SlideRace_Load (line 560)
L 07/03/2010 - 20:15:23: [AMXX] [1] SlideRace.sma::plugin_init (line 126)


PHP Code:
new Trie:MapRecordTrie:MapPlayerTrie:MapWinsg_vault
__________________
Retired.
Xalus is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 07-03-2010 , 13:59   Re: nVault/Trie Help: Buggged
Reply With Quote #4

Just as I thought. You declared handles, but did you do this:
PHP Code:
public plugin_init(){
    
MapRecord TrieCreate()
    
MapPlayer TrieCreate()
    
MapWins TrieCreate()
}

public 
plugin_end(){
    
TrieDestroy(MapRecord)
    
TrieDestroy(MapPlayer)
    
TrieDestroy(MapWins)

?
__________________
Impossible is Nothing
Sylwester is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-03-2010 , 14:00   Re: nVault/Trie Help: Buggged
Reply With Quote #5

PHP Code:
public plugin_cfg() {
    
MapRecord TrieCreate()
    
MapPlayer TrieCreate()
    
MapWins TrieCreate()
}

public 
plugin_end() {
    
nvault_close(g_vault);
    
TrieDestroy(MapRecord)
    
TrieDestroy(MapPlayer)
    
TrieDestroy(MapWins)

__________________
Retired.
Xalus is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 07-03-2010 , 14:04   Re: nVault/Trie Help: Buggged
Reply With Quote #6

Do you use SlideRace_Load() in plugin_init ?

EDIT: ahh, you do, it's in error log...
Create tries in plugin_init before using SlideRace_Load(), not in plugin_cfg.
__________________
Impossible is Nothing
Sylwester is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-03-2010 , 14:06   Re: nVault/Trie Help: Buggged
Reply With Quote #7

Ah thanks!
-> I gonne test it now.
__________________
Retired.
Xalus 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 07:11.


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