[Ajuda] Sistema EXP
#2

Mano sу entendi essa parte :
Quote:

Bom meu sistema de exp tб com um problema que tipo quando upo a progress bar nгo reinicia do 0

Explica melhor,por partes ai.
Veja se a progress bar vai reiniciar agora :
PHP код:
enum ZXP 

    
pEXP 
}; 
// ~~> Config. Experience 
new Text:TDXP[1]; 
new 
Point[MAX_PLAYERS][ZXP]; 
new 
Bar:BARXP[MAX_PLAYERS]; 
// ~~> Forwards 
forward GetValueXP(playerid); 
forward Experience(playeridvalue); 
public 
OnGameModeInit() 

    
SetTimer("Experience"1000true); 
    
SetTimer("UpdateBar"1000true); 
// ~~> Contagem de XP 
    
TDXP[0] = TextDrawCreate(575.50793457.164325"1000/9000"); 
    
TextDrawAlignment(TDXP[0], 2); 
    
TextDrawBackgroundColor(TDXP[0], 16); 
    
TextDrawFont(TDXP[0], 2); 
    
TextDrawLetterSize(TDXP[0], 0.1501560.595465); 
    
TextDrawColor(TDXP[0], 0xCD0000FF); 
    
TextDrawSetOutline(TDXP[0], 1); 
    
TextDrawSetProportional(TDXP[0], 1); 
    
TextDrawSetSelectable(TDXP[0], 0); 
    return 
true

public 
OnPlayerRequestClass(playeridclassid

    
Experience(playerid0); 
    return 
1

public 
OnPlayerSpawn(playerid

// ~~ EXP 
    
Experience(playerid0); 
    
BARXP[playerid] = CreateProgressBar(548.0058.0057.504.19, -492364374100.0); 
    
TextDrawShowForPlayer(playeridTDXP[0]); 
    
ShowProgressBarForPlayer(playeridBARXP[playerid]); 
    return 
1

public 
OnPlayerDeath(playeridkilleridreason

    
Player[playerid][Died]++; 
    
Player[killerid][Killed]++; 
    
SendDeathMessage(killeridplayeridreason); 
    if(
killerid != INVALID_PLAYER_ID
    { 
        if(
IsPlayerConnected(killerid)) 
        { 
            if(
Player[playerid][pXOne] && Player[killerid][pXOne]) 
            { 
                
Player[playerid][pXOne] = false
                
Player[killerid][pXOne] = false
                
SetPlayerVirtualWorld(playerid0); 
                
SetPlayerVirtualWorld(killerid0); 
                
SetPlayerInterior(playerid0); 
                
SetPlayerInterior(killerid0); 
                
SendFormattedMessage(killeridCOLOR_TEAL""TAG_SERVER" Vocк venceu o player %s no X1."GetName(playerid)); 
                
SendFormattedMessage(playeridCOLOR_TEAL""TAG_SERVER" Vocк perdeu para o player %s no X1."GetName(killerid)); 
                
Player[killerid][XOneWin]++; 
                
SpawnPlayer(killerid); 
                
SpawnPlayer(playerid); 
            } 
            
Experience(killerid4); 
            
GivePlayerMoney(killerid100); 
            
PlayerPlaySound(killerid10570.00.00.0); 
            
GameTextForPlayer(killerid"DOUBLE XP!!~n~VOCE GANHOU 4 XP!!!!"30003); 
            
UpdateBar(killerid); 
        } 
    } 
    return 
1

public 
GetValueXP(playerid

    static 
value
    if(
Player[playerid][Score] == 0
    
value 4
    else 
    
value Player[playerid][Score] * 8
    return 
value

//============================================================================== 
public Experience(playeridvalue

    
Point[playerid][pEXP] += value
    if(
Point[playerid][pEXP] >= GetValueXP(playerid)) 
    { 
        
Point[playerid][pEXP] = 0
        
Player[playerid][Score] += 1
        
SetPlayerScore(playeridPlayer[playerid][Score]); 
        
GameTextForPlayer(playerid"~y~VOCE UPOU DE LEVEL!!!!"30003); 
        
SetProgressBarValue(BARXP[playerid],0);
        
UpdateBar(playerid); 
        
Salvar_Conta(playerid); 
        return 
1
    } 
    
UpdateBar(playerid); 
    return 
1

//============================================================================== 
forward UpdateBar(playerid); 
public 
UpdateBar(playerid

    
SetProgressBarValue(BARXP[playerid], Point[playerid][pEXP]); 
    
SetProgressBarMaxValue(BARXP[playerid], GetValueXP(playerid)); 
    
UpdateProgressBar(BARXP[playerid], playerid); 
    new 
str[100]; 
    
format(strsizeof(str), "%d/%d"Point[playerid][pEXP], GetValueXP(playerid)); 
    
TextDrawSetString(TDXP[0], str); 
    return 
1

Reply


Messages In This Thread
Sistema EXP - by BrGabrielBr - 19.03.2018, 15:42
Re: Sistema EXP - by FerrariL - 19.03.2018, 15:57
Re: Sistema EXP - by BrGabrielBr - 19.03.2018, 16:24
Re: Sistema EXP - by Don_Speed - 20.03.2018, 14:45
Re: Sistema EXP - by BrGabrielBr - 20.03.2018, 18:12
Re: Sistema EXP - by Don_Speed - 20.03.2018, 19:09
Re: Sistema EXP - by Injury - 20.03.2018, 19:42
Re: Sistema EXP - by BrGabrielBr - 20.03.2018, 20:09

Forum Jump:


Users browsing this thread: 1 Guest(s)