evandrocoan / MultiModServer

It is a Multi-Mod plugin's configurations for Amx Mod X - https://forums.alliedmods.net/showthread.php?t=273018
GNU General Public License v3.0
17 stars 17 forks source link

Directly changes the map by a map predefined by a cvar #70

Open evandrocoan opened 7 years ago

evandrocoan commented 7 years ago

GoRiLliAz: Would it be possible to add: If the number of players reaches for example a number defined by a cvar it directly changes the map by a map predefined by a cvar also.

Example:

4 players on the server, map by default de_dust2, map in progress de_train 1 player leaves, the server warned that in 10 seconds he will change the map to de_dust2 right away.

I already had this functionality with another plugin that worked well especially at night. To fill a server.

https://forums.alliedmods.net/showpost.php?p=2529565&postcount=766

Arkshine had modified for me the official mapchooser plugin. It was a private plugin only for us. I give it to you

https://forums.alliedmods.net/showpost.php?p=2529650&postcount=774

The relevant code would be:

133: public client_disconnected(client) 
134: { 
135:     if (!!!CvarMinPlayersDirect || VotemapRunning || VotemapDirectRunning) 
136:     { 
137:         return; 
138:     } 
139:      
140:     new Float:currentTime = get_gametime(); 
141:      
142:     if (NextForcedVotemap < currentTime) 
143:     { 
144:         if (getTotalActivePlayers(.ignoreMe = client) <= CvarMinPlayers && !IsDeDust2 && 
                          VotemapDirectCount <= CvarMinPlayersDirectMaxCount) 
145:         { 
146:             VotemapDirectRunning = true; 
147:             VotemapDirectCount++; 
148:              
149:             displayVoteMap(MinPlayersMapsList); 
150:         } 
151:     } 
152: } 

https://gist.github.com/evandrocoan/352a0c50a7c0357c933f0989eb4bce9e#file-mapchooser-sma-L133-L144

...
306:         if (IsDeDust2) 
307:         { 
308:             client_print_color(0, print_team_red, "* Il y a moins de ^3%d^1 \
                                  joueurs sur la map^4de_dust2^4, ^3votemap est désactivé^1", 
                                  CvarMinPlayers + 1); 
309:             return; 
310:         } 

https://gist.github.com/evandrocoan/352a0c50a7c0357c933f0989eb4bce9e#file-mapchooser-sma-L306-L310

GoRiLliAz commented 7 years ago

Hi any news ?