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

Question about native : get_players


Post New Thread Reply   
 
Thread Tools Display Modes
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 12-11-2023 , 08:08   Re: Question about native : get_players
Reply With Quote #21

Quote:
Originally Posted by Jhob94 View Post
The natives i use are get_orig_retval, is_user_alive and is_user_connected. There is no harm on doing that. Plus i have no idea what my plugins have to do with this topic.
Don't try escaping from something obvious.

Using 3 natives in a forward which is called 30000 times per second is a more than valid case for caching the results from the natives.

Both fysiks, and HamletEagle and other veteran members may agree that you have no fundament in what you are commenting:

Firstly, you come to our plugin thread to say we should use Ham_Spawn to check player team, and now you come to this thread to talk to someone that [B]with the computers we have today this isn’t a problem.[B]

It's better for you to say nothing instead of these arbitrary and nonsensical comments.

All you did on our plugin page was to say it has a bunch of nonsense (which you could not even point out), and the joke about checking the targeted player team in <spawn moment>.
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 12-11-2023 , 08:15   Re: Question about native : get_players
Reply With Quote #22

I don’t think you’ve read the cpp of is_user_alive and is_user_connected so i will ignore you from now on
__________________
Jhob94 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 12-11-2023 , 13:52   Re: Question about native : get_players
Reply With Quote #23

Quote:
Originally Posted by Jhob94 View Post
I donÂ’t think youÂ’ve read the cpp of is_user_alive and is_user_connected so i will ignore you from now on
And we think you've not read the cpp of get_players:

PHP Code:
static cell AMX_NATIVE_CALL get_players(AMX *amxcell *params/* 4 param */
{
    
int iNum 0;
    
int ilen;
    
charsptemp get_amxstring(amxparams[3], 0ilen);
    
int flags UTIL_ReadFlags(sptemp);

    
cell *aPlayers get_amxaddr(amxparams[1]);
    
cell *iMax get_amxaddr(amxparams[2]);

    
int team 0;

    if (
flags 48)
    {
        
sptemp get_amxstring(amxparams[4], 0ilen);

        if (
flags 16)
        {
            if (
flags 64)
                
team g_teamsIds.findTeamId(sptemp);
            else
                
team g_teamsIds.findTeamIdCase(sptemp);
        }
    }

    for (
int i 1<= gpGlobals->maxClients; ++i)
    {
        
CPlayerpPlayer GET_PLAYER_POINTER_I(i);
        if (
pPlayer->ingame || ((flags 256) && pPlayer->initialized))
        {
            if (
pPlayer->IsAlive() ? (flags 2) : (flags 1))
                continue;
            if (
pPlayer->IsBot() ? (flags 4) : (flags 8))
                continue;
            if ((
flags 16) && (pPlayer->teamId != team))
                continue;
            if ((
flags 128) && (pPlayer->pEdict->v.flags FL_PROXY))
                continue;
            if (
flags 32)
            {
                if (
flags 64)
                {
                    if (
utf8stristr(pPlayer->name.chars(), sptemp) == NULL)
                        continue;
                }
                else if (
strstr(pPlayer->name.chars(), sptemp) == NULL)
                    continue;
            }
            
aPlayers[iNum++] = i;
        }
    }

    *
iMax iNum;

    return 
1;


What you told about get_players:

Quote:
Originally Posted by Jhob94 View Post
with the computers we have today this isn't a problem.


get_user_team:
PHP Code:
static cell AMX_NATIVE_CALL get_user_team(AMX *amxcell *params/* 3 param */
{
    
int index params[1];

    if (
index || index gpGlobals->maxClients)
        return -
1;

    
CPlayerpPlayer GET_PLAYER_POINTER_I(index);

    if (
pPlayer->ingame)
    {
        
// SidLuke, DoD fix
        
if (g_bmod_dod)
        {
            
int iTeam pPlayer->pEdict->v.team;

            if (
params[3])
            {
                const 
char *szTeam "";

                switch (
iTeam)
                {
                    case 
1:
                        
szTeam "Allies";
                        break;
                    case 
2:
                        
szTeam "Axis";
                        break;
                }

                
set_amxstring(amxparams[2], szTeamparams[3]);
            }
            return 
iTeam;
        }
        
//
        
if (params[3])
        {
            
set_amxstring(amxparams[2], pPlayer->team.chars(), params[3]);
        }

        return 
pPlayer->teamId;
    }

    return -
1;


Again, your conversations are arbitrary, have no fundament.
They're eliminating the sense of each other.

You care about get_user_team in a topic, which has no for loop,
and about get_players which has a for loop and complex checks, you say it's not a problem.



About is_user_alive and the two other natives, the CPU time required will be obviously higher compared to a cached value check:

PHP Code:
static cell AMX_NATIVE_CALL is_user_alive(AMX *amxcell *params/* 1 param */
{
    
int index params[1];

    if (
index || index gpGlobals->maxClients)
    {
        return 
FALSE;
    }

    
CPlayerpPlayer GET_PLAYER_POINTER_I(index);

    if (!
pPlayer->ingame)
    {
        return 
FALSE;
    }

    if (
g_bmod_tfc)
    {
        
edict_t *pPlayer->pEdict;
        if (
e->v.flags FL_SPECTATOR ||
            (!
e->v.team || !e->v.playerclass))
        {
            return 
FALSE;
        }
    }

    return 
pPlayer->IsAlive() ? TRUE FALSE;

PHP Code:
If(Alive[id])
{
    
something

-
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 12-11-2023 , 14:09   Re: Question about native : get_players
Reply With Quote #24

Go ahead and report nightcrawler thread and request an unapproval for using is_user_alive and is_user_connected on addtofullpack.
After that report yourself for ban evading.

You can’t understand stuff and you don’t even try. Like i said, i am not going to waste more time with you.
__________________
Jhob94 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 12-11-2023 , 14:44   Re: Question about native : get_players
Reply With Quote #25

Quote:
Originally Posted by Jhob94 View Post
You can’t understand stuff and you don’t even try.
?

The how many times we'll need to give him clear proof he's is posting controversial stuff is a real reason for a desistence.

More funny would be HamletEagle come here and explain better to him why using 3 natives in a forward called 34.000 times a second causes higher CPU usage than checking a cached value, and is a much more valid case.

If something which is called 34.000 times per second is not a reason for caching the native results, than, nothing is valid.

We don't want your plugin being unapproved sir, we simply quoted something about it.

Our plugin is more subject for a disapproval, even if it was coded by the best coder in the world because it is very short/has few features. The reason we posted it in the new plugin submissions section is because the section name says everything and we plan on adding features to it.

About our account, this was due to one of the guys in our team which we banned him from our team because we found he was trying to access our files without permission. In that time we were inactive as we were only blogging. We've forgot he could access our AM account with the password. Not sure about what he made with the account.

About you, anyway, this is not the way a programmer should deal with his troubles.
Simply accept you are not perfect.
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com

Last edited by WATCH_D0GS UNITED; 12-11-2023 at 14:45.
WATCH_D0GS UNITED is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 12-12-2023 , 19:28   Re: Question about native : get_players
Reply With Quote #26

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
yes, or easyprofiler

regarding the native ones that you mention, what would be their optimization, possibly it would be considered to merge with the branch
__________________
mlibre 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 21:21.


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