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

get_players() returning wrong value


Post New Thread Reply   
 
Thread Tools Display Modes
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 10-17-2017 , 06:56   Re: get_players() returning wrong value
Reply With Quote #11

Quote:
Originally Posted by KliPPy View Post
IIRC random() produces a garbage value if you give it anything below 1.
It produces raw random value (from 0 to 2^31-1) for random(0).
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-17-2017 , 09:09   Re: get_players() returning wrong value
Reply With Quote #12

Quote:
Originally Posted by PRoSToTeM@ View Post
It produces raw random value (from 0 to 2^31-1) for random(0).
Oh right.
klippy is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 10-17-2017 , 14:39   Re: get_players() returning wrong value
Reply With Quote #13

???

You forgot that get_players with "e" argument is bugged?

There were like many topics about that problem.

I don't know exactly if it's bugged for "TERRORIST" and "CT" but i know that it's bugged for "SPECTATOR" .

As I remember it returns correct results only when using it with flag a like get_players(players, count, "ae").

Just use cs_get_user_team and do a simple loop up to max players...

(I thought this thing was fixed in dev build...)

Last edited by siriusmd99; 10-17-2017 at 14:40.
siriusmd99 is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 10-17-2017 , 16:52   Re: get_players() returning wrong value
Reply With Quote #14

Quote:
Originally Posted by siriusmd99 View Post
???

You forgot that get_players with "e" argument is bugged?

There were like many topics about that problem.

I don't know exactly if it's bugged for "TERRORIST" and "CT" but i know that it's bugged for "SPECTATOR" .

As I remember it returns correct results only when using it with flag a like get_players(players, count, "ae").

Just use cs_get_user_team and do a simple loop up to max players...

(I thought this thing was fixed in dev build...)
I have used get_players for "TERRORIST" and "CT" so much times, so for sure it's not bugged, but not sure for "SPECTATOR". This at 1.8.2.
KiLLeR. is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-17-2017 , 17:09   Re: get_players() returning wrong value
Reply With Quote #15

Its bugged only for team SPEC in amxx v1.8.2 idk if they fixed it in dev 1.8.3
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 10-17-2017 , 17:22   Re: get_players() returning wrong value
Reply With Quote #16

Forget about the code's sense....

sisrius, I already did that as I said in the #3 reply and it's working fine. But I really don't know what can be the issue.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 10-17-2017 , 17:24   Re: get_players() returning wrong value
Reply With Quote #17

Get players without 'e' flag and ignore Ts/CTs of the loop, after return a random player based on that count.
__________________









Last edited by CrazY.; 10-17-2017 at 19:23.
CrazY. is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-17-2017 , 17:24   Re: get_players() returning wrong value
Reply With Quote #18

Quote:
Originally Posted by EFFx View Post
Forget about the code's sense....

sisrius, I already did that as I said in the #3 reply and it's working fine. But I really don't know what can be the issue.
Can you explain what are you trying to achieve...
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 10-17-2017 , 17:48   Re: get_players() returning wrong value
Reply With Quote #19

@EFFx did you read my post?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 10-17-2017 , 18:57   Re: get_players() returning wrong value
Reply With Quote #20

Quote:
Originally Posted by Natsheh View Post
Can you explain what are you trying to achieve...
Kick a random spec but the iNum that I'm using in get_players() is returning 0 but there's 2-3 spectators.

Quote:
Originally Posted by PRoSToTeM@ View Post
Imagine you have 1 player on the server and he is in CT team. So, get_players in CheckSpec will return 1 player, then you check if him is CT or TR, if so you call kickRandomSpec and its get_players return 0 players, because you have only 1 CT which isn't a spectator.

random(0) is like random_num(0, -1), so its invalid and looks like its returning negative value.


I did not get it...
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx 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 13:40.


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