Jump to content
  • 0
Sign in to follow this  
Yoh Asakura

Announce when get x players in a map

Question

Hi,

 

I would like an script that only announce when it has x players in a map.

 

Example:

When it has 3 players in a pvp map, such as pvp_y_2-2, the npc will announce that there are currently 3 players in that map. And if it has 6 players in that map it will announce again that has 6 players...

 

Hope anyone can help me, thanks in advance.

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Something like this?

-	script	MapAnnounce	-1,{OnPCLoadMapEvent:if( strcharinfo(PC_MAP) != "pvp_y_2-2" ) end;if( !getmapusers(strcharinfo(PC_MAP))%3 )	announce "There are " + getmapusers(strcharinfo(PC_MAP)) + " players on map " + strcharinfo(PC_MAP) + ".";end;}pvp_y_2-2	mapflag	loadevent

Share this post


Link to post
Share on other sites
  • 0

 

Something like this?

-	script	MapAnnounce	-1,{OnPCLoadMapEvent:if( strcharinfo(PC_MAP) != "pvp_y_2-2" ) end;if( !getmapusers(strcharinfo(PC_MAP))%3 )	announce "There are " + getmapusers(strcharinfo(PC_MAP)) + " players on map " + strcharinfo(PC_MAP) + ".";end;}pvp_y_2-2	mapflag	loadevent

Almost like that, the problem is that I just want it to announce when it gets 3 players, then if gets 6 players will announce too. And if it has more than 10 it will announce that the pvp is full of players.

So means that if there's 2 players it won't announce, or 4, or 7, 8, etc.

Share this post


Link to post
Share on other sites
  • 0
-    script    MapAnnounce    -1,{OnPCLoadMapEvent:	if( strcharinfo(PC_MAP) != "pvp_y_2-2" ) 		end;	set .@countUsers, getmapusers(strcharinfo(PC_MAP));	if( .@countUsers % .rangePLayersAnnounce == 0 )	{		announce "There are " + getmapusers(strcharinfo(PC_MAP)) + " players on map " + strcharinfo(PC_MAP) + ".";	}	else if (.@countUsers == .fullPlayersAnnounce)	{		announce "The map " + strcharinfo(PC_MAP) + " is full!";	}	end;OnInit:	set .rangePlayersAnnounce, 3;	set .fullPlayersAnnounce, 10;	end;}pvp_y_2-2    mapflag    loadevent

Should do the job. The '%' doesn't mean it will announce for anything over '3', but for any value which is a multiple of 3.

Share this post


Link to post
Share on other sites
  • 0

 

-    script    MapAnnounce    -1,{OnPCLoadMapEvent:	if( strcharinfo(PC_MAP) != "pvp_y_2-2" ) 		end;	set .@countUsers, getmapusers(strcharinfo(PC_MAP));	if( .@countUsers % .rangePLayersAnnounce == 0 )	{		announce "There are " + getmapusers(strcharinfo(PC_MAP)) + " players on map " + strcharinfo(PC_MAP) + ".";	}	else if (.@countUsers == .fullPlayersAnnounce)	{		announce "The map " + strcharinfo(PC_MAP) + " is full!";	}	end;OnInit:	set .rangePlayersAnnounce, 3;	set .fullPlayersAnnounce, 10;	end;}pvp_y_2-2    mapflag    loadevent

Should do the job. The '%' doesn't mean it will announce for anything over '3', but for any value which is a multiple of 3.

It's not working.

post-3532-0-92525900-1429170027_thumb.jpg

Share this post


Link to post
Share on other sites
  • 0
-	script	MapAnnounce	-1,{OnPCLoadMapEvent:	if( strcharinfo(PC_MAP) != "pvp_y_2-2" ) 		end;	set .@countUsers, getmapusers(strcharinfo(PC_MAP));	if( .@countUsers % .rangePLayersAnnounce == 0 )	{		announce "There are " + getmapusers(strcharinfo(PC_MAP)) + " players on map " + strcharinfo(PC_MAP) + ".",bc_blue|bc_all;	}	else if (.@countUsers == .fullPlayersAnnounce)	{		announce "The map " + strcharinfo(PC_MAP) + " is full!",bc_blue|bc_all;	}	end;OnInit:	set .rangePlayersAnnounce, 3;	set .fullPlayersAnnounce, 10;	end;}pvp_y_2-2	mapflag	loadevent

The announce missed the parameters and the tab weren't parsed correctly. Nevermind, there shouldn't be errors now

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.