Advertisement
SynonymousZ-Scripts

Aiminfo v2.0

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