Announce when get x players in a map

Yoh Asakura

New member
Messages
261
Points
0
Emulator
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.

 
Something like this?

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

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

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

error2.jpg

 
- 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

 
Back
Top