Делаю плагин. Его суть: воскрешение всех умерших игроков ежераундно каждые 20 секунд (Раз за раунд). Компилируется без ошибок, но сервер крашится. Помогите
#include <sourcemod>
#include <cstrike>
public Plugin:myinfo = {
name = "AutoRespawn",
author = "Anubis",
version = "1.0",
description = "Respawned player after x seconds every round",
url = ""
}
public OnPluginStart()
{
LoadTranslations("anubis.autorespawn.phrases");
HookEvent("round_start", OnRoundStart);
}
public Action:OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
PrintToChatAll("\x04[\x05%t\x04]\x05 %t", "tag", "after");
CreateTimer(20.0, RespawnAll);
}
public Action:RespawnAll(Handle:timer)
{
PrintToChatAll("\x04[\x05%t\x04]\x05 %t", "tag", "respawn");
for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) || IsPlayerAlive(i))
{
CS_RespawnPlayer(i);
}
}
return Plugin_Stop;
}
#include <cstrike>
public Plugin:myinfo = {
name = "AutoRespawn",
author = "Anubis",
version = "1.0",
description = "Respawned player after x seconds every round",
url = ""
}
public OnPluginStart()
{
LoadTranslations("anubis.autorespawn.phrases");
HookEvent("round_start", OnRoundStart);
}
public Action:OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
PrintToChatAll("\x04[\x05%t\x04]\x05 %t", "tag", "after");
CreateTimer(20.0, RespawnAll);
}
public Action:RespawnAll(Handle:timer)
{
PrintToChatAll("\x04[\x05%t\x04]\x05 %t", "tag", "respawn");
for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) || IsPlayerAlive(i))
{
CS_RespawnPlayer(i);
}
}
return Plugin_Stop;
}