AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Auto Restart Round [Different] (https://forums.alliedmods.net/showthread.php?t=341924)

MeliMeli 02-22-2023 13:38

Auto Restart Round [Different]
 
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...

JusTGo 02-23-2023 10:39

Re: Auto Restart Round [Different]
 
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;




All times are GMT -4. The time now is 21:39.

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