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

Solved [DOUBT] Most reliable way to discover the team.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-05-2020 , 11:55   [DOUBT] Most reliable way to discover the team.
Reply With Quote #1

Hi, I have a question about the different ways to discover the player's team.

cs_get_user_team(index)
get_user_team(index)
get_ent_data(index, "CBasePlayer","m_iTeam")

Which would be the most advantageous in terms of reliability or will there be no difference?

Remembering that I know that get_user_team and get_ent_data return the value int, and that I use amxx dev 1.10
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 04-05-2020 at 15:33.
iceeedr is offline
Send a message via Skype™ to iceeedr
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2020 , 12:04   Re: [DOUBT] Most reliable way to discover the team.
Reply With Quote #2

cs_get_user_team() and get_ent_data(index, "CBasePlayer","m_iTeam") are essentially getting team from the same place. Are you having any problems with cs_get_user_team()?

m_iTeam == 114

OFFSET_TEAM == 114
PHP Code:
static cell AMX_NATIVE_CALL cs_get_user_team(AMX *amxcell *params// cs_get_user_team(index); = 1 param
{
    
// Get user team
    // params[1] = user index

    // Valid entity should be within range
    
cell *model;
    
CHECK_PLAYER(params[1]);

    
// Make into edict pointer
    
edict_t *pPlayer MF_GetPlayerEdict(params[1]);

    if ((
params[0] / sizeof(cell)) >= 2)
    {
        
model MF_GetAmxAddr(amxparams[2]);
        *
model = *((int *)pPlayer->pvPrivateData OFFSET_INTERNALMODEL);
    }

    return *((
int *)pPlayer->pvPrivateData OFFSET_TEAM);

__________________
Bugsy is online now
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-05-2020 , 13:43   Re: [DOUBT] Most reliable way to discover the team.
Reply With Quote #3

No, no problem, I was just wondering if any of the methods will be more or less reliable in certain situations, but as I understand it, there is no gain or loss in using any of the methods, thanks Bugsy.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-05-2020 , 15:56   Re: [DOUBT] Most reliable way to discover the team.
Reply With Quote #4

If cs_get_user_team() wasn't working, it would need to be reported as a bug. Always use this and if you discover a bug then report it. The function wouldn't exist if it wasn't intended to work.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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:19.


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