Author Topic: Weapons Stats  (Read 2527 times)

0 Members and 2 Guests are viewing this topic.

Offline KoloS

  • Major(1)
  • Posts: 3
Weapons Stats
« on: July 02, 2014, 03:55:29 am »
Script Name: Weapons Stats
Script Description:
Commands: !wepstats or !wepstats <ID>
Config: open script and edit:
Code: [Select]
const
savetype    = 2;    //1 = HWID, 2 = Name
PublicDis   = 2;    //1 = Public Display Stats 2 = Private Display Stats

Original Author(s): KoloS
Core Version: 2.7.7
Code:
Code: [Select]
function OnPlayerDamageEx(Victim,Killer: Byte; Damage: Integer; Weapon: Byte): Integer;
begin
if (GetPlayerStat(killer, 'Active') = true) and not (killer = Victim) and not (GetPlayerStat(killer,'team') = GetPlayerStat(Victim,'team')) then begin
case (Weapon) of
0: PlayerStats[killer].pistolH := inttostr(strtoint(PlayerStats[killer].pistolH) + 1);
1: PlayerStats[killer].deagleHit := inttostr(strtoint(PlayerStats[killer].deagleHit) + 1);
2: PlayerStats[killer].hkH := inttostr(strtoint(PlayerStats[killer].hkH) + 1);
3: PlayerStats[killer].akH := inttostr(strtoint(PlayerStats[killer].akH) + 1);
4: PlayerStats[killer].augH := inttostr(strtoint(PlayerStats[killer].augH) + 1);
5: PlayerStats[killer].spasH := inttostr(strtoint(PlayerStats[killer].spasH) + 1);
6: PlayerStats[killer].rugerH := inttostr(strtoint(PlayerStats[killer].rugerH) + 1);
8: PlayerStats[killer].barrettH := inttostr(strtoint(PlayerStats[killer].barrettH) + 1);
9: PlayerStats[killer].minimiH := inttostr(strtoint(PlayerStats[killer].minimiH) + 1);
10: PlayerStats[killer].minigunH := inttostr(strtoint(PlayerStats[killer].minigunH) + 1);
14: PlayerStats[killer].knifeH := inttostr(strtoint(PlayerStats[killer].knifeH) + 1);
15: PlayerStats[killer].sawH := inttostr(strtoint(PlayerStats[killer].sawH) + 1);
end;
if (Weapon = 16) and (Damage >= 25) then PlayerStats[killer].lawH := inttostr(strtoint(PlayerStats[killer].lawH) + 1);
if (Weapon = 7) and (Damage >= 40) then PlayerStats[killer].m79H := inttostr(strtoint(PlayerStats[killer].m79H) + 1);
end;
Result:=damage;
end;
Changes in  1.0.1:
- Change: OnPlayerDamageEx vice OnPlayerDamage
- Change: Use case () of
- Improved: Accuracy for m79 and law
Download:
Code: [Select]
   ||
   ||
  \||/
   \/
« Last Edit: July 04, 2014, 11:39:01 am by KoloS »

Offline kicikici

  • Soldier
  • **
  • Posts: 180
Re: Weapons Stats
« Reply #1 on: July 02, 2014, 07:52:55 am »
very very very "useful" script, nice dominik!

EDIT:
did you ever hear about case-of statement?
« Last Edit: July 02, 2014, 07:55:13 am by kicikici »
Classic banana

Offline KoloS

  • Major(1)
  • Posts: 3
Re: Weapons Stats
« Reply #2 on: July 04, 2014, 11:37:55 am »
Small update(1.0.1) at suggestion kicikici.

DarkCrusade

  • Guest
Re: Weapons Stats
« Reply #3 on: July 04, 2014, 12:15:47 pm »
Or you create an array for the weapons (0 to 16) and get rid of that wall of code........

Offline kicikici

  • Soldier
  • **
  • Posts: 180
Re: Weapons Stats
« Reply #4 on: July 04, 2014, 12:20:47 pm »
Ye, he did this in his second script, I dont know why he changed his mind here.
Classic banana

DarkCrusade

  • Guest
Re: Weapons Stats
« Reply #5 on: July 04, 2014, 12:51:16 pm »
My first guess is that it depends on where he copies the code from. :P

Offline darDar

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 794
    • #Soldat Gather - Community on Discord
Re: Weapons Stats
« Reply #6 on: July 04, 2014, 01:52:41 pm »
Accuracy stats are quite pointless since 30% of all shots are either spray shots or blind shots or for other purposes ( boosting, boosting the flag or kits)
Soldat Gather 'Matchmaking Community on Discord'

gather.soldat.pl

| My Maps: ctf_Pyramid, ctf_Replay, ctf_Blako, ctf_R6, ctf_Ntex, ctf_Caro, ctf_Bizar & vs_mode mappack |