Advertisement
proSeryoga

[PAWN] Rank System

Mar 16th, 2013
936
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.60 KB | None | 0 0
  1. /*
  2. FileScript name: Rank System.
  3. Аuthor: proSeryoga
  4. Date: 16.03.2013
  5. */
  6.  
  7. #include <a_samp>
  8.  
  9. new PlayerText:Rang[MAX_PLAYERS][3];
  10. public OnFilterScriptInit()
  11. {
  12. print("Loading....");
  13. print("Rank System loaded!");
  14. return 1;
  15. }
  16.  
  17. public OnPlayerConnect(playerid)
  18. {
  19. Rang[playerid][0] = CreatePlayerTextDraw(playerid,496.000000, 101.000000, " ");
  20. PlayerTextDrawBackgroundColor(playerid,Rang[playerid][0], 0x00000033);
  21. PlayerTextDrawFont(playerid,Rang[playerid][0], 2);
  22. PlayerTextDrawLetterSize(playerid,Rang[playerid][0], 1.100000, 2.300001);
  23. PlayerTextDrawColor(playerid,Rang[playerid][0], -1);
  24. PlayerTextDrawSetOutline(playerid,Rang[playerid][0], 1);
  25. PlayerTextDrawSetProportional(playerid,Rang[playerid][0], 1);
  26.  
  27. Rang[playerid][1] = CreatePlayerTextDraw(playerid,496.000000, 101.000000, "IIIIIIIIIIIIII");
  28. PlayerTextDrawBackgroundColor(playerid,Rang[playerid][1], 0x00000000);
  29. PlayerTextDrawFont(playerid,Rang[playerid][1], 2);
  30. PlayerTextDrawLetterSize(playerid,Rang[playerid][1], 1.100000, 2.300001);
  31. PlayerTextDrawColor(playerid,Rang[playerid][1], 0xFFFFFF33);
  32. PlayerTextDrawSetOutline(playerid,Rang[playerid][1], 1);
  33. PlayerTextDrawSetProportional(playerid,Rang[playerid][1], 1);
  34.  
  35. Rang[playerid][2] = CreatePlayerTextDraw(playerid,500.000000, 120.000000, " ");
  36. PlayerTextDrawBackgroundColor(playerid,Rang[playerid][2], 255);
  37. PlayerTextDrawFont(playerid,Rang[playerid][2], 3);
  38. PlayerTextDrawLetterSize(playerid,Rang[playerid][2], 0.519999, 1.600000);
  39. PlayerTextDrawColor(playerid,Rang[playerid][2], 0xFFFF00AA);
  40. PlayerTextDrawSetOutline(playerid,Rang[playerid][2], 1);
  41. PlayerTextDrawSetProportional(playerid,Rang[playerid][2], 1);
  42. PlayerTextDrawSetSelectable(playerid,Rang[playerid][2], 0);
  43.  
  44. PlayerTextDrawShow(playerid, Rang[playerid][0]);
  45. PlayerTextDrawShow(playerid, Rang[playerid][1]);
  46. PlayerTextDrawShow(playerid, Rang[playerid][2]);
  47. return 1;
  48. }
  49.  
  50. public OnPlayerSpawn(playerid)
  51. {
  52. SetPlayerStarRang(playerid);
  53. return 1;
  54. }
  55. public OnPlayerDeath(playerid, killerid, reason)
  56. {
  57. #pragma unused reason
  58. if(killerid != INVALID_PLAYER_ID)
  59. {
  60. SetPlayerScore (killerid, GetPlayerScore (killerid) + 1);
  61. SetPlayerStarRang(playerid);
  62. }
  63. return 1;
  64. }
  65.  
  66. stock SetPlayerStarRang(playerid)
  67. {
  68. new string[20];
  69. new ran = GetPlayerScore(playerid);
  70. format(string, sizeof (string), "%d", ran);
  71. if(ran>=0&&ran<=49)
  72. {
  73. PlayerTextDrawSetString(playerid,Rang[playerid][0], "I");
  74. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Noob");
  75. }
  76. if(ran>=50&&ran<=99)
  77. {
  78. PlayerTextDrawSetString(playerid,Rang[playerid][0], "II");
  79. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Strelok");
  80. }
  81. if(ran>=100&&ran<=449)
  82. {
  83. PlayerTextDrawSetString(playerid,Rang[playerid][0], "III");
  84. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Bandit");
  85. }
  86. if(ran>=500&&ran<=999)
  87. {
  88. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIII");
  89. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Killer");
  90. }
  91. if(ran>=1000&&ran<=1499)
  92. {
  93. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIIII");
  94. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Gangster");
  95. }
  96. if(ran>=1500&&ran<=1999)
  97. {
  98. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIIIII");
  99. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Hitman");
  100. }
  101. if(ran>=2000&&ran<=2999)
  102. {
  103. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIIIIII");
  104. PlayerTextDrawSetString(playerid,Rang[playerid][2], "proGamer");
  105. }
  106. if(ran>=3000&&ran<=3999)
  107. {
  108. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIIIIIII");
  109. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Kent");
  110. }
  111. if(ran>=4000&&ran<=4999)
  112. {
  113. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIIIIIIII");
  114. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Narcomaniac");
  115. }
  116. if(ran>=5000&&ran<=5999)
  117. {
  118. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIIIIIIIII");
  119. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Baron");
  120. }
  121. if(ran>=6000&&ran<=6999)
  122. {
  123. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIIIIIIIIII");
  124. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Maestro");
  125. }
  126. if(ran>=7000&&ran<=7999)
  127. {
  128. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIIIIIIIIIII");
  129. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Maniac");
  130. }
  131. if(ran>=8000&&ran<=9998)
  132. {
  133. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIIIIIIIIIIII");
  134. PlayerTextDrawSetString(playerid,Rang[playerid][2], "ProKiller");
  135. }
  136. if(ran == 9999)
  137. {
  138. PlayerTextDrawSetString(playerid,Rang[playerid][0], "IIIIIIIIIIIIII");
  139. PlayerTextDrawSetString(playerid,Rang[playerid][2], "Terminator");
  140. }
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement