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

[TF2] tf_dropped_weapon's m_iAccountID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Whai
Senior Member
Join Date: Jul 2018
Old 02-23-2019 , 08:49   [TF2] tf_dropped_weapon's m_iAccountID
Reply With Quote #1

Hi, I've made a plugin "Be Robin Walker" but there is a problem : I can't get the owner of the powerful weapon, here is my code :

PHP Code:
public void OnEntityCreated(int entity, const char[] classname)
{
    if(
StrEqual(classname"tf_dropped_weapon"false))
    {
        
SDKHook(entitySDKHook_SpawnPostDroppedWeaponSpawn);
    }
}

public 
void DroppedWeaponSpawn(int iEntity)
{
    for(
int i 0<= MaxClientsi++)
    {
        if(
IsValidClient(i))
        {
            if(
bIsRobin[i])
            {
                
PrintToChat(i"Client Account id :%d || Owner account id : %i"GetSteamAccountID(i), GetEntProp(iEntityProp_Send"m_iAccountID"));

                if(
GetEntProp(iEntityProp_Send"m_iAccountID") == GetSteamAccountID(i))
                {
                    
AcceptEntityInput(iEntity"Kill");
                }
            }
        }
    }

result :
Code:
"Client Account id : 123456789 || Owner account id : 0
__________________
Whai is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 02-24-2019 , 05:53   Re: [TF2] tf_dropped_weapon's m_iAccountID
Reply With Quote #2

GetEntPropEnt
__________________
Ilusion9 is offline
Whai
Senior Member
Join Date: Jul 2018
Old 03-05-2019 , 13:14   Re: [TF2] tf_dropped_weapon's m_iAccountID
Reply With Quote #3

Quote:
Originally Posted by Ilusion9 View Post
GetEntPropEnt
Not Working, it return -1.




Problem Solved, the problem was the weapon created with tf2items that always returns 0 else, with other weapon : it returns the Owner accountID so all good, just check if the weapon Owner accountID is equal to 0
__________________

Last edited by Whai; 03-05-2019 at 13:15. Reason: miss s
Whai 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 11:03.


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