Jump to content
  • 0
Sign in to follow this  
iCORE

[Request] Online Player on Map

Question

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

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

This script is soooo off.

use getmapusers, and why are you using login and logout events?

Share this post


Link to post
Share on other sites
  • 0

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;}

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

 

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.

 

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

 

prontera,154,108,0	script	Online Players	2_BULLETIN_BOARD,{	end;	OnInit:		while( sleep( 1000 ) ) {			delwaitingroom;			waitingroom getusers( 8 ) + " players in Prontera", 0;		}	end;}

Share this post


Link to post
Share on other sites
  • 0
-	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

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.