Jump to content
  • 0

Help with waiting room code


Haze

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  11/02/13
  • Last Seen:  

I tried but with every try i dont show how many GM is online on the waiting room. its always 0 even after i relog. could anyone help me please? 

prontera,130,168,4	script	Official GM List	837,{

mes "Staffs Online Lists : ^FF0000"+getarraysize( .GM_Name$ )+"^000000 Staffs";
mes "^0000FF_____________________________^000000";
for( set .@i,0; .@i < getarraysize( .GM_Name$ ) ; set .@i,.@i + 1 ){
        getmapxy( .Map$,.x,.y,0,.GM_Name$[.@i] );
        mes "[ ^63D1F4"+.GM_Level$[.@i]+"^000000 ] ^FF0000@ ^0000FF"+.GM_Name$[.@i]+"^000000";
        mes "^0000FF_____________________________^000000";
        }
close;

OnInit:
waitingroom "Staff Online : "+getarraysize( .GM_Name$ )+"",0;
set .MinGMLevel,1;              // Min. GM Level to Show in Online Lists
end;
 
OnPCLoginEvent:
set .@gmlevel,getgmlevel();
if( .@gmlevel < .MinGMLevel ) end;
set .@size,getarraysize( .GM_Name$ );
set .GM_Name$[ .@size ],strcharinfo(0);
if( .@gmlevel < 10 ) set .GM_Level$[ .@size ],"Trial GM";
else if( .@gmlevel < 20 ) set .GM_Level$[ .@size ],"Support";
else if( .@gmlevel < 30 ) set .GM_Level$[ .@size ],"Police";
else if( .@gmlevel < 40 ) set .GM_Level$[ .@size ],"Head GM";
else set .GM_Level$[ .@size ],"ADMIN";
end;
 
OnPCLogoutEvent:
if( getgmlevel() < .MinGMLevel ) end;
for( set .@i,0; .@i < getarraysize( .GM_Name$ ) ; set .@i,.@i + 1 )
        if( strcharinfo(0) == .GM_Name$[.@i] ){
            deletearray .GM_Name$[.@i],1;
            deletearray .GM_Level$[.@i],1;
            end;
        }
end;


}
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


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

prontera,156,185,5	script	kjhdfkjshf	100,{
	end;
OnInit:
	sleep 1; // ..... for some stupid reason, when logging out needs to sleep <.<
	query_sql "select count(1) from login left join `char` on `char`.account_id = login.account_id where group_id > 0 and online = 1", .@count;
	waitingroom .@count +"", 0;
	end;
OnPCLoginEvent:
OnPCLogoutEvent:
	if ( getgmlevel() >= 1 ) {
		delwaitingroom strnpcinfo(0);
		goto OnInit;
	}
	end;
}
EDIT:

hmm ... wait, you are not using query_sql ... let's see ....

ok done

prontera,156,185,5	script	kjhdfkjshf	100,{
	end;
OnInit:
	if ( !getusers(1) ) // preserve through @reloadscript
		$gm_online_count = 0;
	waitingroom $gm_online_count +"", 0;
//	debugmes $gm_online_count +" "+ getusers(1);
	end;
OnPCLoginEvent:
	if ( getgmlevel() >= 1 ) {
		$gm_online_count++;
		delwaitingroom;
		waitingroom $gm_online_count +"", 0;
	}
	end;
OnPCLogoutEvent:
	if ( getgmlevel() >= 1 ) {
		$gm_online_count--;
		delwaitingroom;
		waitingroom $gm_online_count +"", 0;
	}
	end;
}
Edited by AnnieRuru
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  11/02/13
  • Last Seen:  

Thank you so much Annie, you've help me alot lately :D

you're so very kind <3

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...