#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

#undef REQUIRE_EXTENSIONS
#include <cstrike>
#include <tf2>
#define REQUIRE_EXTENSIONS

public Plugin:myinfo = 
{
	name = "Player Respawn",
	author = "Bara",
	description = "",
	version = "1.0",
	url = "www.bara.in"
}

public OnPluginStart()
{
	RegConsoleCmd("sm_spawn", Command_Respawn);
	RegConsoleCmd("sm_respawn", Command_Respawn);
}

public Action:Command_Respawn(client, args)
{
	if(!IsPlayerAlive(client))
	{
		if(GetEngineVersion() == Engine_CSS || GetEngineVersion() == Engine_CSGO)
		{
			CS_RespawnPlayer(client);
		}
		else if(GetEngineVersion() == Engine_TF2)
		{
			TF2_RespawnPlayer(client);
		}
	}
	else
	{
		ReplyToCommand(client, "Sie leben bereits!");
	}
}