Advertisement
proSeryoga

Untitled

Mar 12th, 2013
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 12.52 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Text: Rang[MAX_PLAYERS][3],
  4.         Text: Stars[MAX_PLAYERS][14];
  5.  
  6. public OnPlayerConnect(playerid)
  7. {
  8.         Rang[playerid][0] = TextDrawCreate(142.000000, 378.000000, " ");
  9.         TextDrawBackgroundColor(Rang[playerid][0], 0x00000033);
  10.         TextDrawFont(Rang[playerid][0], 2);
  11.         TextDrawLetterSize(Rang[playerid][0], 0.2499, 1.2999);
  12.         TextDrawColor(Rang[playerid][0], -1);
  13.         TextDrawSetOutline(Rang[playerid][0], 1);
  14.         TextDrawSetProportional(Rang[playerid][0], 1);
  15.  
  16.         Rang[playerid][1] = TextDrawCreate(139.000000, 390.000000, " ");
  17.         TextDrawBackgroundColor(Rang[playerid][1], 0x00000033);
  18.         TextDrawFont(Rang[playerid][1], 2);
  19.         TextDrawLetterSize(Rang[playerid][1], 0.2499, 1.2999);
  20.         TextDrawColor(Rang[playerid][1], -1);
  21.         TextDrawSetOutline(Rang[playerid][1], 1);
  22.         TextDrawSetProportional(Rang[playerid][1], 1);
  23.  
  24.         Rang[playerid][2] = TextDrawCreate(155.000000, 351.000000, " ");
  25.         TextDrawFont(Rang[playerid][2], 2);
  26.         TextDrawLetterSize(Rang[playerid][2], 0.410000, 2.000000);
  27.         TextDrawColor(Rang[playerid][2], -1);
  28.         TextDrawSetProportional(Rang[playerid][2], 1);
  29.         TextDrawSetShadow(Rang[playerid][2], 0);
  30.  
  31.         Stars[playerid][0] = TextDrawCreate(83.000000, 327.000000, "]");
  32.         Stars[playerid][1] = TextDrawCreate(97.000000, 328.000000, "]");
  33.         Stars[playerid][2] = TextDrawCreate(110.000000, 333.000000, "]");
  34.         Stars[playerid][3] = TextDrawCreate(123.000000, 341.000000, "]");
  35.         Stars[playerid][4] = TextDrawCreate(133.000000, 351.000000, "]");
  36.         Stars[playerid][5] = TextDrawCreate(139.000000, 364.000000, "]");
  37.         Stars[playerid][6] = TextDrawCreate(23.000000, 377.000000, "]");
  38.         Stars[playerid][7] = TextDrawCreate(68.000000, 328.000000, "]");
  39.         Stars[playerid][8] = TextDrawCreate(54.000000, 332.000000, "]");
  40.         Stars[playerid][9] = TextDrawCreate(41.000000, 339.000000, "]");
  41.         Stars[playerid][10] = TextDrawCreate(31.000000, 350.000000, "]");
  42.         Stars[playerid][11] = TextDrawCreate(25.000000, 362.000000, "]");
  43.         Stars[playerid][12] = TextDrawCreate(25.000000, 392.000000, "]");
  44.         Stars[playerid][13] = TextDrawCreate(31.000000, 405.000000, "]");
  45.         for(new i; i != sizeof(Stars); i ++)
  46.         {
  47.                 TextDrawBackgroundColor(Stars[playerid][i], 0x00000000);
  48.                 TextDrawFont(Stars[playerid][i], 2);
  49.                 TextDrawLetterSize(Stars[playerid][i], 0.300000, 1.100000);
  50.                 TextDrawColor(Stars[playerid][i], 0xFFFFFF33);
  51.                 TextDrawSetOutline(Stars[playerid][i], 1);
  52.                 TextDrawSetProportional(Stars[playerid][i], 1);
  53.         }
  54.         return 1;
  55. }
  56.  
  57. public OnPlayerSpawn(playerid)
  58. {
  59.         TextDrawShowForPlayer(playerid, Rang[playerid][0]);
  60.         TextDrawShowForPlayer(playerid, Rang[playerid][1]);
  61.         TextDrawShowForPlayer(playerid, Rang[playerid][2]);
  62.  
  63.         TextDrawShowForPlayer(playerid, Stars[playerid][0]);
  64.         TextDrawShowForPlayer(playerid, Stars[playerid][1]);
  65.         TextDrawShowForPlayer(playerid, Stars[playerid][2]);
  66.         TextDrawShowForPlayer(playerid, Stars[playerid][3]);
  67.         TextDrawShowForPlayer(playerid, Stars[playerid][4]);
  68.         TextDrawShowForPlayer(playerid, Stars[playerid][5]);
  69.         TextDrawShowForPlayer(playerid, Stars[playerid][6]);
  70.         TextDrawShowForPlayer(playerid, Stars[playerid][7]);
  71.         TextDrawShowForPlayer(playerid, Stars[playerid][8]);
  72.         TextDrawShowForPlayer(playerid, Stars[playerid][9]);
  73.         TextDrawShowForPlayer(playerid, Stars[playerid][10]);
  74.         TextDrawShowForPlayer(playerid, Stars[playerid][11]);
  75.         TextDrawShowForPlayer(playerid, Stars[playerid][12]);
  76.         TextDrawShowForPlayer(playerid, Stars[playerid][13]);
  77.         return 1;
  78. }
  79.  
  80.  
  81. public OnPlayerUpdate(playerid)
  82. {
  83.         SetPlayerStarRang(playerid);
  84.         GetPlayerRang(playerid);
  85.         return 1;
  86. }
  87.  
  88. stock SetPlayerStarRang(playerid)
  89. {
  90.         switch (GetPlayerScore(playerid))
  91.         {
  92.                         case 0..49 :
  93.                         {
  94.                                 TextDrawColor(Stars[playerid][13], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][13], 0x00000033);
  95.                                 TextDrawColor(Stars[playerid][12], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][12], 0x00000033);
  96.                                 TextDrawHideForPlayer(playerid, Stars[playerid][13]), TextDrawShowForPlayer(playerid, Stars[playerid][13]);
  97.                                 TextDrawHideForPlayer(playerid, Stars[playerid][12]), TextDrawShowForPlayer(playerid, Stars[playerid][12]);
  98.                                 TextDrawSetString(Rang[playerid][2], "7%");
  99.                         }
  100.                         case 50..99 :
  101.                         {
  102.                             TextDrawColor(Stars[playerid][6], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][6], 0x00000033);
  103.                             TextDrawColor(Stars[playerid][11], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][11], 0x00000033);
  104.                             TextDrawHideForPlayer(playerid, Stars[playerid][6]), TextDrawShowForPlayer(playerid, Stars[playerid][6]);
  105.                             TextDrawHideForPlayer(playerid, Stars[playerid][11]), TextDrawShowForPlayer(playerid, Stars[playerid][11]);
  106.                             TextDrawSetString(Rang[playerid][2], "18%");
  107.                         }
  108.                         case 100..499 :
  109.                         {
  110.                             TextDrawColor(Stars[playerid][10], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][10], 0x00000033);
  111.                             TextDrawHideForPlayer(playerid, Stars[playerid][10]), TextDrawShowForPlayer(playerid, Stars[playerid][10]);
  112.                             TextDrawSetString(Rang[playerid][2], "24%");
  113.                         }
  114.                         case 500..999 :
  115.                         {
  116.                             TextDrawColor(Stars[playerid][9], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][9], 0x00000033);
  117.                             TextDrawHideForPlayer(playerid, Stars[playerid][9]), TextDrawShowForPlayer(playerid, Stars[playerid][9]);
  118.                             TextDrawSetString(Rang[playerid][2], "38%");
  119.                         }
  120.                         case 1000..1499 :
  121.                         {
  122.                             TextDrawColor(Stars[playerid][8], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][8], 0x00000033);
  123.                             TextDrawHideForPlayer(playerid, Stars[playerid][8]), TextDrawShowForPlayer(playerid, Stars[playerid][8]);
  124.                             TextDrawSetString(Rang[playerid][2], "45%");
  125.                         }
  126.                         case 1500..1999 :
  127.                         {
  128.                             TextDrawColor(Stars[playerid][7], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][7], 0x00000033);
  129.                             TextDrawHideForPlayer(playerid, Stars[playerid][7]), TextDrawShowForPlayer(playerid, Stars[playerid][7]);
  130.                             TextDrawSetString(Rang[playerid][2], "59%");
  131.                         }
  132.                         case 2000..2999 :
  133.                         {
  134.                             TextDrawColor(Stars[playerid][0], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][0], 0x00000033);
  135.                             TextDrawHideForPlayer(playerid, Stars[playerid][0]), TextDrawShowForPlayer(playerid, Stars[playerid][0]);
  136.                             TextDrawSetString(Rang[playerid][2], "62%");
  137.                         }
  138.                         case 3000..3999 :
  139.                         {
  140.                             TextDrawColor(Stars[playerid][1], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][1], 0x00000033);
  141.                             TextDrawHideForPlayer(playerid, Stars[playerid][1]), TextDrawShowForPlayer(playerid, Stars[playerid][1]);
  142.                             TextDrawSetString(Rang[playerid][2], "73%");
  143.                         }
  144.                         case 4000..4999 :
  145.                         {
  146.                             TextDrawColor(Stars[playerid][2], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][2], 0x00000033);
  147.                             TextDrawHideForPlayer(playerid, Stars[playerid][2]), TextDrawShowForPlayer(playerid, Stars[playerid][2]);
  148.                             TextDrawSetString(Rang[playerid][2], "87%");
  149.                         }
  150.                         case 5000..8499 :
  151.                         {
  152.                             TextDrawColor(Stars[playerid][3], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][3], 0x00000033);
  153.                             TextDrawHideForPlayer(playerid, Stars[playerid][3]), TextDrawShowForPlayer(playerid, Stars[playerid][3]);
  154.                             TextDrawSetString(Rang[playerid][2], "94%");
  155.                         }
  156.                         case 8500..9999 :
  157.                         {
  158.                             TextDrawColor(Stars[playerid][4], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][4], 0x00000033);
  159.                             TextDrawHideForPlayer(playerid, Stars[playerid][4]), TextDrawShowForPlayer(playerid, Stars[playerid][4]);
  160.                             TextDrawSetString(Rang[playerid][2], "98%");
  161.                         }
  162.                         default:
  163.                         {
  164.                             TextDrawColor(Stars[playerid][5], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][5], 0x00000033);
  165.                             TextDrawHideForPlayer(playerid, Stars[playerid][5]), TextDrawShowForPlayer(playerid, Stars[playerid][5]);
  166.                             TextDrawSetString(Rang[playerid][2], "100%");
  167.                         }
  168.         }
  169. }
  170.  
  171. stock GetPlayerRang(playerid)
  172. {
  173.         new string[256];
  174.         switch (GetPlayerScore(playerid))
  175.         {
  176.                         case 0..49 : TextDrawSetString(Rang[playerid][0], "Rang: Noob");
  177.                         case 50..99 : TextDrawSetString(Rang[playerid][0], "Rang: Emigrant");
  178.                         case 100..499 : TextDrawSetString(Rang[playerid][0], "Rang: Bandit");
  179.                         case 500..999 : TextDrawSetString(Rang[playerid][0], "Rang: Killer");
  180.                         case 1000..1499 : TextDrawSetString(Rang[playerid][0], "Rang: Gangster");
  181.                         case 1500..1999 : TextDrawSetString(Rang[playerid][0], "Rang: Hitman");
  182.                         case 2000..2999 : TextDrawSetString(Rang[playerid][0], "Rang: Professional");
  183.                         case 3000..3999 : TextDrawSetString(Rang[playerid][0], "Rang: Terminator");
  184.                         case 4000..4999 : TextDrawSetString(Rang[playerid][0], "Rang: Maniac");
  185.                         case 5000..8499 : TextDrawSetString(Rang[playerid][0], "Rang: Baron");
  186.                         case 8500..9999 : TextDrawSetString(Rang[playerid][0], "Rang: Leader");
  187.                         default: TextDrawSetString(Rang[playerid][0], "Rang: Legenda");
  188.         }
  189.         switch (GetPlayerScore(playerid))
  190.         {
  191.                         case 0..49 : format(string, sizeof(string), "Kills: %d/50", GetPlayerScore(playerid));
  192.                         case 50..99 : format(string, sizeof(string), "Kills: %d/100", GetPlayerScore(playerid));
  193.                         case 100..499 : format(string, sizeof(string), "Kills: %d/500", GetPlayerScore(playerid));
  194.                         case 500..999 : format(string, sizeof(string), "Kills: %d/1000", GetPlayerScore(playerid));
  195.                         case 1000..1499 : format(string, sizeof(string), "Kills: %d/1500", GetPlayerScore(playerid));
  196.                         case 1500..1999 : format(string, sizeof(string), "Kills: %d/2000", GetPlayerScore(playerid));
  197.                         case 2000..2999 : format(string, sizeof(string), "Kills: %d/3000", GetPlayerScore(playerid));
  198.                         case 3000..3999 : format(string, sizeof(string), "Kills: %d/4000", GetPlayerScore(playerid));
  199.                         case 4000..4999 : format(string, sizeof(string), "Kills: %d/5000", GetPlayerScore(playerid));
  200.                         case 5000..8499 : format(string, sizeof(string), "Kills: %d/8500", GetPlayerScore(playerid));
  201.                         case 8500..9999 : format(string, sizeof(string), "Kills: %d/10000", GetPlayerScore(playerid));
  202.                         default: format(string, sizeof(string), "Kills: %d/%d", GetPlayerScore(playerid), GetPlayerScore(playerid));
  203.         }
  204.         TextDrawSetString(Rang[playerid][1], string);
  205. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement