View Single Post
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 04-17-2024 , 20:43   Re: Choosing a random player
Reply With Quote #17

Quote:
Originally Posted by bigdaddy424 View Post
youre totally confused and try to not lose it lol
��Useless.

Is this what you have to say for those who a day tried to help you optimize your content in something?

Now that we know what kind of person you are, we will no more give feedback to you in anything or suggest your content to someone.

Also, you are confused:

Quote:
Originally Posted by bigdaddy424 View Post
you can get a random player like this
Code:
new id, players = get_playersnum()
if (players)
	id = random(1, players)
PHP Code:
error 088number of arguments does not match definition 
Keep trying to catch gun sounds in FM_EmitSound like many Veteran members suggested in this forum



Quote:
Originally Posted by Bugsy View Post
No, random(7) = {0,1,2,3,4,5,6}

Quote:
Originally Posted by Bugsy View Post

This is fine as you are not using the random number as the player index, you are using it as an index to the iPlayers array, which get_players() fills with all valid player id's.. The iPlayers[ 0 ] slot will contain a valid player id if iNum is > 0.
Thanks for the explanation.

We now understand that iPlayers[ 0 ] will hold a value of a valid client index, not the cell index value itself.
This should also be better documented in the API page.

Quote:
Originally Posted by Bugsy View Post
Please don't try to help others if you are not confident in what you are saying.
We had absolutely no doubt of what we were talking about.

What was said is partially correct, it becomes an exception only in this specific case.

Quote:
Originally Posted by mlibre View Post
in get_players does not apply, in get_maxplayers yes!
��Thanks mate.
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com

Last edited by WATCH_D0GS UNITED; 04-17-2024 at 20:57. Reason: EXCLUSIVE upper bound
WATCH_D0GS UNITED is offline