witam,
mam pytanie a zarazem prosbe. Czy ktos wie jak w tym zrobic automatycznego kicka gdy ktos bedzie chcial zmienic team w czasie rozgrywki?
#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION "1.0"
new Handle:g_hLocked = INVALID_HANDLE;
public OnPluginStart()
{
AddCommandListener(Command_JoinTeam, "jointeam");
g_hLocked = CreateConVar("sm_lock_teams", "1", "Enable or disable locking teams during match", FCVAR_NOTIFY);
}
public Action:Command_JoinTeam(client, const String:command[], args)
{
if (client != 0)
{
if(IsClientInGame(client) && !IsFakeClient(client))
{
if (GetClientTeam(client) > 1 && GetConVarBool(g_hLocked))
{
PrintToChat(client, "\x01 \x07You cannot change your team during a match!");
return Plugin_Stop;
}
}
}
return Plugin_Continue;
}