Jump to content
Sign in to follow this  
Cly

[PAWN]: Level bar

Recommended Posts

Posted (edited)

Salutare,  va voi prezenta un tutorial cu un sistem de nivel bar, poate sa va fie destul de folositor. 

 

 

  • Sa incepem :
Quote
  1. #include <a_samp>           // includurile sunt obigatorii definite in gamemode-ul d-vs.
  2. #include <playerprogress>
  3.  
  4.  
  5. public OnPlayerDisconnect(playerid, reason)
  6. {
  7.         DestroyPlayerProgressBar(playerid, HudProgress[playerid][0]); // la deconectarea jucatorului, levelbar-ul va disparea.
  8.     }
  9.     return 1;
  10. }
  11. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  12. {  
  13.  
  14.     case DIALOG_HUD_3:
  15.         {
  16.             if(!response) return 1;
  17.             switch(pInfo[playerid][pShowBarLevel])
  18.             {
  19.                 case 0: pInfo[playerid][pShowBarLevel] = 1, SendClientMessage(playerid, COLOR_ORANGE, "(Progress Level): Ai activat optiunea 'Progress Level'."), ShowPlayerProgressBar(playerid, HudProgress[playerid][0]), UpdateProgress(playerid, 0);
  20.                 case 1: pInfo[playerid][pShowBarLevel] = 0, SendClientMessage(playerid, COLOR_ORANGE, "(Progress Level): Ai dezactivat optiunea 'Progress Level'."), HidePlayerProgressBar(playerid, HudProgress[playerid][0]), PlayerTextDrawHide(playerid, HudTD[0]);
  21.             }
  22.         }
  23.     return 1;
  24. }
  25. forward FinishReg(playerid);
  26. public FinishReg(playerid)
  27. {
  28.     HudProgress[playerid][0] = CreatePlayerProgressBar(playerid, 513.00, 150.00, 85.50, 2.50, 0x00FF00FF, 100.0);//levelbar
  29.     switch(pInfo[playerid][pShowBarLevel]) // Aici, afiseaza level bar-ul.
  30.     {
  31.         case 0: HidePlayerProgressBar(playerid, HudProgress[playerid][0]); // Aici va ascunde textul.
  32.         case 1: UpdateProgress(playerid, 0), ShowPlayerProgressBar(playerid, HudProgress[playerid][0]), UpdateProgress(playerid, 0); // Va progresa in functie de respect point / level.
  33.     }
  34.     return 1;
  35. }

 

  •  Dupa cele aratate, asa va arata level bar-ul dumneavoastra: https://imgur.com/a/3LTYB7P
  • Daca aveti intrebari sau nelamuriri rog sa trimiteti un PM.

 

 

Edited by Cly

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×