Advertisement
SynonymousZ-Scripts

Aiminfo v3.1

Jul 21st, 2014
496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. //AimInfo FilterScript by SynonymousZ CopyRight entfernen = schlechtes Gewissen!
  2. #include <a_samp>
  3.  
  4. #define randINT 800
  5. #define DIALOG_PLAYERS (randINT + 1)
  6. #define DIALOG_PLAYERS_OV (randINT + 2)
  7. #define IsValidWaffe(%1) (%1 > 21 && %1 < 39)
  8.  
  9. new Listitem[MAX_PLAYERS][MAX_PLAYERS];
  10. new PickedID[MAX_PLAYERS char];
  11. new pKills[MAX_PLAYERS char];
  12. new pDeaths[MAX_PLAYERS char];
  13. enum wskill{
  14. wHits,
  15. wShots,
  16. }
  17. new WeapSkills[MAX_PLAYERS][17][wskill];
  18. enum askill{
  19. Float:aHead,
  20. Float:aBody,
  21. Float:aLegs
  22. }
  23. new Float:AccuracySkills[MAX_PLAYERS][askill];
  24.  
  25. Float:GetPercent(playerid)return ((AccuracySkills[playerid][aHead]+AccuracySkills[playerid][aBody]+AccuracySkills[playerid][aLegs])/100);
  26.  
  27. stock const wName[][] = {
  28. {"Colt 45 "}, // 22
  29. {"Colt 45 (Silenced) "}, // 23
  30. {"Desert Eagle "}, // 24
  31. {"Normal Shotgun "}, // 25
  32. {"Sawnoff Shotgun "}, // 26
  33. {"Combat Shotgun "}, // 27
  34. {"Micro Uzi (Mac 10) "}, // 28
  35. {"MP5 "}, // 29
  36. {"AK47 "}, // 30
  37. {"M4 "}, // 31
  38. {"Tec9 "}, // 32
  39. {"Country Rifle "}, // 33
  40. {"Sniper Rifle "}, // 34
  41. {"Rocket Launcher "}, // 35
  42. {"Heat-Seeking Rocket Launcher "}, // 36
  43. {"Flamethrower "}, // 37
  44. {"Minigun "} // 38
  45. };
  46.  
  47. public OnFilterScriptInit()
  48. {
  49. print("AimInfo geladen. Yey! :) ");
  50. return 1;
  51. }
  52. public OnPlayerConnect(playerid)
  53. {
  54. pKills{playerid} = 0;
  55. pDeaths{playerid} = 0;
  56. for(new i; i!=17; i++)
  57. {
  58. WeapSkills[playerid][i][wShots] = 0;
  59. WeapSkills[playerid][i][wHits] = 0;
  60. }
  61. }
  62. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  63. {
  64. if(IsValidWaffe(weaponid))WeapSkills[playerid][weaponid-22][wShots] ++;
  65. return 1;
  66. }
  67.  
  68. public OnPlayerCommandText(playerid, cmdtext[])
  69. {
  70. if(strcmp("/info", cmdtext, true) == 0)
  71. {
  72. new string[1000];
  73. new iItem;
  74. for(new i; i!=MAX_PLAYERS; i++)
  75. {
  76. if(!IsPlayerConnected(i))continue;
  77. new dName[MAX_PLAYER_NAME];
  78. GetPlayerName(i, dName, sizeof dName);
  79. format(string, sizeof string, "%s\n%s", string, dName);
  80. Listitem[playerid][iItem] = i;
  81. iItem ++;
  82. }
  83. ShowPlayerDialog(playerid, DIALOG_PLAYERS, DIALOG_STYLE_LIST, "Spieler:", string, "Weiter", "Abbruch");
  84. return 1;
  85. }
  86. return 0;
  87. }
  88.  
  89. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
  90. {
  91. if(issuerid != INVALID_PLAYER_ID)
  92. {
  93. if(!IsValidWaffe(weaponid))return 1;
  94. WeapSkills[issuerid][weaponid-22][wHits] ++;
  95. switch(bodypart)
  96. {
  97. case 9: AccuracySkills[issuerid][aHead] ++;
  98. case 3,5,6: AccuracySkills[issuerid][aBody] ++;
  99. case 4,7,8: AccuracySkills[issuerid][aLegs] ++;
  100. }
  101. }
  102. return 1;
  103. }
  104.  
  105. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  106. {
  107. switch(dialogid)
  108. {
  109. case DIALOG_PLAYERS:
  110. {
  111. if(!response)return 1;
  112. PickedID{playerid} = Listitem[playerid][listitem];
  113. ShowPlayerDialog(playerid, DIALOG_PLAYERS_OV, DIALOG_STYLE_LIST, "WaffenSkills", "KD\nTrefferquote\nSchussgenauigkeit", "OK","");
  114. }
  115. case DIALOG_PLAYERS_OV:
  116. {
  117. if(!response)return 1;
  118. switch(listitem)
  119. {
  120. case 0:
  121. {
  122. new string[150];
  123. format(string, sizeof string, "{00FFFF}Kills:\t\t{FF3800}%d\n{00FFFF}Deaths:\t{FF3800}%d\n{00FFFF}K/D:\t\t{FF3800}%0.2f\n{00FFFF}Kills:\t\t{FF3800}%d%%\n{00FFFF}Deaths:\t{FF3800}%d%%",
  124. pKills{PickedID{playerid}}, pDeaths{PickedID{playerid}}, ((pKills{PickedID{playerid}}*1.0)/(pDeaths{PickedID{playerid}} * 1.0)*1.0), floatround((100.0 / (pKills{PickedID{playerid}} + pDeaths{PickedID{playerid}})) * pKills{PickedID{playerid}} *1.0), floatround((100.0 / (pKills{PickedID{playerid}} + pDeaths{PickedID{playerid}})) * pDeaths{PickedID{playerid}}));
  125. ShowPlayerDialog(playerid, randINT, DIALOG_STYLE_MSGBOX, "K/D",string,"Ok","");
  126. }
  127. case 1:
  128. {
  129. new string[2000];
  130. new HS[17];
  131. for(new i=22; i!=39; i++)
  132. {
  133. if(WeapSkills[PickedID{playerid}][i-22][wShots])HS[i-22] = floatround((100.0 / WeapSkills[PickedID{playerid}][i-22][wShots])*WeapSkills[PickedID{playerid}][i-22][wHits]);
  134. format(string, sizeof string, "%s\n{00FFFF}%s|\t{FF3800}%d %% {FFFFFF}Hits {828282}(Schüsse: %d / Treffer: %d)", string, wName[i-22], HS[i-22], WeapSkills[PickedID{playerid}][i-22][wShots], WeapSkills[PickedID{playerid}][i-22][wHits]);
  135. }
  136. ShowPlayerDialog(playerid, randINT, DIALOG_STYLE_LIST, "WaffenSkills", string, "OK","");
  137. }
  138. case 2:
  139. {
  140. new string[110];
  141. format(string, sizeof string, "{00FFFF}Kopftreffer:\t\t{FF3800}%.1f%%\n{00FFFF}Körpertreffer:\t\t{FF3800}%.1f%%\n{00FFFF}Beintreffer:\t\t{FF3800}%.1f%%", AccuracySkills[playerid][aHead]/GetPercent(playerid), AccuracySkills[playerid][aBody]/GetPercent(playerid), AccuracySkills[playerid][aLegs]/GetPercent(playerid));
  142. ShowPlayerDialog(playerid, randINT, DIALOG_STYLE_MSGBOX,"Schussgenauigkeit", string,"OK","");
  143. }
  144. }
  145. }
  146. }
  147. return 1;
  148. }
  149. public OnPlayerDeath(playerid, killerid, reason)
  150. {
  151. if(killerid != INVALID_PLAYER_ID)pKills{killerid} ++;
  152. pDeaths{playerid} ++;
  153. return 1;
  154. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement