КТ вышел, раунд кончился.

trial

Участник
Сообщения
51
Реакции
11
Ребят, как сделать, чтобы когда КТ вышел с сервера (либо кикнули), раунд автоматически заканчивался? КТ только один в раунде всегда.
 

Primo

типа серьёзный тип
Сообщения
1,532
Реакции
759
PHP:
public OnClientDisconnect(client)
{
	if(GetClientTeam(client) == 3)
	{
		// 3 - Time (in seconds) to delay before new round starts
		// reason - Reason for the round ending
		// false - (blockhook)Set to true to stop the corresponding CS_OnTerminateRound forward from being called.
		CS_TermianteRound(3, reason, false);
	}
}

мб так? Я не знаю, будет ли CS_TermianteRound работать
 

trial

Участник
Сообщения
51
Реакции
11
PHP:
#include <sourcemod>
#include <cstrike>
#include <sdktools>

public OnPluginStart()
{
		HookEvent("player_disconnect", event_PlayerDisconnect, EventHookMode_Pre);
}

public OnClientDisconnect(client) 
{ 
		if(GetClientTeam(client) == 3) 
		{ 
			// 3 - Time (in seconds) to delay before new round starts 
			// reason - Reason for the round ending 
			// false - (blockhook)Set to true to stop the corresponding CS_OnTerminateRound forward from being called. 
			CS_TermianteRound(1, 15, false); 
		} 
}

Так? Не компилируется.
 

Primo

типа серьёзный тип
Сообщения
1,532
Реакции
759
PHP:
#include <sourcemod>
#include <cstrike>
#include <sdktools>

public OnPluginStart()
{
    HookEvent("player_disconnect", OnClientDisconnect);
}

public OnClientDisconnect(Handle:event, const String:name[], bool:dontBroadcast) 
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    if(GetClientTeam(client) == 3) 
    { 
        // 3 - Time (in seconds) to delay before new round starts 
        // reason - Reason for the round ending 
        // false - (blockhook)Set to true to stop the corresponding CS_OnTerminateRound forward from being called. 
        CS_TermianteRound(1, 15, false); 
    } 
}

И какая ошибка то?
 

trial

Участник
Сообщения
51
Реакции
11
jpZftqR.png
 
Сообщения
2,587
Реакции
1,344
trial, правой кнопкой сверху консоли - свойства - поставить галочку - выделения мышью... И убирай из пути русские буквы, пригодится...
 

Primo

типа серьёзный тип
Сообщения
1,532
Реакции
759
PHP:
#include <sourcemod>
#include <cstrike>
#include <sdktools>

public OnPluginStart()
{
    HookEvent("player_disconnect", PlayerDisconnect);
}

public PlayerDisconnect(Handle:event, const String:name[], bool:dontBroadcast) 
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    if(GetClientTeam(client) == 3) 
    { 
        // 3 - Time (in seconds) to delay before new round starts 
        // reason - Reason for the round ending 
        // false - (blockhook)Set to true to stop the corresponding CS_OnTerminateRound forward from being called. 
        CS_TerminateRound(1.0, CSRoundEnd_Draw, false); 
    } 
}
 

trial

Участник
Сообщения
51
Реакции
11
Primo --> премного благодарен, работает =)
 
Сверху Снизу