Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //AimInfo FilterScript by SynonymousZ CopyRight entfernen = schlechtes Gewissen!
- #include <a_samp>
- #define randINT 800
- #define DIALOG_PLAYERS (randINT + 1)
- #define DIALOG_PLAYERS_OV (randINT + 2)
- #define IsValidWaffe(%1) (%1 > 21 && %1 < 39)
- new Listitem[MAX_PLAYERS][MAX_PLAYERS];
- new PickedID[MAX_PLAYERS char];
- new pKills[MAX_PLAYERS char];
- new pDeaths[MAX_PLAYERS char];
- enum wskill{
- wHits,
- wShots,
- }
- new WeapSkills[MAX_PLAYERS][17][wskill];
- enum askill{
- Float:aHead,
- Float:aBody,
- Float:aLegs
- }
- new Float:AccuracySkills[MAX_PLAYERS][askill];
- Float:GetPercent(playerid)return ((AccuracySkills[playerid][aHead]+AccuracySkills[playerid][aBody]+AccuracySkills[playerid][aLegs])/100);
- stock const wName[][] = {
- {"Colt 45 "}, // 22
- {"Colt 45 (Silenced) "}, // 23
- {"Desert Eagle "}, // 24
- {"Normal Shotgun "}, // 25
- {"Sawnoff Shotgun "}, // 26
- {"Combat Shotgun "}, // 27
- {"Micro Uzi (Mac 10) "}, // 28
- {"MP5 "}, // 29
- {"AK47 "}, // 30
- {"M4 "}, // 31
- {"Tec9 "}, // 32
- {"Country Rifle "}, // 33
- {"Sniper Rifle "}, // 34
- {"Rocket Launcher "}, // 35
- {"Heat-Seeking Rocket Launcher "}, // 36
- {"Flamethrower "}, // 37
- {"Minigun "} // 38
- };
- public OnFilterScriptInit()
- {
- print("AimInfo geladen. Yey! :) ");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- pKills{playerid} = 0;
- pDeaths{playerid} = 0;
- for(new i; i!=17; i++)
- {
- WeapSkills[playerid][i][wShots] = 0;
- WeapSkills[playerid][i][wHits] = 0;
- }
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- if(IsValidWaffe(weaponid))WeapSkills[playerid][weaponid-22][wShots] ++;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp("/info", cmdtext, true) == 0)
- {
- new string[1000];
- new iItem;
- for(new i; i!=MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i))continue;
- new dName[MAX_PLAYER_NAME];
- GetPlayerName(i, dName, sizeof dName);
- format(string, sizeof string, "%s\n%s", string, dName);
- Listitem[playerid][iItem] = i;
- iItem ++;
- }
- ShowPlayerDialog(playerid, DIALOG_PLAYERS, DIALOG_STYLE_LIST, "Spieler:", string, "Weiter", "Abbruch");
- return 1;
- }
- return 0;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
- {
- if(issuerid != INVALID_PLAYER_ID)
- {
- if(!IsValidWaffe(weaponid))return 1;
- WeapSkills[issuerid][weaponid-22][wHits] ++;
- switch(bodypart)
- {
- case 9: AccuracySkills[issuerid][aHead] ++;
- case 3,5,6: AccuracySkills[issuerid][aBody] ++;
- case 4,7,8: AccuracySkills[issuerid][aLegs] ++;
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_PLAYERS:
- {
- if(!response)return 1;
- PickedID{playerid} = Listitem[playerid][listitem];
- ShowPlayerDialog(playerid, DIALOG_PLAYERS_OV, DIALOG_STYLE_LIST, "WaffenSkills", "KD\nTrefferquote\nSchussgenauigkeit", "OK","");
- }
- case DIALOG_PLAYERS_OV:
- {
- if(!response)return 1;
- switch(listitem)
- {
- case 0:
- {
- new string[150];
- 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%%",
- 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}}));
- ShowPlayerDialog(playerid, randINT, DIALOG_STYLE_MSGBOX, "K/D",string,"Ok","");
- }
- case 1:
- {
- new string[2000];
- new HS[17];
- for(new i=22; i!=39; i++)
- {
- 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]);
- 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]);
- }
- ShowPlayerDialog(playerid, randINT, DIALOG_STYLE_LIST, "WaffenSkills", string, "OK","");
- }
- case 2:
- {
- new string[110];
- 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));
- ShowPlayerDialog(playerid, randINT, DIALOG_STYLE_MSGBOX,"Schussgenauigkeit", string,"OK","");
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid != INVALID_PLAYER_ID)pKills{killerid} ++;
- pDeaths{playerid} ++;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement