Raised This Month: $12 Target: $400
 3% 

respawn all dead player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alexunder
Member
Join Date: Jun 2018
Old 07-14-2019 , 17:54   respawn all dead player
Reply With Quote #1

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 ?
Alexunder is offline
DiogoOnAir
Senior Member
Join Date: Jul 2018
Location: Portugal
Old 07-15-2019 , 07:05   Re: respawn all dead player
Reply With Quote #2

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
__________________
I accept Private(Paid) plugins requests
If you like my job donate me Here
Feel free to add me on Steam
Feel free to add me on Discord DiogoOnAir | Config & Developer#7961
Check my website
If you want to buy any server, you can buy it from here!
Datacenters around the world!

Last edited by DiogoOnAir; 07-15-2019 at 07:06.
DiogoOnAir is offline
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
Alexunder
Member
Join Date: Jun 2018
Old 07-15-2019 , 16:19   Re: respawn all dead player
Reply With Quote #4

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
worked ! thankyou
Alexunder is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 07-15-2019 , 16:59   Re: respawn all dead player
Reply With Quote #5

Did I just get fucking bamboozled or something lol?
CliptonHeist is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 07-15-2019 , 17:24   Re: respawn all dead player
Reply With Quote #6

Maybe check if is client in game? check if the client is not a bot ?
__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$
Pilo is offline
Alexunder
Member
Join Date: Jun 2018
Old 07-15-2019 , 18:39   Re: respawn all dead player
Reply With Quote #7

Quote:
Originally Posted by Pilo View Post
Maybe check if is client in game? check if the client is not a bot ?
i think IsValidClient and IsClientInGame can fix , thx for reminded dude.

Last edited by Alexunder; 07-15-2019 at 18:40.
Alexunder is offline
DiogoOnAir
Senior Member
Join Date: Jul 2018
Location: Portugal
Old 07-16-2019 , 15:10   Re: respawn all dead player
Reply With Quote #8

bool IsValidClient(int client, bool bAllowBots = false, bool bAllowDead = true)
{
if(!(1 <= client <= MaxClients) || !IsClientInGame(client) || (IsFakeClient(client) && !bAllowBots) || IsClientSourceTV(client) || IsClientReplay(client) || (!bAllowDead && !IsPlayerAlive(client)))
{
return false;
}
return true;
}

Use this
__________________
I accept Private(Paid) plugins requests
If you like my job donate me Here
Feel free to add me on Steam
Feel free to add me on Discord DiogoOnAir | Config & Developer#7961
Check my website
If you want to buy any server, you can buy it from here!
Datacenters around the world!
DiogoOnAir is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:15.


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