Raised This Month: $ Target: $400
 0% 

Plugin end


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Ex3cuTioN
Member
Join Date: May 2010
Old 08-01-2010 , 04:13   Plugin end
Reply With Quote #1

I have a xp mod, based on jumping

When the player disconnects from the servers the xp is saving
When he is connecting the xp is loading

But when the map change the xp goes to 0

how can i put

PHP Code:
public plugin_end(){
    
SaveData(id);
    
nvault_close(g_vault);

PHP Code:
public SaveData(id) { 
    new 
vaultkey[45];
    new 
vaultdata[12];

    
format(vaultkey,44,"%s-Mod",g_szAuthID[id]);
    
format(vaultdata,11,"%d %d",PlayerXP[id],PlayerLevel[id]);

    
nvault_set(g_vault,vaultkey,vaultdata);

PHP Code:
public LoadData(id) {
    new 
vaultkey[45];
    new 
vaultdata[12];

    
format(vaultkey,44,"%s-Mod",g_szAuthID[id]);
    
    if(
nvault_get(g_vault vaultkey vaultdata 11)) {
        new 
iSpacePos containvaultdata ," ");
        
        if ( 
iSpacePos > -)
        {
            new 
playerxp[12];
            new 
playerlevel[4];
            
            
formatexplayerxp iSpacePos "%s" vaultdata );
            
formatexplayerlevel "%s" vaultdata[iSpacePos 1]);
            
            
PlayerXP[id] = str_to_num(playerxp);
            
PlayerLevel[id] = str_to_num(playerlevel);
        }
    }
    else {
        
ColorChat(id,GREEN,"[PuncteExperienta]^x01 Nu ai puncte salvate in baza de date");
    }


Last edited by Ex3cuTioN; 08-01-2010 at 04:57.
Ex3cuTioN 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 00:14.


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