Advertisement
Inshal

iRanks v1.1

Mar 7th, 2014
664
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 11.08 KB | None | 0 0
  1. //=========================iRANKS and Killing Spree System======================
  2. //======================Please donot remove credits=============================
  3. //========================Filterscript is made by inshal========================
  4.  
  5.  
  6. #include <a_samp>
  7. #include <dini>
  8.  
  9. #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  10.  
  11. new Text:iRank[MAX_PLAYERS],Text:Stats[MAX_PLAYERS];
  12. new PlayerTotalKills[MAX_PLAYERS] = 0;
  13. new string[128];
  14.  
  15. #define COLOR_YELLOW            0xFFFF00AA
  16. #define COLOR_PINK              0xFF66FFAA
  17. #define COLOR_AQUA              0x7CFC00AA
  18. #define COLOR_WHITE             0xFFFFFFAA
  19. #define COLOR_RED 0xFF0000AA
  20. #define Ranks                   353
  21. new Kills[MAX_PLAYERS],Deaths[MAX_PLAYERS];
  22.  
  23. public OnFilterScriptInit()
  24. {
  25.     print("\n--------------------------------------");
  26.     print("--iRanks and Killing spree system v1.1--");
  27.     print("--------made by inshal - loaded---------");
  28.     print("--------------------------------------\n");
  29.  
  30.     if(!dini_Exists("Deaths.cfg"))
  31.     {
  32.       dini_Create("Deaths.cfg");
  33.     }
  34.  
  35.     if(!dini_Exists("Kills.cfg"))
  36.     {
  37.       dini_Create("Kills.cfg");
  38.     }
  39.  
  40.  
  41.     return 1;
  42. }
  43.  
  44. public OnFilterScriptExit()
  45. {
  46.     printf("*** Rank System Unloaded *** ");
  47.  
  48.     return 1;
  49. }
  50.  
  51.  
  52.  
  53.  
  54. public OnPlayerRequestClass(playerid, classid)
  55. {
  56.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  57.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  58.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  59.     return 1;
  60. }
  61.  
  62. public OnPlayerConnect(playerid)
  63. {
  64.  
  65.     new Pname[MAX_PLAYER_NAME];
  66.     GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
  67.     Deaths[playerid] = dini_Int("Deaths.cfg", Pname);
  68.     Kills[playerid] = dini_Int("Kills.cfg", Pname);
  69.     new Name[MAX_PLAYER_NAME];
  70.     GetPlayerName(playerid,Name,sizeof(Name));
  71.     SendClientMessage(playerid,COLOR_AQUA,"Welcome to the server! iRank and Killing Spree System by inshal is being used!");
  72.     iRank[playerid] = TextDrawCreate(498.000000, 100.000000, " ");
  73.     TextDrawBackgroundColor(iRank[playerid], 255);
  74.     TextDrawFont(iRank[playerid], 2);
  75.     TextDrawLetterSize(iRank[playerid], 0.250000, 0.899999);
  76.     TextDrawColor(iRank[playerid], -1);
  77.     TextDrawSetOutline(iRank[playerid], 0);
  78.     TextDrawSetProportional(iRank[playerid], 1);
  79.     TextDrawSetShadow(iRank[playerid], 1);
  80.  
  81.     Stats[playerid] = TextDrawCreate(499.000000, 110.000000, "~r~Kills: ~w~0 ~g~Deaths: ~w~0");
  82.     TextDrawBackgroundColor(Stats[playerid], 255);
  83.     TextDrawFont(Stats[playerid], 2);
  84.     TextDrawLetterSize(Stats[playerid], 0.159999, 1.000000);
  85.     TextDrawColor(Stats[playerid], -1);
  86.     TextDrawSetOutline(Stats[playerid], 0);
  87.     TextDrawSetProportional(Stats[playerid], 1);
  88.     TextDrawSetShadow(Stats[playerid], 1);
  89.  
  90.  
  91.  
  92.     return 1;
  93. }
  94.  
  95. public OnPlayerDisconnect(playerid, reason)
  96. {
  97.  
  98.     new Pname[MAX_PLAYER_NAME];
  99.     GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
  100.     dini_IntSet("Deaths.cfg", Pname, Deaths[playerid]);
  101.     dini_IntSet("Kills.cfg", Pname, Kills[playerid]);
  102.     return 1;
  103. }
  104.  
  105. public OnPlayerSpawn(playerid)
  106. {
  107.     TextDrawShowForPlayer(playerid,Text:Stats[playerid]);
  108.     TextDrawShowForPlayer(playerid,Text:iRank[playerid]);
  109.     return 1;
  110. }
  111.  
  112. public OnPlayerDeath(playerid, killerid, reason)
  113. {
  114.     Kills[killerid]++;
  115.     Deaths[playerid]++;
  116.     new Name[128];
  117.     GetPlayerName(killerid, Name, sizeof(Name));
  118.     PlayerTotalKills[killerid]++;
  119.     PlayerTotalKills[playerid] = 0;
  120.     if(PlayerTotalKills[killerid] == 1) {
  121.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/firstblood.mp3");
  122.         format(string,sizeof(string),"%s has killed 1 player (FIRST BLOOD)",Name);
  123.         SendClientMessageToAll(COLOR_RED,string);
  124.     }
  125.     if(PlayerTotalKills[killerid] == 2) {
  126.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/doublekill.mp3");
  127.         format(string,sizeof(string),"%s has killed 2 players without getting killed (DOUBLE KILL)",Name);
  128.         SendClientMessageToAll(COLOR_RED,string);
  129.         return 1;
  130.     }
  131.     if(PlayerTotalKills[killerid] == 3) {
  132.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/triplekill.mp3");
  133.         format(string,sizeof(string),"%s has killed 3 players without getting killed (TRIPLE KILL)",Name);
  134.         SendClientMessageToAll(COLOR_RED,string);
  135.         return 1;
  136.     }
  137.     if(PlayerTotalKills[killerid] == 4) {
  138.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/dominating.mp3");
  139.         format(string,sizeof(string),"%s has killed 4 players without getting killed (DOMINATING)",Name);
  140.         SendClientMessageToAll(COLOR_RED,string);
  141.         return 1;
  142.     }
  143.     if(PlayerTotalKills[killerid] == 5) {
  144.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/killingspree.mp3");
  145.         format(string,sizeof(string),"%s has killed 5 players without getting killed (KILLING SPREE)",Name);
  146.         SendClientMessageToAll(COLOR_RED,string);
  147.         return 1;
  148.     }
  149.     if(PlayerTotalKills[killerid] == 7) {
  150.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/monsterkill.mp3");
  151.         format(string,sizeof(string),"%s has killed 7 players without getting killed (MONSTER KILL)",Name);
  152.         SendClientMessageToAll(COLOR_RED,string);
  153.         return 1;
  154.     }
  155.     if(PlayerTotalKills[killerid] == 9) {
  156.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/wickedsick.mp3");
  157.         format(string,sizeof(string),"%s has killed 9 players without getting killed (WICKED SICK)",Name);
  158.         SendClientMessageToAll(COLOR_RED,string);
  159.         return 1;
  160.     }
  161.     if(PlayerTotalKills[killerid] == 11) {
  162.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/ludicrouskill.mp3");
  163.         format(string,sizeof(string),"%s has killed 11 players without getting killed (LUDICROUS KILL)",Name);
  164.         SendClientMessageToAll(COLOR_RED,string);
  165.         return 1;
  166.     }
  167.     if(PlayerTotalKills[killerid] == 13) {
  168.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/ultrakill.mp3");
  169.         format(string,sizeof(string),"%s has killed 13 players without getting kiled (ULTRA KILL)",Name);
  170.         SendClientMessageToAll(COLOR_RED,string);
  171.         return 1;
  172.     }
  173.     if(PlayerTotalKills[killerid] == 15) {
  174.         PlayAudioStreamForPlayer(killerid, "http://www.pamp3.site40.net/quake/unstoppable.mp3");
  175.         format(string,sizeof(string),"%s has killed 15 players without getting killed (UNSTOPPABLE)",Name);
  176.         SendClientMessageToAll(COLOR_RED,string);
  177.         return 1;
  178.     }
  179.     if(PlayerTotalKills[killerid] == 17) {
  180.         PlayAudioStreamForPlayer(killerid, "http://k002.kiwi6.com/hotlink/hbnvs5u81m/counter_strike_jingle_-_quake_voice-godlike.mp3");
  181.         format(string,sizeof(string),"%s has killed 17 players without getting killed (GOD-LIKE)",Name);
  182.         SendClientMessageToAll(COLOR_RED,string);
  183.         return 1;
  184.     }
  185.     return 1;
  186. }
  187.  
  188. dcmd_ranks( playerid, params[])
  189. {
  190.     #pragma unused params
  191.     ShowPlayerDialog(playerid, 35, DIALOG_STYLE_LIST, "iRANKS", "Newbie\nSurvivor\nKill Streaker\nDeath Tech\nRambo\nKill Machine", "okay", "Cancel");
  192.     return 1;
  193. }
  194.  
  195. dcmd_icredits( playerid, params[])
  196. {
  197.     #pragma unused params
  198.     SendClientMessage(playerid, COLOR_AQUA, "iRanks v1.1 made by inshal");
  199.     return 1;
  200. }
  201.  
  202. public OnPlayerText(playerid, text[])
  203. {
  204.     return 1;
  205. }
  206.  
  207. public OnPlayerCommandText(playerid, cmdtext[])
  208. {
  209.     dcmd(ranks,5,cmdtext);
  210.     dcmd(icredits,8,cmdtext);
  211.  
  212.     return 0;
  213. }
  214.  
  215.  
  216. GetPlayerRank(playerid)
  217. {
  218.     if(Kills[playerid]<20)
  219.     {
  220.     TextDrawSetString(Text:iRank[playerid],"~r~RANK:~w~Newbie");
  221.     new Float:x,Float:y,Float:z;
  222.     new Text3D:label1 = Create3DTextLabel("RANK : Newbie", COLOR_RED,x,y,z, 40.0, 0, 0);
  223.     GetPlayerPos(playerid,x,y,z);
  224.     Attach3DTextLabelToPlayer(label1,playerid,0.0, 0.0, 0.7);
  225.     }
  226.     else if(Kills[playerid]<50 && Kills[playerid]>=20)
  227.     {
  228.     TextDrawSetString(Text:iRank[playerid],"~r~RANK:~w~Survivor");
  229.     new Float:x,Float:y,Float:z;
  230.     new Text3D:label2 = Create3DTextLabel("RANK : Survivor", COLOR_RED,x,y,z, 40.0, 0, 0);
  231.     GetPlayerPos(playerid,x,y,z);
  232.     Attach3DTextLabelToPlayer(label2,playerid,0.0, 0.0, 0.7);
  233.     }
  234.     else if(Kills[playerid]<100 && Kills[playerid]>=50)
  235.     {
  236.     TextDrawSetString(Text:iRank[playerid],"~r~RANK:~w~Kill Streaker");
  237.     new Float:x,Float:y,Float:z;
  238.     new Text3D:label3 = Create3DTextLabel("RANK : Kill Streaker", COLOR_RED,x,y,z, 40.0, 0, 0);
  239.     GetPlayerPos(playerid,x,y,z);
  240.     Attach3DTextLabelToPlayer(label3,playerid,0.0, 0.0, 0.7);
  241.     }
  242.     else if(Kills[playerid]<300 && Kills[playerid]>=100)
  243.     {
  244.     TextDrawSetString(Text:iRank[playerid],"~r~RANK:~w~Death Tech");
  245.     new Float:x,Float:y,Float:z;
  246.     new Text3D:label4 = Create3DTextLabel("RANK : Death Tech", COLOR_RED,x,y,z, 40.0, 0, 0);
  247.     GetPlayerPos(playerid,x,y,z);
  248.     Attach3DTextLabelToPlayer(label4,playerid,0.0, 0.0, 0.7);
  249.     }
  250.     else if(Kills[playerid]<600 && Kills[playerid]>=300)
  251.     {
  252.     TextDrawSetString(Text:iRank[playerid],"~r~RANK:~w~Rambo");
  253.     new Float:x,Float:y,Float:z;
  254.     new Text3D:label5 = Create3DTextLabel("RANK : Rambo", COLOR_RED,x,y,z, 40.0, 0, 0);
  255.     GetPlayerPos(playerid,x,y,z);
  256.     Attach3DTextLabelToPlayer(label5,playerid,0.0, 0.0, 0.7);
  257.     }
  258.     else if(Kills[playerid]>= 600)
  259.     {
  260.     TextDrawSetString(Text:iRank[playerid],"~r~RANK:~w~Kill Machine");
  261.     new Float:x,Float:y,Float:z;
  262.     new Text3D:label6 = Create3DTextLabel("RANK : Kill Machine", COLOR_RED,x,y,z, 40.0, 0, 0);
  263.     GetPlayerPos(playerid,x,y,z);
  264.     Attach3DTextLabelToPlayer(label6,playerid,0.0, 0.0, 0.7);
  265.     }
  266.     return 1;
  267. }
  268.  
  269. stock GetPlayerKills(playerid)
  270. {
  271.     return Kills[playerid];
  272. }
  273. stock GetPlayerDeaths(playerid)
  274. {
  275.     return Deaths[playerid];
  276. }
  277. public OnPlayerUpdate(playerid)
  278. {
  279.     new str[256];
  280.     format(str,sizeof(str),"~r~Kills: ~w~%d ~g~Deaths: ~w~%d",Kills[playerid],Deaths[playerid]);
  281.     TextDrawSetString(Text:Stats[playerid],str);
  282.     GetPlayerRank(playerid);
  283.     return 1;
  284. }
  285.  
  286. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  287. {
  288. if(response)
  289.     {
  290.     switch(dialogid)
  291.         {
  292.         case 35:
  293.             {
  294.             switch(listitem)// Checking which listitem was selected
  295.             {
  296.                 case 0:
  297.                 {
  298.                 SendClientMessage(playerid,COLOR_AQUA,"Newbie : For less than 20 kills.");
  299.                 }
  300.                 case 1: // The second item listed
  301.                 {
  302.                 SendClientMessage(playerid,COLOR_AQUA,"Survivor : For more than 20 kills and less than 50 kills. ");
  303.                 }
  304.                 case 2: // The third item listed
  305.                 {
  306.                 SendClientMessage(playerid,COLOR_AQUA,"Kill Streaker : For more than 50 kills and less than 100 kills. ");
  307.                 }
  308.                 case 3: // The third item listed
  309.                 {
  310.                 SendClientMessage(playerid,COLOR_AQUA,"Death Tech : For more than 100 kills and less than 300 kills. ");
  311.                 }
  312.                 case 4: // The fourth item listed
  313.                 {
  314.                 SendClientMessage(playerid,COLOR_AQUA,"Rambo : For more than 300 kills and less than 600 kills. ");
  315.                 }
  316.                 case 5: // The fifht item listed
  317.                 {
  318.                 SendClientMessage(playerid,COLOR_AQUA,"Kill Machine : For more than 600 kills. ");
  319.                 }
  320.             }
  321.             }
  322.     }
  323.     }
  324. return 1;
  325. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement