[Request] Online Player on Map

iCORE

New member
Messages
393
Points
0
Location
Halcyon Ragnarok
Github
Naori
Emulator
hi i would like to request a script for online players on map that refresh every 3 seconds

Prontera,154,108,0 script Sample 757,{OnPCLoginEvent:OnPCLogoutEvent:delwaitingroom;end;OnInit:waitingroom ""+getusers(1)+" players in Prontera",0;end;}
tell me whats wrong 

PS the script is not refreshing and it needs to be click to see the players online count

 
hmm can you help me?

how to refresh it like 3 sec because every time a player is on the map the number will not change

solved

Code:
prontera,154,108,0	script	Online Players	2_BULLETIN_BOARD,{end;OnInit:while( 1 ){	delwaitingroom;	waitingroom ""+getusers(1)+" players in prontera",0;	sleep 1;}end;}
 
Woah, sleep 1, for just 1 millisecond? You'll use up a lot of your processing time just for that. I guess it'd be good enough if you wait a second (1000 ticks) for that. That'll make your script a literal thousand times more resource-efficient, while not damaging performance that much since players don't care for that delay. If you want to make the delay invisible to human eye (seeming almost instantly), just change it to 100 (or 50 if you've got people with lightning-fast eye reaction time).

 
hmm can you help me?

how to refresh it like 3 sec because every time a player is on the map the number will not change

solved

prontera,154,108,0 script Online Players 2_BULLETIN_BOARD,{end;OnInit:while( 1 ){ delwaitingroom; waitingroom ""+getusers(1)+" players in prontera",0; sleep 1;}end;}
getusers with the parameter 1 counts all players on the server, not just on one map. If you really just want those on prontera you need to use parameter 8.

Code:
*getusers(<type>)This function will return a number of users on a map or the whole server. What it returns is specified by Type.Type can be one of the following values, which control what is returned:0 - Count of all characters on the map of the invoking character.1 - Count of all characters in the entire server.8 - Count of all characters on the map of the NPC the script is running in.
Code:
prontera,154,108,0	script	Online Players	2_BULLETIN_BOARD,{	end;	OnInit:		while( sleep( 1000 ) ) {			delwaitingroom;			waitingroom getusers( 8 ) + " players in Prontera", 0;		}	end;}
 
Code:
-	script	map_player_count	-1,{	end;	OnTimer3000:		delwaitingroom;		waitingroom getusers( 8 ) + " players in "+strnpcinfo(4), 0;			OnInit:		if ( strnpcinfo(4) != "" ) 			initnpctimer;		end;}prontera,155,181,4	duplicate(map_player_count)	Prontera Count	2_BULLETIN_BOARDmorocc,155,181,4	duplicate(map_player_count)	Morocc Count	2_BULLETIN_BOARDpayon,155,181,4	duplicate(map_player_count)	Payon Count	2_BULLETIN_BOARDalberta,155,181,4	duplicate(map_player_count)	Alberta Count	2_BULLETIN_BOARD
 
Last edited by a moderator:
Back
Top