Raised This Month: $51 Target: $400
 12% 

Auto Restart Round [Different]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 02-22-2023 , 13:38   Auto Restart Round [Different]
Reply With Quote #1

Hello, for a long time I have been going through a problem in ZP 5.0 that the game mode does not start if 2 players are on the same team. I need a plugin that detects when it has 2 players on the server (on the same team or not) and performs a sv_restart 1 for autobalance separates them.

I really need this...
MeliMeli is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 02-23-2023 , 10:39   Re: Auto Restart Round [Different]
Reply With Quote #2

Try this:

PHP Code:
#include <amxmodx>

new bool:g_RoundRestarted

public plugin_init() {
    
register_plugin("Auto Round Restart""0.0.1""JustGo")

    
g_RoundRestarted false
}

public 
client_putinserver(id) {
    if(
GetPlayersCount() == && !g_RoundRestarted) {
        
set_cvar_num("sv_restart"1);
        
g_RoundRestarted true
    
}
}

stock GetPlayersCount(){
    new 
iCount 0;
    for(new 
player 1player <= MaxClientsplayer++) {
        if(!
is_user_connected(player)) continue

        
iCount++;
    }

    return 
iCount;

__________________

Last edited by JusTGo; 02-23-2023 at 10:42.
JusTGo is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode