Raised This Month: $ Target: $400
 0% 

Three parameter matrix - nvault saving


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-08-2014 , 13:16   Three parameter matrix - nvault saving
Reply With Quote #1

Okay guys, it's about an upgrade menu. I have a variable - Level, which contains three parameters - upgrade type, team to upgrade and index. Well, I have problems with saving it into a nvaul. Tha strange thing is, that the first parameter (the HP upgrade) is not saving... The others are okay, but the first one is not saving... Also I want to say, that in the second loop with the "a", there is an error, but it's working. And if I change it to "a = 0", the error disappears, but the whole saving is not working... And I'm like mindblowing here, I don't know why this problem appears. Here is all I someone would need to see the situation.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <nvault>

#define PLUGIN "X"
#define VERSION "1.0"
#define AUTHOR "Flicker"

new TheVault

enum _
:UpgradeInfo
{
    
HP,
    
Armor,
    
Grenades,
    
NoFallDamage,
    
Respawn,
    
CritDmg
}

enum _:Teams
{
    
UN,
    
T,
    
CT,
    
SPEC
}

new 
Level[UpgradeInfo][Teams][33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
TheVault nvault_open("SaveUpgrades")
}

public 
client_disconnect(id)
    
SaveData(id)
    
public 
client_connect(id)
    
LoadData(id)

public 
SaveData(id)
{
    new 
authID[35]
    
get_user_authid(idauthIDcharsmax(authID))
    
    new 
Data[256]
    for(new 
iaUpgradeInfoi++)
    {
        for(
aTeamsa++)
        {
            
num_to_str(Level[i][a][id], Datacharsmax(Data))
            
nvault_set(TheVaultauthIDData)
        }
    }
    
    return 
PLUGIN_CONTINUE
}
    
    
public 
LoadData(id)
{
    new 
authID[35]
    
get_user_authid(idauthIDcharsmax(authID))
    
    new 
Data[256], Levels[32]
    for(new 
iaUpgradeInfoi++)
    {
        for(
aTeamsa++)
        {
        
            
num_to_str(Level[i][a][id], Datacharsmax(Data))
            
nvault_get(TheVaultauthIDDatacharsmax(Data))
        
            
parse(DataLevelscharsmax(Levels))
        
            
Level[i][a][id] = str_to_num(Levels)
        }
    }
    
    return 
PLUGIN_CONTINUE
    

And here is the line with the error
PHP Code:
for(aTeamsa++) 
And (dafuq) if I change it to
PHP Code:
for(0Teamsa++) 
the error disappears, but it's not working...
Any help appereciated.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
 


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


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