Advertisement
Buthers

Catégories Pawn

Mar 12th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.44 KB | None | 0 0
  1. #define MAX_HOME_CATEGORIES (4)
  2.  
  3. new HomeCategories[MAX_HOME_CATEGORIES][] =
  4. {
  5.     "Dernières nouveautés",
  6.     "Dernière mise à jour",
  7.     "Connexion",
  8.     "Crédits"
  9. };
  10.  
  11. enum aHomeCategories
  12. {
  13.     hcID,
  14.     Text:hcBackground,
  15.     Text:hcText,
  16.     hcString[45],
  17.     Float:hcPositionY
  18. };
  19. new HOMECATEGORY[MAX_HOME_CATEGORIES][aHomeCategories];
  20.  
  21. public OnPlayerRequestLogin(playerid)
  22. {
  23.     if(cache_num_rows() > 0)
  24.     {
  25.         clearChat(playerid, 20);
  26.         for(new td = 0; td <= sizeof(TDHome); td++)
  27.         {
  28.             TextDrawShowForPlayer(playerid, TDHome[td]);
  29.         }
  30.         showPlayerHomeCategories(playerid);
  31.     }
  32.     return 1;
  33. }
  34.  
  35. stock showPlayerHomeCategories(playerid)
  36. {
  37.     new Float:categoryBoxPositionY = 98.151855;
  38.     for(new hc = 0; hc < sizeof(HomeCategories); hc++)
  39.     {
  40.         categoryBoxPositionY += 20.000000;
  41.         HOMECATEGORY[hc][hcPositionY] = categoryBoxPositionY;
  42.         HOMECATEGORY[hc][hcBackground] = TextDrawCreate(278.333435, HOMECATEGORY[hc][hcPositionY], "usebox");
  43.         TextDrawLetterSize(HOMECATEGORY[hc][hcBackground], 0.000000, 1.519136);
  44.         TextDrawTextSize(HOMECATEGORY[hc][hcBackground], 98.666687, 0.000000);
  45.         TextDrawAlignment(HOMECATEGORY[hc][hcBackground], 1);
  46.         TextDrawColor(HOMECATEGORY[hc][hcBackground], 0);
  47.         TextDrawUseBox(HOMECATEGORY[hc][hcBackground], true);
  48.         TextDrawBoxColor(HOMECATEGORY[hc][hcBackground], 102);
  49.         TextDrawSetShadow(HOMECATEGORY[hc][hcBackground], 0);
  50.         TextDrawSetOutline(HOMECATEGORY[hc][hcBackground], 0);
  51.         TextDrawFont(HOMECATEGORY[hc][hcBackground], 0);
  52.         HOMECATEGORY[hc][hcText] = TextDrawCreate(102.999961, HOMECATEGORY[hc][hcPositionY]+1.000000, "");
  53.         TextDrawLetterSize(HOMECATEGORY[hc][hcText], 0.229333, 1.579259);
  54.         TextDrawAlignment(HOMECATEGORY[hc][hcText], 1);
  55.         TextDrawColor(HOMECATEGORY[hc][hcText], -1);
  56.         TextDrawSetShadow(HOMECATEGORY[hc][hcText], 0);
  57.         TextDrawSetOutline(HOMECATEGORY[hc][hcText], 1);
  58.         TextDrawBackgroundColor(HOMECATEGORY[hc][hcText], 51);
  59.         TextDrawFont(HOMECATEGORY[hc][hcText], 1);
  60.         TextDrawSetProportional(HOMECATEGORY[hc][hcText], 1);
  61.         TextDrawSetSelectable(HOMECATEGORY[hc][hcText], true);
  62.         format(HOMECATEGORY[hc][hcString], 45, HomeCategories[hc]);
  63.         set_UTF8(HOMECATEGORY[hc][hcString]);
  64.         TextDrawSetString(HOMECATEGORY[hc][hcText], HOMECATEGORY[hc][hcString]);
  65.         TextDrawShowForPlayer(playerid, HOMECATEGORY[hc][hcBackground]);
  66.         TextDrawShowForPlayer(playerid, HOMECATEGORY[hc][hcText]);
  67.         SelectTextDraw(playerid, COLOR_GREY);
  68.         HOMECATEGORY[hc][hcID] = hc;
  69.     }
  70.     return 1;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement