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)
- 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,
- wAmmo
- }
- new WeapSkills[MAX_PLAYERS][17][wskill];
- 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][wAmmo] = 0;
- WeapSkills[playerid][i][wShots] = 0;
- WeapSkills[playerid][i][wHits] = 0;
- }
- }
- public OnPlayerUpdate(playerid)
- {
- new Ammo;
- new Waffe;
- for(new i; i != 11; i++)
- {
- GetPlayerWeaponData(playerid, i, Waffe, Ammo);
- if(!IsValidWaffe(Waffe))continue;
- if(Ammo > WeapSkills[playerid][Waffe-22][wAmmo])WeapSkills[playerid][Waffe-22][wAmmo] = Ammo;
- if(Ammo < WeapSkills[playerid][Waffe-22][wAmmo])
- {
- WeapSkills[playerid][Waffe-22][wAmmo] --;
- WeapSkills[playerid][Waffe-22][wShots] ++;
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp("/w", cmdtext, true) == 0)
- {
- WeapSkills[playerid][31-22][wAmmo] = 500;//Muss eigentlich nicht, da es automatisch auch gesetzt wird.
- GivePlayerWeapon(playerid, 31, 500);
- WeapSkills[playerid][24-22][wAmmo] = 200;
- GivePlayerWeapon(playerid, 24, 200);
- return 1;
- }
- 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)
- {
- if(issuerid != INVALID_PLAYER_ID)
- {
- if(!IsValidWaffe(weaponid))return 1;
- WeapSkills[issuerid][weaponid-22][wHits] ++;
- }
- 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\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!=38; 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","");
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid != INVALID_PLAYER_ID)pKills{killerid} ++;
- pDeaths{playerid} ++;
- return 1;
- }
- IsValidWaffe(id)
- {
- if(id > 21 && id < 39)return 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement