Raised This Month: $ Target: $400
 0% 

Help with save XP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KaPaTeJIb
Member
Join Date: Oct 2012
Location: Tbilisi
Old 10-05-2013 , 02:41   Help with save XP
Reply With Quote #1

HI all. I have army_ranks+math games plugin. In math games is random prizes and for example, I have one prize, that gives 4 XP to player...I do it, BUT when I change the map, XP doesn't save

PHP Code:
                        case 6:
                        {
                   
cs_set_user_money(idcs_get_user_money(id) + WinMoney)
                   
ColorChat(0,NORMAL,"^4Mogebuli ^3%s ^1| ^4Moigo: ^3%d$ ^1+ ^3 4 Gamocdileba ^1| ^4Pasuxi: ^3%d",szName,WinMoney,MAnswerget_pcvar_num(gBombPlantXp))
                   
set_task(0.1"MathXp"id)
                        } 
and

PHP Code:
public MathXp(id)
{
    
UserData[id][gExp] += get_pcvar_num(gBombPlantXp);

This is only XP prize code...
Also I've set giving XP with gBombPlantXP (I didn't want to add new cvar, something like gMathGamesXP...). And this is problem (Don't saving WINNER's XP). And please help me with this, just fix saving code of Winner's XP. Many thanks.

Last edited by KaPaTeJIb; 10-16-2013 at 13:29.
KaPaTeJIb is offline
Send a message via Skype™ to KaPaTeJIb
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 10-05-2013 , 02:44   Re: Help with save XP
Reply With Quote #2

Use nvault or sql to save the exp.
__________________




Last edited by dark_style; 10-05-2013 at 02:45.
dark_style is offline
KaPaTeJIb
Member
Join Date: Oct 2012
Location: Tbilisi
Old 10-05-2013 , 02:47   Re: Help with save XP
Reply With Quote #3

Quote:
Originally Posted by dark_style View Post
Use nvault or sql to save the exp.
This plugin is saves XP by this code:

PHP Code:
////////// save
public load_data(id)
{
    new 
stats[8],bodyhits[8], stats2[4];
    
get_user_stats(id,stats,bodyhits);
    
get_user_stats2(id,stats2);
            
    
UserData[id][gExp] = stats[0] + 2*stats[2] - get_pcvar_num(gLostXpTk)*stats[3] + get_pcvar_num(gBombDefuseXp)*stats2[1] + get_pcvar_num(gBombPlantXp)*stats2[2];
    
    if(
UserData[id][gLevel] <= 0)
        
UserData[id][gLevel] = 1;

    while(
UserData[id][gExp] >= gLevels[UserData[id][gLevel]])
    {    
        
UserData[id][gLevel]++;
        if(
UserData[id][gLevel] > 20)
            
UserData[id][gLevel] = 20;
    }

All XPs save good, but only ->> WINNER's XP <<- doesn't save, I want just a little fix of this...

Last edited by KaPaTeJIb; 10-05-2013 at 03:22.
KaPaTeJIb is offline
Send a message via Skype™ to KaPaTeJIb
Old 10-06-2013, 02:42
KaPaTeJIb
This message has been deleted by KaPaTeJIb. Reason: bumping...
Old 10-12-2013, 04:23
KaPaTeJIb
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Toooppiixx
New Member
Join Date: Oct 2013
Old 10-14-2013 , 05:34   Re: Help with save XP
Reply With Quote #4

No ideas....
Toooppiixx is offline
Old 10-14-2013, 10:55
KaPaTeJIb
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Old 10-21-2013, 15:58
KaPaTeJIb
This message has been deleted by YamiKaitou. Reason: Wait 14 days before you bump
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 06:38.


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