gms_friend_isonline

Usage: gms_friend_isonline ( user_id )

Description

Returns whether the given friend is online.

Example

//Count number of online friends
var n, user_id, friends_online;
friends_online = 0;
for(n = 0; n < gms_friend_count(); n += 1)
{
    user_id = gms_friend_get(n);
    if(gms_friend_isonline(user_id))
    {
        friends_online += 1;
    }
}
show_message(string(friends_online) + " friends online.")

Replies (3)

Last message on 18 May 2015

littlecoolpug on 18 May 2015, 02:38:23
I can't find any thing for this, is there any way i could make a global var. and every time someone logs-in it adds one to it, like this:
(a player login code (i don't know what though)) {
global.playersonline += 1
}
and then draw it in the corner of the screen or something sorta like this:
draw_text(10,10,"Players Online: "+string(global.playersonline))
thanks in advance!
Size43 (Administrator) on 18 May 2015, 11:56:17
You can use

gms_other_count() + 1


to get the number of players that are logged in.
littlecoolpug on 18 May 2015, 22:00:48
ok thx