Raised This Month: $ Target: $400
 0% 

Help with XP plz


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Zapdos1
BANNED
Join Date: Jul 2009
Location: Chile - La Serena
Old 12-23-2009 , 18:35   Help with XP plz
Reply With Quote #1

well, i was testing this plugin, and the thing is what, when i kill somebody, it doesn't give me XP

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>  

new PlayerXP[33],PlayerLevel[33
new 
XP_KillSaveXP
new g_vault  

new const LEVELS[7] = { 010020040080016003200 }  

public 
plugin_init() 
{
    
register_plugin("Boxing_levels""1.0""Zapdos1")
    
    
//Cvars 
    
SaveXP register_cvar("amx_svxp","1")
    
XP_Kill=register_cvar("amx_xpkill""20")
    
    
//nvault
    
g_vault nvault_open("boxingmodd")
    
    
//clcmd
    
register_clcmd("say /myboxxp""ShowHud")
    
    
//dictionary
    
register_dictionary("boxing.txt")
}

public 
eDeath(  ) 
{
    new 
attacker read_data(1)
    
    
PlayerXP[attacker] += get_pcvar_num(XP_Kill
    
    while(
PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]]) 
    { 
        
client_print(attackerprint_chat"[AMXX] %L"LANG_PLAYER"LEVEL_MESSAGE"PlayerLevel[attacker]) 
        
PlayerLevel[attacker] += 
    

    
    
ShowHud(attacker)
}

public 
ShowHud(id

   
set_hudmessage(255000.10.806.012.0
   
show_hudmessage(id"Level: %i^nXP: %i",PlayerLevel[id],PlayerXP[id])  
}  

public 
client_connect(id
{
    if(
get_pcvar_num(SaveXP) == 1
    { 
        
LoadData(id
    } 
}  

public 
SaveData(id

    new 
AuthID[35
    
get_user_authid(id,AuthID,34)
 
    new 
vaultkey[64],vaultdata[256
    
format(vaultkey,63,"%s-Mod",AuthID
    
format(vaultdata,255,"%i#%i#",PlayerXP[id],PlayerLevel[id]) 
    
nvault_set(g_vault,vaultkey,vaultdata
    return 
PLUGIN_CONTINUE 


public 
LoadData(id

    new 
AuthID[35
    
get_user_authid(id,AuthID,34)  

    new 
vaultkey[64],vaultdata[256
    
format(vaultkey,63,"%s-Mod",AuthID
    
format(vaultdata,255,"%i#%i#",PlayerXP[id],PlayerLevel[id]) 
    
nvault_get(g_vault,vaultkey,vaultdata,255
    
replace_all(vaultdata255"#"" "
    new 
playerxp[32], playerlevel[32
    
parse(vaultdataplayerxp31playerlevel31
    
PlayerXP[id] = str_to_num(playerxp
    
PlayerLevel[id] = str_to_num(playerlevel
    return 
PLUGIN_CONTINUE 

Zapdos1 is offline
 



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 04:09.


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