gms_session_player_count

Usage: gms_session_player_count ( id )

Description

Returns the number of players in the session that belongs to the provided session_id.

Deprecated: id can be used as an index. In this case, the function will return the number of players in the nth session.

Replies (11)

Last message on 4 Sep 2017

conanphamtuan on 21 Oct 2016, 17:34:13
how can i get id of n'th player in a session?
Size43 (Administrator) on 23 Oct 2016, 19:20:52
conanphamtuan on 24 Oct 2016, 17:45:15
i want to get id of n'th player , not id of n'th session
Size43 (Administrator) on 24 Oct 2016, 17:46:31
You can only list the players in your own session, not other sessions.
conanphamtuan on 25 Oct 2016, 13:24:30
how can i list the ids of players in my own sessions?
Size43 (Administrator) on 28 Oct 2016, 17:23:53
Use the gms_other_* set of functions.
conanphamtuan on 24 Oct 2016, 13:32:59
is it include me?
conanphamtuan on 24 Oct 2016, 13:33:23
include my player?
Size43 (Administrator) on 24 Oct 2016, 17:46:45
The count includes you, yes.
Arcadian on 19 Sep 2016, 19:11:20
Is there a way to retrieve player_id (or other type of data) from the players involved in a certain session?
I'm making a game using VS mode, so the players are included automatically, but I need to set a random start (it's a turn based game) at the beginning of the game, and I can't imagine the better way to built that system.
Size43 (Administrator) on 20 Sep 2016, 17:14:24
You could use the sessionID to randomize the start:

random_set_seed(gms_session_current_id())
// Use random(), choose(), irandom_range(), etc. to choose the start.
randomize()