AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get index of player (https://forums.alliedmods.net/showthread.php?t=275261)

CHE4TER 11-26-2015 00:45

Get index of player
 
How can i get player index without puting index/id... in ev_deathmsg?
PHP Code:

public Ev_DeathMsg()
{
    new 
szAuthID35 ]; get_user_authidindexszAuthIDcmszAuthID ) )



fysiks 11-26-2015 01:07

Re: Get index of player
 
It depends on what you are actually hooking. If you are hooking the actual death message (as opposed to Ham_Spawn), you can get the appropriate argument that contains the dead player's entity number. Search for other examples of hooking "DeathMsg" because most all of them will use either the killer or victim id.

Also, you can see all the arguments of the various messages here.

CHE4TER 11-26-2015 01:16

Re: Get index of player
 
Quote:

Originally Posted by fysiks (Post 2366442)
It depends on what you are actually hooking. If you are hooking the actual death message (as opposed to Ham_Spawn), you can get the appropriate argument that contains the dead player's entity number. Search for other examples of hooking "DeathMsg" because most all of them will use either the killer or victim id.

Also, you can see all the arguments of the various messages here.

Thanks. And what i'm trying to do, is something like this:


PHP Code:

public Ev_DeathMsg()
{
// steamids 
    
new szAuthID35 ]; get_user_authidindexszAuthIDcmszAuthID ) )
    new 
iDummy;

    new 
iKiller read_data)
    new 
iVictim read_data)
    new 
iIsHeadshot read_data)

// if steamid found
    
if(iIsHeadshot && TrieGetCellg_tAuthIdOfPeopleszAuthIDiDummy) ) 
    {
       
// send hud message
    
}
else
{
// another stuff



fysiks 11-26-2015 01:26

Re: Get index of player
 
Ok. Did you have another question? Your code currently won't run or compile.


All times are GMT -4. The time now is 18:06.

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