mrlongshen Posted January 10, 2013 Posted January 10, 2013 (edited) based on the topic, i want to request a log on chat box on all gm. all gm will know who online.. can? Edited January 11, 2013 by mrlongshen Quote
Brian Posted January 11, 2013 Posted January 11, 2013 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; } Quote
mrlongshen Posted January 11, 2013 Author Posted January 11, 2013 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 ? Quote
AnnieRuru Posted January 11, 2013 Posted January 11, 2013 @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; } Quote
mrlongshen Posted January 11, 2013 Author Posted January 11, 2013 @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 ? Quote
AnnieRuru Posted January 11, 2013 Posted January 11, 2013 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; } 2 Quote
mrlongshen Posted January 11, 2013 Author Posted January 11, 2013 hahahahaha! thx annie. its currently doing very well topic close xD Quote
Question
mrlongshen
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 mrlongshen6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.