Advertisement
SynonymousZ-Scripts

Aiminfo v3.0

Jul 20th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.57 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. wAmmo
  17. }
  18. new WeapSkills[MAX_PLAYERS][17][wskill];
  19. enum askill{
  20. Float:aHead,
  21. Float:aBody,
  22. Float:aLegs
  23. }
  24. new Float:AccuracySkills[MAX_PLAYERS][askill];
  25. Float:GetPercent(playerid)
  26. {
  27. return ((AccuracySkills[playerid][aHead]+AccuracySkills[playerid][aBody]+AccuracySkills[playerid][aLegs])/100);
  28. }
  29. stock const wName[][] = {
  30. {"Colt 45 "}, // 22
  31. {"Colt 45 (Silenced) "}, // 23
  32. {"Desert Eagle "}, // 24
  33. {"Normal Shotgun "}, // 25
  34. {"Sawnoff Shotgun "}, // 26
  35. {"Combat Shotgun "}, // 27
  36. {"Micro Uzi (Mac 10) "}, // 28
  37. {"MP5 "}, // 29
  38. {"AK47 "}, // 30
  39. {"M4 "}, // 31
  40. {"Tec9 "}, // 32
  41. {"Country Rifle "}, // 33
  42. {"Sniper Rifle "}, // 34
  43. {"Rocket Launcher "}, // 35
  44. {"Heat-Seeking Rocket Launcher "}, // 36
  45. {"Flamethrower "}, // 37
  46. {"Minigun "} // 38
  47. };
  48.  
  49. public OnFilterScriptInit()
  50. {
  51. print("AimInfo geladen. Yey! :) ");
  52. return 1;
  53. }
  54. public OnPlayerConnect(playerid)
  55. {
  56. pKills{playerid} = 0;
  57. pDeaths{playerid} = 0;
  58. for(new i; i!=17; i++)
  59. {
  60. WeapSkills[playerid][i][wAmmo] = 0;
  61. WeapSkills[playerid][i][wShots] = 0;
  62. WeapSkills[playerid][i][wHits] = 0;
  63. }
  64. }
  65. public OnPlayerUpdate(playerid)
  66. {
  67. new Ammo;
  68. new Waffe;
  69. for(new i; i != 11; i++)
  70. {
  71. GetPlayerWeaponData(playerid, i, Waffe, Ammo);
  72. if(!IsValidWaffe(Waffe))continue;
  73. if(Ammo > WeapSkills[playerid][Waffe-22][wAmmo])WeapSkills[playerid][Waffe-22][wAmmo] = Ammo;
  74. if(Ammo < WeapSkills[playerid][Waffe-22][wAmmo])
  75. {
  76. WeapSkills[playerid][Waffe-22][wAmmo] --;
  77. WeapSkills[playerid][Waffe-22][wShots] ++;
  78. }
  79. }
  80. return 1;
  81. }
  82.  
  83. public OnPlayerCommandText(playerid, cmdtext[])
  84. {
  85. if(strcmp("/info", cmdtext, true) == 0)
  86. {
  87. new string[1000];
  88. new iItem;
  89. for(new i; i!=MAX_PLAYERS; i++)
  90. {
  91. if(!IsPlayerConnected(i))continue;
  92. new dName[MAX_PLAYER_NAME];
  93. GetPlayerName(i, dName, sizeof dName);
  94. format(string, sizeof string, "%s\n%s", string, dName);
  95. Listitem[playerid][iItem] = i;
  96. iItem ++;
  97. }
  98. ShowPlayerDialog(playerid, DIALOG_PLAYERS, DIALOG_STYLE_LIST, "Spieler:", string, "Weiter", "Abbruch");
  99. return 1;
  100. }
  101. return 0;
  102. }
  103.  
  104. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
  105. {
  106. if(issuerid != INVALID_PLAYER_ID)
  107. {
  108. if(!IsValidWaffe(weaponid))return 1;
  109. WeapSkills[issuerid][weaponid-22][wHits] ++;
  110. switch(bodypart)
  111. {
  112. case 9: AccuracySkills[playerid][aHead] ++;
  113. case 3,5,6: AccuracySkills[playerid][aBody] ++;
  114. case 4,7,8: AccuracySkills[playerid][aLegs] ++;
  115. }
  116. }
  117. return 1;
  118. }
  119.  
  120. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  121. {
  122. switch(dialogid)
  123. {
  124. case DIALOG_PLAYERS:
  125. {
  126. if(!response)return 1;
  127. PickedID{playerid} = Listitem[playerid][listitem];
  128. ShowPlayerDialog(playerid, DIALOG_PLAYERS_OV, DIALOG_STYLE_LIST, "WaffenSkills", "KD\nTrefferquote\nSchussgenauigkeit", "OK","");
  129. }
  130. case DIALOG_PLAYERS_OV:
  131. {
  132. if(!response)return 1;
  133. switch(listitem)
  134. {
  135. case 0:
  136. {
  137. new string[150];
  138. 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%%",
  139. 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}}));
  140. ShowPlayerDialog(playerid, randINT, DIALOG_STYLE_MSGBOX, "K/D",string,"Ok","");
  141. }
  142. case 1:
  143. {
  144. new string[2000];
  145. new HS[17];
  146. for(new i=22; i!=39; i++)
  147. {
  148. 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]);
  149. 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]);
  150. }
  151. ShowPlayerDialog(playerid, randINT, DIALOG_STYLE_LIST, "WaffenSkills", string, "OK","");
  152. }
  153. case 2:
  154. {
  155. new string[110];
  156. 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));
  157. ShowPlayerDialog(playerid, randINT, DIALOG_STYLE_MSGBOX,"Schussgenauigkeit", string,"OK","");
  158. }
  159. }
  160. }
  161. }
  162. return 1;
  163. }
  164. public OnPlayerDeath(playerid, killerid, reason)
  165. {
  166. if(killerid != INVALID_PLAYER_ID)pKills{killerid} ++;
  167. pDeaths{playerid} ++;
  168. return 1;
  169. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement