So how Can i load gun xp, I'm doing Gun xp for ammo packs plugin, And I want to load xp store information to arrays and the add xp to array and then save it.
This is what i tried:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <gunxpmod>
#include <zombieplague>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new costammo
new xpgain
new g_iBuy
new i_cost
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
costammo = register_cvar("cost_ammo", "10")
xpgain = register_cvar("xp_gain","20")
i_cost = get_pcvar_num(costammo)
g_iBuy = zp_register_extra_item("Gun xp", i_cost, ZP_TEAM_HUMAN)
}
public zp_extra_item_selected(id, itemid)
{
if (itemid == g_iBuy)
{
client_print(id, print_chat, "[ZP] Tu ismainiai ammo paketus i ginklu xp")
{
}
}
public givexp(id)
{
new szData[256]
new szKey[40]
formatex( szKey , 39 , "%s-ID" , g_szAuthID[id] )
formatex(szData , 255, "%i#%i#", PlayerLevel[id], PlayerXp[id])
nvault_get(g_Vault, szKey, szData, 255)
replace_all(szData , 255, "#", " ")
new xp[32], level[32]
parse(szData, level, 31, xp, 31)
PlayerLevel[id] = str_to_num(level)
PlayerXp[id] = str_to_num(xp)
But this is what i get:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Warning: Loose indentation on line 35
Error: Invalid expression, assumed zero on line 35
Error: Undefined symbol "givexp" on line 35
Error: Undefined symbol "g_szAuthID" on line 40
Warning: Expression has no effect on line 40
Error: Expected token: ";", but found "]" on line 40
Error: Invalid expression, assumed zero on line 40
Error: Too many error messages on one line on line 40
Compilation aborted.
6 Errors.
Could not locate output file C:\Program Files\AMX Mod X\amxxstudio\Untitled.amx (compile failed).