Raised This Month: $ Target: $400
 0% 

make xp start all over


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Drak
Veteran Member
Join Date: Jul 2005
Old 04-14-2007 , 15:30   Re: make xp start all over
Reply With Quote #7

Quote:
Originally Posted by Dark Kingdom View Post
The function for Load and Save:
PHP Code:
public LoadXP(id)
{
    new 
authid[32]; 
    
get_user_authid(id,authid,31); 

    new 
vaultkey[64], vaultdata[64]; 

    
//Load their class
    
format(vaultkey,63,"ANIMAL-%s-class",authid); 
    
get_vaultdata(vaultkey,vaultdata,63); 
    
PlayerClass[id] = str_to_num(vaultdata); 

     
//Load their XP
    
format(vaultkey,63,"ANIMAL-%s-xp",authid); 
    
get_vaultdata(vaultkey,vaultdata,63); 
    
PlayerXP[id] = str_to_num(vaultdata);   

    
//Load their level
    
format(vaultkey,63,"ANIMAL-%s-level",authid); 
    
get_vaultdata(vaultkey,vaultdata,63);
    
PlayerLevel[id] = str_to_num(vaultdata);  

Load their XP when they connect:
PHP Code:
public client_connect(id)
{
    if(
get_cvar_num("SaveXP") == 1) {
       
         
LoadXP(id)

    
client_print(idprint_chat"[Animal Mod] XP Loaded!")
         
client_print(idprint_chat"[Animal Mod] You are a %s with level %s and %s XP"PlayerClass[id], PlayerLevel[id], PlayerXP[id])
    } 
Save their XP when they disconnect:
PHP Code:
public client_disconnect(id)
{
    if(
get_cvar_num("SaveXP") == 1) {
    
         
SaveXP(id)
    }

Changed it a little bit.
You're missing brackets and...stuff. This will not compile.
__________________
Oh yeah

Last edited by Drak; 04-14-2007 at 19:10.
Drak is offline
Send a message via MSN to Drak
 



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 06:35.


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