Raised This Month: $51 Target: $400
 12% 

Solved Get players medigun TF2


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Cieniu97
Junior Member
Join Date: Sep 2021
Location: Poland
Old 09-15-2021 , 19:26   Get players medigun TF2
Reply With Quote #1

Intro:
Hello, I'm new here :>
Recently I started working on plugin for TF2 that logs events. I am completely new to sourcemod. Could use some help.

Context:
There is an event in TF2 called "player_chargedeployed".
It launches as it states when uber charge is deployed. It provides us with two values userid and targetid.

Question:
I would like to know if one could get type of uber used based on that information. Stock, kritz, quick-fix, vax.

My attempt:

PHP Code:
public Action Event_ChargeDeployed(Event event, const char[] namebool dontBroadcast)
{
        
    
char userid[64];
    
userid getSteam64(event.GetInt("userid"));
    
    
int clientIndex GetClientOfUserId(event.GetInt("userid"));
    
char typeOfUber[32];
    
GetClientWeapon(clientIndextypeOfUbersizeof(typeOfUber));
    
    
char targetid[64];
    
targetid getSteam64(event.GetInt("targetid"));
        
    
PrintToChatAll("player_chargedeployed,userid:%s,targetid:%s,typeofuber:%s"useridtargetidtypeOfUber);    

My output: tf_weapon_medigun
Expected output: name of specific medicgun for exampl tf_weapon_vaccinator

Outro:
If I broke any of your forum standards plz let me know, happy to improve!

Last edited by Cieniu97; 10-02-2021 at 06:32.
Cieniu97 is offline
 



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 23:47.


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