Raised This Month: $ Target: $400
 0% 

get_players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-22-2022 , 00:34   Re: get_players
Reply With Quote #1

Don't look to much at this one, i don't think it's recommended doing it this way, but if it works, it works in my opinion (if it doesn't have significant negative effects on the server).

Two things that might be helpful for you.

Get enemy players.

Spoiler



Get Alive Team Players.


Spoiler


All these things are untested, but should do their job, except for the first one, that might just be a no-go by the amxmodx communicty.

If you need more info on what i did, feel free to ask, but i feel like it's pretty common sense.
__________________

Last edited by Napoleon_be; 10-22-2022 at 01:22.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-22-2022 , 01:49   Re: get_players
Reply With Quote #2

Quote:
Originally Posted by Napoleon_be View Post
Don't look to much at this one, i don't think it's recommended doing it this way, but if it works, it works in my opinion (if it doesn't have significant negative effects on the server).

Two things that might be helpful for you.

Get enemy players.

Spoiler



Get Alive Team Players.


Spoiler


All these things are untested, but should do their job, except for the first one, that might just be a no-go by the amxmodx communicty.

If you need more info on what i did, feel free to ask, but i feel like it's pretty common sense.
Neither of these make any sense. Simply use get_players() with team argument determined by the check that I posted. It's actually quite simple, no loops necessary.
__________________
fysiks is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 10-23-2022 , 16:48   Re: get_players
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
Don't look to much at this one, i don't think it's recommended doing it this way, but if it works, it works in my opinion (if it doesn't have significant negative effects on the server).

Two things that might be helpful for you.

Get enemy players.

Spoiler



Get Alive Team Players.


Spoiler


All these things are untested, but should do their job, except for the first one, that might just be a no-go by the amxmodx communicty.

If you need more info on what i did, feel free to ask, but i feel like it's pretty common sense.

Spoiler



Get Alive Team Players.


getting my team in a loop 0_0, its really unnecesary..


===>

PHP Code:
get_enemy_players(id)
{
    new 
iPlayers[33], iNumiEnemiesMyTeam;
    
get_players(iPlayersiNum"a" );

       
MyTeam get_user_team(id);

    for(new 
iiNumiNum)
    {
        if(
MyTeam != get_user_team(iPlayers[i])
            
iEnemies++
    }
    return 
iEnemies;


Last edited by MrPickles; 10-23-2022 at 16:48.
MrPickles 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 15:40.


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