Raised This Month: $32 Target: $400
 8% 

[CS|HL] StatTrak Technology v1.2 (BOT Support, AMXX 1.8 Compatible)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Statistical       
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-17-2024 , 17:57   [CS|HL] StatTrak Technology v1.2 (BOT Support, AMXX 1.8 Compatible)
Reply With Quote #1

  • Description
    Records all kills on a counter for each weapon
  • Modules
    1. nVault - database module
    2. JSON - value of key entry (if using amxx 1.9+)
  • Cvars
    1. hud_channel_stattrak (default: -1) channel to use on the client
    2. hud_color_stattrak (default: 255) the higher the brighter text, lower the value to recreate troxler fading
  • Commands
    say stattrak - stats menu
    when spectating will show players' stats
  • Install
    Click `Get Plugin`
  • API
    Code:
    #include <amxmodx> native get_user_stattrak(id, weaponid) public plugin_init()     register_clcmd("say f", "clcmd_f") public clcmd_f(id) {     client_print(id, print_chat, "This: %d", get_user_stattrak(id, get_user_weapon(id)))     client_print(id, print_chat, "Glock 18: %d", get_user_stattrak(id, CSW_GLOCK18)) }
  • Notes
    StatTrak menu will show after you killed at least one person
    StatTrak counter will show after you have killed at least one person with currently carried weapon
    Able to see other players' current weapon kills when spectating
    Supports BOTs by using name as key
    First seen https://forums.alliedmods.net/showthread.php?t=344745

    For Half-Life Deathmatch:
    Removed ability to see other players weapon stats
    Removed ability to save BOTs stats
    Replaced HUD Message with Status Text
  • Image



    Player is a BOT
Attached Files
File Type: sma Get Plugin or Get Source (stattrak.sma - 42 views - 6.9 KB)
File Type: sma Get Plugin or Get Source (stattrak_valve.sma - 18 views - 5.4 KB)
__________________

Last edited by bigdaddy424; 04-09-2024 at 23:26. Reason: Updated to 1.2
bigdaddy424 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 03-17-2024 , 19:27   Re: StatTrak Technology
Reply With Quote #2

Nice.

You have not mentioned it will only show the stats when at least 1 player is killed.
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com

Last edited by WATCH_D0GS UNITED; 03-17-2024 at 19:30. Reason: not id
WATCH_D0GS UNITED is offline
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 03-17-2024 , 20:30   Re: StatTrak Technology
Reply With Quote #3

Good job
__________________
amirwolf is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 03-17-2024 , 20:54   Re: StatTrak Technology
Reply With Quote #4

You can use Item_Deploy as Post in this case instead of CurWeapon.

You can also use Ham_Killed as Post using the second parameter as the killer.

And ultimately, you can use FM_GetGameDescription forward to update each second with a for loop to iterate in all players (instead of set_task on each second).
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-17-2024 , 22:59   Re: StatTrak Technology
Reply With Quote #5

Is there an impactful difference using DeathMsg or Ham_Killed as per gold standard?
Switched to Ham_Item_Deploy instead of CurWeapon
Apparently CurWeapon will fire every round shot https://imgur.com/FI8jonJ
PHP Code:
#include <amxmodx>

public plugin_init()
    
register_event("CurWeapon""player_weapon""be""1=1")

public 
player_weapon(id)
{
    new 
isActive read_data(1)
    new 
WeaponID read_data(2)
    new 
ClipAmmo read_data(3)
    new 
Weapon_Name[MAX_NAME_LENGTH]
    
get_weaponname(WeaponIDWeapon_NameMAX_NAME_LENGTH 1)
    
    
server_print "|isActive|%d|WeaponID|%d(%s)|ClipAmmo|%d|name|%n"isActiveWeaponIDWeapon_NameClipAmmoid

__________________
bigdaddy424 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 03-18-2024 , 10:59   Re: StatTrak Technology
Reply With Quote #6

The change you did its enough.

Because CurWeapon is called whenever the HUD clip value changes (shooting and after reloading),
when using snipers scope, and when changing weapons (which is the goal in your code).

About Ham_Killed, basically you will eliminate the need of using a native to retrieve the killer.

And about FM_GetGameDescription, in our tests it's always called 1 time per second.
But there's something else:

PHP Code:
https://www.amxmodx.org/api/fakemeta_const

    // This also gets called when the server is queried for information (for example, by a server browser tool)
    
FM_GetGameDescription
Do you plan on adding more features on it?

We are optimizing Aim Realism code for months and We have got something that could be used in your plugin.

It's a code which is able to get all the weapons the players are currently holding with minimal CPU usage.

For example:

PHP Code:
AK47[3// 3 Players are currently holding AK47
M4A1[5// 5 Players are currently holding M4A1 
We thought about creating a plugin which shows a weapon sprite in the left side of the screen instead of text and the number in front of it indicating how many players are holding it.

It only needs to use Ham_Item_Deploy, Ham_Killed, and FM_ClientDisconnect to update the status.

We will release Aim Realism unfinished soon.

We need to conclude a fail-less anti-cheat system which is able to catch any kind of Auto aim / Aimbot in less than 0.02s with minimal CPU usage.

But in case you are interested, We can share with you the code for getting current player weapons.
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-20-2024 , 01:34   Re: StatTrak Technology v1.1 (BOT Support)
Reply With Quote #7

thanks for your comment, i thought a bit more and decided to add support for bots, since the plugin caches data using authid ive decided to check whether the client is a bot and use their name instead, considering that server admins wont use special characters to corrupt the vault file if theres ever a possibility.
heres how my save file looks at this moment, im using yapb on a test-server im running a 5v5 all bots


im not sure if i really need variable for checking what weapons player has because im certain i dont have to.
im using hudmessage to mimic the position and text from CS:GO
https://steamuserimages-a.akamaihd.n...etterbox=false
i increment by 1 nth position which is defined from the weapon players' got the kill with https://www.amxmodx.org/api/cstrike_const
__________________
bigdaddy424 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 04-09-2024 , 19:23   Re: [CS|HL] StatTrak Technology v1.2 (BOT Support, AMXX 1.8 Compatible)
Reply With Quote #8

bug?: not able to select `More` in menu options
__________________
bigdaddy424 is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 04-09-2024 , 20:34   Re: [CS|HL] StatTrak Technology v1.2 (BOT Support, AMXX 1.8 Compatible)
Reply With Quote #9

Quote:
Originally Posted by bigdaddy424 View Post
bug?: not able to select `More` in menu options
Half-Life doesn't have keys 6 to 0 bound by default.
__________________
gabuch2 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode