Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
evandrocoan opened this issue Jun 18, 2017 · 1 comment
Open

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

evandrocoan opened this issue Jun 18, 2017 · 1 comment

Comments

@evandrocoan
Copy link
Owner

evandrocoan commented Jun 18, 2017

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
Copy link
Contributor

Hi any news ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants