View Single Post
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 07-15-2019 , 12:56   Re: respawn all dead player
Reply With Quote #3

Quote:
Originally Posted by DiogoOnAir View Post
Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "DiogoOnAir"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdktools>
#include <cstrike>

#pragma newdecls required

public Plugin myinfo = 
{
	name = "",
	author = PLUGIN_AUTHOR,
	description = "",
	version = PLUGIN_VERSION,
	url = "https://www.steamcommunity.com/id/diogo218dv"
};

public void OnPluginStart()
{
	RegAdminCmd("sm_respawndead", Cmd_RespawnDead, ADMFLAG_CHEATS);
}

public Action Cmd_RespawnDead(int client, int args)
{
	for(int i = 1; i <= MaxClients; i++)
	{
		if(!IsPlayerAlive(i))
		{
			CS_RespawnPlayer(i);
	    }		
	}
}
You can use this one, the command to respawn all dead players is sm_respawndead
That's gonna error out as soon as it reaches an invalid client index.

Quote:
Originally Posted by Alexunder View Post
hi guys ,
i wanna respawn all dead player , i have admin advanced
in the game : !respawn @dead , is work
but servercommend is not work :
ServerCommand("sm_respawn @dead");

what to do ?
Check error logs, could be that running command from console is creating errors, or try another respawn plugin: https://forums.alliedmods.net/showthread.php?t=108708 and https://forums.alliedmods.net/showpo...&postcount=288 for l4d/l4d2
CliptonHeist is offline