Jump to content
  • 0

On online GM or Player


mrlongshen

Question


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

based on the topic, i want to request a log on chat box on all gm.

all gm will know who online..

can?

Edited by mrlongshen
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

I was confused by the topic title.

Do you want it to announce to GMs when another GM logs in/out?

or announce to GMs when any player logs in/out?

If you have trunk/conf/groups.conf,

	permissions: {
	receive_requests: true
}

then you can use @request to send the message to all online GMs:

-	script	a_gm_is_online	-1,{
OnPCLoginEvent:
if (getgmlevel() > 0)
	atcommand "@request "+strcharinfo(0)+" is ONLINE.";
end;
OnPCLogoutEvent:
if (getgmlevel() > 0)
	atcommand "@request "+strcharinfo(0)+" has logged out.";
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

I was confused by the topic title.

Do you want it to announce to GMs when another GM logs in/out?

or announce to GMs when any player logs in/out?

If you have trunk/conf/groups.conf,

	permissions: {
	receive_requests: true
}

then you can use @request to send the message to all online GMs:

-	script	a_gm_is_online	-1,{
OnPCLoginEvent:
if (getgmlevel() > 0)
	atcommand "@request "+strcharinfo(0)+" is ONLINE.";
end;
OnPCLogoutEvent:
if (getgmlevel() > 0)
	atcommand "@request "+strcharinfo(0)+" has logged out.";
end;
}

sir i want both. gm and player online. it will be like a friend online..

A friend Brian is online

like that. hehe can ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

@request command spam my PM box <.<

I'll do another way

-	script	gm_build_array_online	-1,{
OnInit:
.gm_level = 60; // set min gm level here

if ( getusers(1) ) end;
deletearray $gm_online_aid;
$gm_online_count = 0;
end;

OnPCLoginEvent:
$gm_online_aid[ $gm_online_count ] = getcharid(3);
$gm_online_count++;
end;
OnPCLogoutEvent:
while ( $gm_online_aid[.@i] != getcharid(3) && .@i < $gm_online_count ) .@i++;
if ( .@i == $gm_online_count ) end; // prevent @loadnpc/@reloadscript bug becos not in the array
deletearray $gm_online_aid[.@i], 1;
$gm_online_count--;
end;
}

-	script	announce_every_player	-1,{
OnPCLoginEvent:
for ( .@i = 0; .@i < $gm_online_count; .@i++ )
	message rid2name( $gm_online_aid[.@i] ), strcharinfo(0) +" has online";
end;
OnPCLogoutEvent:
for ( .@i = 0; .@i < $gm_online_count; .@i++ )
	message rid2name( $gm_online_aid[.@i] ), strcharinfo(0) +" has offline";
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

@request command spam my PM box <.<

I'll do another way

-	script	gm_build_array_online	-1,{
OnInit:
.gm_level = 60; // set min gm level here

if ( getusers(1) ) end;
deletearray $gm_online_aid;
$gm_online_count = 0;
end;

OnPCLoginEvent:
$gm_online_aid[ $gm_online_count ] = getcharid(3);
$gm_online_count++;
end;
OnPCLogoutEvent:
while ( $gm_online_aid[.@i] != getcharid(3) && .@i < $gm_online_count ) .@i++;
if ( .@i == $gm_online_count ) end; // prevent @loadnpc/@reloadscript bug becos not in the array
deletearray $gm_online_aid[.@i], 1;
$gm_online_count--;
end;
}

-	script	announce_every_player	-1,{
OnPCLoginEvent:
for ( .@i = 0; .@i < $gm_online_count; .@i++ )
	message rid2name( $gm_online_aid[.@i] ), strcharinfo(0) +" has online";
end;
OnPCLogoutEvent:
for ( .@i = 0; .@i < $gm_online_count; .@i++ )
	message rid2name( $gm_online_aid[.@i] ), strcharinfo(0) +" has offline";
end;
}

thanks @annie. i works like charm.. butt...............

the logs also appear on player. i dont want like that. i just want all gm only can see the player who online..

I was confused by the topic title.

Do you want it to announce to GMs when another GM logs in/out?

or announce to GMs when any player logs in/out?

If you have trunk/conf/groups.conf,

	permissions: {
	receive_requests: true
}

then you can use @request to send the message to all online GMs:

-	script	a_gm_is_online	-1,{
OnPCLoginEvent:
if (getgmlevel() > 0)
	atcommand "@request "+strcharinfo(0)+" is ONLINE.";
end;
OnPCLogoutEvent:
if (getgmlevel() > 0)
	atcommand "@request "+strcharinfo(0)+" has logged out.";
end;
}

nothing happen bro. why ea ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

ROFL !!

-	script	gm_build_array_online	-1,{
OnInit:
.gm_level = 60; // set min gm level here

if ( getusers(1) ) end;
deletearray $gm_online_aid;
$gm_online_count = 0;
end;

OnPCLoginEvent:
if ( getgmlevel() < .gm_level ) end; // WAHAHAHAHHA
$gm_online_aid[ $gm_online_count ] = getcharid(3);
$gm_online_count++;
end;
OnPCLogoutEvent:
if ( getgmlevel() < .gm_level ) end; // totally forgot x.x
while ( $gm_online_aid[.@i] != getcharid(3) && .@i < $gm_online_count ) .@i++;
if ( .@i == $gm_online_count ) end; // prevent @loadnpc/@reloadscript bug becos not in the array
deletearray $gm_online_aid[.@i], 1;
$gm_online_count--;
end;
}

-	script	announce_every_player	-1,{
OnPCLoginEvent:
for ( .@i = 0; .@i < $gm_online_count; .@i++ )
	message rid2name( $gm_online_aid[.@i] ), strcharinfo(0) +" has online";
end;
OnPCLogoutEvent:
for ( .@i = 0; .@i < $gm_online_count; .@i++ )
	message rid2name( $gm_online_aid[.@i] ), strcharinfo(0) +" has offline";
end;
}

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

hahahahaha! thx annie. its currently doing very well :) topic close xD

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...