Advertisement
SanRock10

Rank/EXP System - SanRock

Jun 22nd, 2012
1,343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. //Thanks to SanRock for making this!
  2.  
  3. #include <a_samp>
  4.  
  5. new Text:Ranked[MAX_PLAYERS];
  6.  
  7. enum pInfo
  8. {
  9. Rank,
  10. EXP
  11. }
  12. new PlayerInfo[MAX_PLAYERS][pInfo];
  13.  
  14. public OnPlayerSpawn(playerid)
  15. {
  16. if(PlayerInfo[playerid][EXP] == 50)
  17. {
  18. PlayerInfo[playerid][Rank] +=1;
  19. }
  20. if(PlayerInfo[playerid][EXP] == 150)
  21. {
  22. PlayerInfo[playerid][Rank] +=1;
  23. }
  24. if(PlayerInfo[playerid][EXP] == 300)
  25. {
  26. PlayerInfo[playerid][Rank] +=1;
  27. }
  28. if(PlayerInfo[playerid][EXP] == 400)
  29. {
  30. PlayerInfo[playerid][Rank] +=1;
  31. }
  32. if(PlayerInfo[playerid][EXP] == 500)
  33. {
  34. PlayerInfo[playerid][Rank] +=1;
  35. }
  36. if(PlayerInfo[playerid][EXP] == 650)
  37. {
  38. PlayerInfo[playerid][Rank] +=1;
  39. }
  40. if(PlayerInfo[playerid][EXP] == 800)
  41. {
  42. PlayerInfo[playerid][Rank] +=1;
  43. }
  44. if(PlayerInfo[playerid][EXP] == 1000)
  45. {
  46. PlayerInfo[playerid][Rank] +=1;
  47. }
  48. if(PlayerInfo[playerid][EXP] == 1500)
  49. {
  50. PlayerInfo[playerid][Rank] +=1;
  51. }
  52. if(PlayerInfo[playerid][EXP] == 3000)
  53. {
  54. PlayerInfo[playerid][Rank] +=1;
  55. }
  56. TextDrawShowForPlayer(playerid,Text:Ranked[playerid]);
  57. return 1;
  58. }
  59. public OnPlayerConnect(playerid)
  60. {
  61. Ranked[playerid] = TextDrawCreate(18.000000,428.000000,"~w~Rank Name: ~w~0 ~w~Rank: ~w~0/10");
  62. TextDrawAlignment(Ranked[playerid],0);
  63. TextDrawBackgroundColor(Ranked[playerid],255);
  64. TextDrawFont(Ranked[playerid],1);
  65. TextDrawLetterSize(Ranked[playerid],0.355555,0.955555);
  66. TextDrawColor(Ranked[playerid],-1);
  67. TextDrawSetOutline(Ranked[playerid],1);
  68. TextDrawSetProportional(Ranked[playerid],1);
  69. TextDrawSetShadow(Ranked[playerid],1);
  70. return 1;
  71. }
  72. public OnPlayerDeath(playerid, killerid, reason)
  73. {
  74. PlayerInfo[killerid][EXP] += 1;
  75. GivePlayerMoney(killerid, 5000);
  76. return 1;
  77. }
  78. public OnPlayerUpdate(playerid)
  79. {
  80. new str[256];
  81. format(str,sizeof(str),"~w~Rank Name: ~w~%s ~w~Rank: ~w~%d/10",GetRankName(playerid), PlayerInfo[playerid][Rank]);
  82. TextDrawSetString(Text:Ranked[playerid],str);
  83. return 1;
  84. }
  85. stock GetRankName(playerid)
  86. {
  87. new str[64];
  88. if (PlayerInfo[playerid][Rank] == 0) str = ("Newbie");
  89. if (PlayerInfo[playerid][Rank] == 1) str = ("Survivor");
  90. if (PlayerInfo[playerid][Rank] == 2) str = ("Pro Survivor");
  91. if (PlayerInfo[playerid][Rank] == 3) str = ("Killer");
  92. if (PlayerInfo[playerid][Rank] == 4) str = ("Pro Killer");
  93. if (PlayerInfo[playerid][Rank] == 5) str = ("Master");
  94. if (PlayerInfo[playerid][Rank] == 6) str = ("Master Survivor");
  95. if (PlayerInfo[playerid][Rank] == 7) str = ("Master Killer");
  96. if (PlayerInfo[playerid][Rank] == 8) str = ("Skilled Survivor");
  97. if (PlayerInfo[playerid][Rank] == 9) str = ("Skilled Killer");
  98. if (PlayerInfo[playerid][Rank] == 10) str = ("Da Boss");
  99. return str;
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement