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

Solved get_players_ex vs get_players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-09-2021 , 17:18   get_players_ex vs get_players
Reply With Quote #1

What is better ? get_players_ex or get_players and why !!
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 06-11-2021 at 23:15.
Supremache is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-09-2021 , 17:33   Re: get_players_ex vs get_players
Reply With Quote #2

Read the function descriptions

https://www.amxmodx.org/api/amxmisc/get_players_ex
https://www.amxmodx.org/api/amxmodx/get_players
__________________

Last edited by Bugsy; 06-09-2021 at 17:34.
Bugsy is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-09-2021 , 17:43   Re: get_players_ex vs get_players
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
What is the better!!

they are doing the same thing but the difference is with get_players_ex use named constants for flags instead of letters.
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 06-09-2021 at 17:56.
Supremache is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-09-2021 , 19:04   Re: get_players_ex vs get_players
Reply With Quote #4

It does the same thing, so in that respect neither is better. _ex is easier to use as you do not need to dig up what each letter flag corresponds to each time you want to use it. It literally is the same besides the flags part.

PHP Code:
stock get_players_ex(players[MAX_PLAYERS] = {}, &numGetPlayersFlags:flags GetPlayers_None, const team[] = "")
{
    new 
strFlags[10];
    
get_flags(_:flagsstrFlagscharsmax(strFlags));
    
get_players(playersnumstrFlagsteam);

__________________

Last edited by Bugsy; 06-09-2021 at 22:15.
Bugsy is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-10-2021 , 11:15   Re: get_players_ex vs get_players
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
It does the same thing, so in that respect neither is better. _ex is easier to use as you do not need to dig up what each letter flag corresponds to each time you want to use it. It literally is the same besides the flags part.

PHP Code:
stock get_players_ex(players[MAX_PLAYERS] = {}, &numGetPlayersFlags:flags GetPlayers_None, const team[] = "")
{
    new 
strFlags[10];
    
get_flags(_:flagsstrFlagscharsmax(strFlags));
    
get_players(playersnumstrFlagsteam);

I was think ex is much faster like formatex/format
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-10-2021 , 21:39   Re: get_players_ex vs get_players
Reply With Quote #6

Quote:
Originally Posted by Supremache View Post
I was think ex is much faster like formatex/format
No. That is not a valid comparison. If you actually look at the code Bugsy posted, you'll see that the _ex function calls the original function so it can't be faster than the original function.
__________________
fysiks is online now
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-11-2021 , 23:15   Re: get_players_ex vs get_players
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
No. That is not a valid comparison. If you actually look at the code Bugsy posted, you'll see that the _ex function calls the original function so it can't be faster than the original function.
Well, I got it
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache 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 02:19.


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