Jump to content
  • 0

Problema progressbar


StrypS

Question

Salut all, am si eu o problema cu progreesbar nu se afiseaza pe server cand ma loghez, am facut si un textdraw pentru progressbar care arata cam asa exemplu: Level 1 (2/6 RP), nici acesta nu este afisat o sa va dau toate coordonatele adaugate de mine, nu mai scriu unde sunt adaugate ca sa mai uitat prin el 2 scripteri si au zis ca sunt bine asezate si nu stiu dece nu merg




new PlayerText:LevelTD[MAX_PLAYERS];  //textdraw
new PlayerBar:LevelBar[MAX_PLAYERS]; //progressbar





    LevelTD[playerid] = CreatePlayerTextDraw(playerid, 554.666503, 124.874069, "Level: 5 (28/30 RP)");
    PlayerTextDrawLetterSize(playerid, LevelTD[playerid], 0.190333, 1.077333);
    PlayerTextDrawAlignment(playerid, LevelTD[playerid], 2);
    PlayerTextDrawColor(playerid, LevelTD[playerid], -1);
    PlayerTextDrawSetShadow(playerid, LevelTD[playerid], 0);
    PlayerTextDrawSetOutline(playerid, LevelTD[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, LevelTD[playerid], 58);
    PlayerTextDrawFont(playerid, LevelTD[playerid], 2);
    PlayerTextDrawSetProportional(playerid, LevelTD[playerid], 1);
    PlayerTextDrawSetShadow(playerid, LevelTD[playerid], 0);



 

UpdateProgressBar(playerid) 
{
    new string[64], expamount;
    if(PlayerInfo[playerid][pLevel] == 1 || PlayerInfo[playerid][pLevel] == 2 || PlayerInfo[playerid][pLevel] == 3 || PlayerInfo[playerid][pLevel] == 4) expamount = PlayerInfo[playerid][pLevel]*2;
    else if(PlayerInfo[playerid][pLevel] >= 5) expamount = PlayerInfo[playerid][pLevel]*levelexp;
    
    format(string, sizeof(string), "Level: %d (%d/%d RP)", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pExp], expamount);
    PlayerTextDrawSetString(playerid, LevelTD[playerid], string);

    SetPlayerProgressBarValue(playerid, LevelBar[playerid], PlayerInfo[playerid][pExp]);
    
    return 1;
}

ShowProgressBar(playerid)
{
    expamount;
    if(PlayerInfo[playerid][pLevel] == 1 || PlayerInfo[playerid][pLevel] == 2 || PlayerInfo[playerid][pLevel] == 3 || PlayerInfo[playerid][pLevel] == 4) expamount = PlayerInfo[playerid][pLevel]*2;
    else if(PlayerInfo[playerid][pLevel] >= 5) expamount = PlayerInfo[playerid][pLevel]*levelexp;

    LevelBar[playerid] = CreatePlayerProgressBar(playerid, 505.00, 138.00, 99.50, 3.50, -213077640, 100.0);

    SetPlayerProgressBarMaxValue(playerid, LevelBar[playerid], expamount);
    SetPlayerProgressBarValue(playerid, LevelBar[playerid], PlayerInfo[playerid][pExp]);
    ShowPlayerProgressBar(playerid, LevelBar[playerid]);

    PlayerTextDrawShow(playerid, LevelTD[playerid]);

    UpdateProgressBar(playerid); 

    return 1;
}






DestroyPlayerProgressBar(playerid, LevelBar[playerid]);

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.