Raised This Month: $ Target: $400
 0% 

Load xp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 07-30-2011 , 08:59   Load xp
Reply With Quote #1

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(PLUGINVERSIONAUTHOR)
    
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_costZP_TEAM_HUMAN)
}

public 
zp_extra_item_selected(iditemid)
{    
        if (
itemid == g_iBuy)
        {
            
        
client_print(idprint_chat"[ZP] Tu ismainiai ammo paketus i ginklu xp")
        {
    }

}

public 
givexp(id)
{
            new 
szData[256]
            new 
szKey[40]

            
formatexszKey 39 "%s-ID" g_szAuthID[id] )

            
formatex(szData 255"%i#%i#"PlayerLevel[id], PlayerXp[id]) 
            
            
nvault_get(g_VaultszKeyszData255

            
replace_all(szData 255"#"" ")
            new 
xp[32], level[32
            
parse(szDatalevel31xp31
            
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).
usaexelent is offline
Send a message via Skype™ to usaexelent
Aykay
Senior Member
Join Date: Jul 2009
Location: Australia
Old 07-30-2011 , 09:42   Re: Load xp
Reply With Quote #2

You haven't defined g_szAuthID, not have a place to call the function "givexp".

Your code is really mixed up, is it part of a bigger plugin?
__________________

Aykay is offline
Send a message via MSN to Aykay
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 07-30-2011 , 10:53   Re: Load xp
Reply With Quote #3

Yes, Thats a part of gun xp mod, I'm trying to make zombie item.
usaexelent is offline
Send a message via Skype™ to usaexelent
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 18:53.


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