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(PLUGIN, VERSION, AUTHOR)
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(id, authID, charsmax(authID))
new Data[256]
for(new i, a; i < UpgradeInfo; i++)
{
for(a; a < Teams; a++)
{
num_to_str(Level[i][a][id], Data, charsmax(Data))
nvault_set(TheVault, authID, Data)
}
}
return PLUGIN_CONTINUE
}
public LoadData(id)
{
new authID[35]
get_user_authid(id, authID, charsmax(authID))
new Data[256], Levels[32]
for(new i, a; i < UpgradeInfo; i++)
{
for(a; a < Teams; a++)
{
num_to_str(Level[i][a][id], Data, charsmax(Data))
nvault_get(TheVault, authID, Data, charsmax(Data))
parse(Data, Levels, charsmax(Levels))
Level[i][a][id] = str_to_num(Levels)
}
}
return PLUGIN_CONTINUE
}
And here is the line with the error
PHP Code:
for(a; a < Teams; a++)
And (dafuq) if I change it to
PHP Code:
for(a = 0; a < Teams; a++)
the error disappears, but it's not working...
Any help appereciated.
__________________