Advertisement
Guest User

Private200 - Advanced Rank System

a guest
Feb 22nd, 2013
633
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.29 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf>
  4.  
  5. new Text:Textdraw2;
  6. new TRank[150];
  7.  
  8. /*____________________________
  9. ________________________________
  10. _____________ Made______________
  11. ______________By________________
  12. ___________Private200___________
  13.   ____________________________  */
  14.  
  15. //============================[Colors]================================
  16. #define red 0xAA3333AA
  17. //============================[Finish of Colors]======================
  18.  
  19.  
  20. public OnFilterScriptInit()
  21. {
  22.     print("\n--------------------------------------");
  23.     print(" Rank system by Private200");
  24.     print("--------------------------------------\n");
  25.     Textdraw2 = TextDrawCreate(390.000000, 0.000000, "Rank:~r~");
  26.     TextDrawBackgroundColor(Textdraw2, 16711935);
  27.     TextDrawFont(Textdraw2, 1);
  28.     TextDrawLetterSize(Textdraw2, 0.570000, 2.700000);
  29.     TextDrawColor(Textdraw2, 65535);
  30.     TextDrawSetOutline(Textdraw2, 1);
  31.     TextDrawSetProportional(Textdraw2, 1);
  32.     return 1;
  33. }
  34. public OnPlayerConnect(playerid)
  35. {
  36.     SendClientMessage(playerid,red,"Rank system by Private200 integrated to the server");
  37. }
  38. public OnPlayerSpawn( playerid )
  39. {
  40.     new string[ 128 ];
  41.     if(GetPlayerScore(playerid) >= 1000)
  42.     {
  43.         TRank = "6"; /// The rank name
  44.         TextDrawSetString(Textdraw2, string);
  45.     }
  46.     else if(GetPlayerScore(playerid) >= 700 && GetPlayerScore(playerid) < 1000)
  47.     {
  48.         TRank = "5"; /// The rank name
  49.         TextDrawSetString(Textdraw2, string);
  50.     }
  51.     else if(GetPlayerScore(playerid) >= 500 && GetPlayerScore(playerid) < 700)
  52.     {
  53.         TRank = "4"; /// The rank name
  54.         TextDrawSetString(Textdraw2, string);
  55.     }
  56.     else if(GetPlayerScore(playerid) >= 200 && GetPlayerScore(playerid) < 500)
  57.     {
  58.         TRank = "3"; /// The rank name
  59.         TextDrawSetString(Textdraw2, string);
  60.     }
  61.     else if(GetPlayerScore(playerid) >= 100 && GetPlayerScore(playerid) < 200)
  62.     {
  63.         TRank = "2"; /// The rank name
  64.         TextDrawSetString(Textdraw2, string);
  65.     }
  66.     else if(GetPlayerScore(playerid) >= 50 && GetPlayerScore(playerid) < 100)
  67.     {
  68.         TRank = "1"; /// The rank name
  69.         TextDrawSetString(Textdraw2, string);
  70.     }
  71.     else if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 50)
  72.     {
  73.         TRank = "0"; /// The rank name
  74.         TextDrawSetString(Textdraw2, string);
  75.     }
  76.     format( string, sizeof string, "~y~Rank:~w~ %s",TRank);
  77.     TextDrawSetString(Textdraw2, string);
  78.     TextDrawShowForPlayer( playerid, Textdraw2 );
  79.     return 1;
  80. }
  81.  
  82. public OnPlayerUpdate( playerid )
  83. {
  84.     return 1;
  85. }
  86. COMMAND:myrank(playerid, params[])
  87. {
  88.     if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 50) {
  89.         SendClientMessage(playerid,red,"Your rank RANK NAME 1");
  90.     }
  91.     else if(GetPlayerScore(playerid) >= 50 && GetPlayerScore(playerid) < 100) {
  92.         SendClientMessage(playerid,red,"Your rank RANK NAME 3");
  93.         return 1;
  94.     }
  95.     else if(GetPlayerScore(playerid) >= 100 && GetPlayerScore(playerid) < 200) {
  96.         SendClientMessage(playerid,red,"Your rank RANK NAME 4");
  97.         return 1;
  98.     }
  99.     else if(GetPlayerScore(playerid) >= 200 && GetPlayerScore(playerid) < 500) {
  100.         SendClientMessage(playerid,red,"Your rank RANK NAME 5");
  101.         return 1;
  102.     }
  103.     else if(GetPlayerScore(playerid) >= 500 && GetPlayerScore(playerid) < 700) {
  104.         SendClientMessage(playerid,red,"Your rank RANK NAME 6");
  105.         return 1;
  106.     }
  107.     else if(GetPlayerScore(playerid) >= 700 && GetPlayerScore(playerid) < 1000) {
  108.         SendClientMessage(playerid,red,"Your rank is RANK NAME 7");
  109.         return 1;
  110.     }
  111.     else {
  112.         SendClientMessage(playerid,red,"Your rank RANK NAME is over 1000 !!!!");
  113.         return 1;
  114.     }
  115.     return 1;
  116. }
  117. COMMAND:ranks(playerid, params[])
  118. {
  119.         ShowPlayerDialog(playerid, 35, DIALOG_STYLE_LIST, "Ranks avaible on the server:", "Rank Name for 1000 score\nRank Name for 700 score\nRank Name for 500 score\nRank Name for 200 score\nRank Name for 100 score\nRank name for 50 score", "okay", "Cancel");
  120.         return 1;
  121. }
  122. COMMAND:rankup(playerid, params[])
  123. {
  124.     new string[ 128 ];
  125.     if(GetPlayerScore(playerid) >= 1000)
  126.     {
  127.         TRank = "6"; /// The rank name
  128.         TextDrawSetString(Textdraw2, string);
  129.     }
  130.     else if(GetPlayerScore(playerid) >= 700 && GetPlayerScore(playerid) < 1000)
  131.     {
  132.         TRank = "5"; /// The rank name
  133.         TextDrawSetString(Textdraw2, string);
  134.     }
  135.     else if(GetPlayerScore(playerid) >= 500 && GetPlayerScore(playerid) < 700)
  136.     {
  137.         TRank = "4"; /// The rank name
  138.         TextDrawSetString(Textdraw2, string);
  139.     }
  140.     else if(GetPlayerScore(playerid) >= 200 && GetPlayerScore(playerid) < 500)
  141.     {
  142.         TRank = "3"; /// The rank name
  143.         TextDrawSetString(Textdraw2, string);
  144.     }
  145.     else if(GetPlayerScore(playerid) >= 100 && GetPlayerScore(playerid) < 200)
  146.     {
  147.         TRank = "2"; /// The rank name
  148.         TextDrawSetString(Textdraw2, string);
  149.     }
  150.     else if(GetPlayerScore(playerid) >= 50 && GetPlayerScore(playerid) < 100)
  151.     {
  152.         TRank = "1"; /// The rank name
  153.         TextDrawSetString(Textdraw2, string);
  154.     }
  155.     else if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 50)
  156.     {
  157.         TRank = "0"; /// The rank name
  158.         TextDrawSetString(Textdraw2, string);
  159.     }
  160.     format( string, sizeof string, "~y~Rank:~w~ %s",TRank);
  161.     TextDrawSetString(Textdraw2, string);
  162.     TextDrawShowForPlayer( playerid, Textdraw2 );
  163.     return 1;
  164.  }
  165.  
  166. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  167. {
  168. if(response)// They pressed the first button.
  169.     {
  170.     switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
  171.         {
  172.         case 35:// Our dialog!
  173.             {
  174.             switch(listitem)// Checking which listitem was selected
  175.             {
  176.                 case 0:// The first item listed
  177.                 { //I left them blank , so nothing happends when someone click them
  178.                 }
  179.                 case 1: // The second item listed
  180.                 { //I left them blank , so nothing happends when someone click them
  181.                 }
  182.                 case 2: // The third item listed
  183.                 { //I left them blank , so nothing happends when someone click them
  184.                 }
  185.                 case 3: // The third item listed
  186.                 { //I left them blank , so nothing happends when someone click them
  187.                 }
  188.                 case 4: // The fourth item listed
  189.                 { //I left them blank , so nothing happends when someone click them
  190.                 }
  191.                 case 5: // The fifht item listed
  192.                 { //I left them blank , so nothing happends when someone click them
  193.                 }
  194.                 case 6: // The sixth item listed
  195.                 { //I left them blank , so nothing happends when someone click them
  196.                 }
  197.             }
  198.             }
  199.     }
  200.     }
  201. return 1;
  202. }
  203. // This command displays the rules of the server
  204. COMMAND:rankhelp(playerid, params[])
  205. {
  206.     // Setup local variables
  207.     new Msg[2000];
  208.  
  209.     format(Msg, 2000, "%s1. You can use /rankup to update your current rank if you see that you got the required score.\n", Msg);
  210.     format(Msg, 2000, "%s2. Use /ranks to see all the avaible ranks in the server.\n", Msg);
  211.     format(Msg, 2000, "%s3. Use /myrank to see your current rank.\n", Msg);
  212.  
  213.     ShowPlayerDialog(playerid, 100000, DIALOG_STYLE_MSGBOX, "Rank Commands Help", Msg, "Understood", " ");
  214.    
  215.     return 1;
  216. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement