Playing from spectator

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Playing from spectator

Мнение от lantimilan » 13 Мар 2018, 22:37

Bro im not using because i have PUBLIC server not deathmatch when i change mp_forcerespawn 1 in game.cfg all players can respawn and in clasic server not need

Аватар
TheRedShoko
Извън линия
Модератор
Модератор
Мнения: 1016
Регистриран на: 06 Окт 2016, 07:42
Местоположение: Бургас
Се отблагодари: 5 пъти
Получена благодарност: 84 пъти

Playing from spectator

Мнение от TheRedShoko » 13 Мар 2018, 22:45

Then provide us the information I've asked for.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Playing from spectator

Мнение от OciXCrom » 14 Мар 2018, 00:23

Solution #1 - prevent spectators from spawning:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init()
{
	register_plugin("No Spectator Respawn", "1.0", "OciXCrom")
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
}

public OnPlayerSpawn(id)
{
	if(!is_user_alive(id))
		return
		
	switch(cs_get_user_team(id))
	{
		case CS_TEAM_CT, CS_TEAM_T: return
		default: user_silentkill(id)
	}
}
Solution #2 - prevent spectators from doing damage to players:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init()
{
	register_plugin("No Spectator Damage", "1.0", "OciXCrom")
	RegisterHam(Ham_TraceAttack, "player", "PrePlayerAttack")
}

public PrePlayerAttack(iVictim, iAttacker)
{
	switch(cs_get_user_team(iAttacker))
	{
		case CS_TEAM_CT, CS_TEAM_T: return HAM_IGNORED
		default: return HAM_SUPERCEDE
	}
	
	return HAM_IGNORED
}
Solution #3 - instantly kill a spectator if they attack a player + block the attack.

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init()
{
	register_plugin("Kill Spectator On Damage", "1.0", "OciXCrom")
	RegisterHam(Ham_TraceAttack, "player", "PrePlayerAttack")
}

public PrePlayerAttack(iVictim, iAttacker)
{
	switch(cs_get_user_team(iAttacker))
	{
		case CS_TEAM_CT, CS_TEAM_T: return HAM_IGNORED
		default:
		{
			if(is_user_alive(iAttacker))
				user_silentkill(iAttacker)
				
			return HAM_SUPERCEDE
		}
	}
	
	return HAM_IGNORED
}

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Playing from spectator

Мнение от lantimilan » 14 Мар 2018, 16:32

OciXCrom™ написа: 14 Мар 2018, 00:23 Solution #1 - prevent spectators from spawning:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init()
{
	register_plugin("No Spectator Damage", "1.0", "OciXCrom")
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
}

public OnPlayerSpawn(id)
{
	if(!is_user_alive(id))
		return
		
	switch(cs_get_user_team(id))
	{
		case CS_TEAM_CT, CS_TEAM_T: return
		default: user_silentkill(id)
	}
}
Solution #2 - prevent spectators from doing damage to players:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init()
{
	register_plugin("No Spectator Respawn", "1.0", "OciXCrom")
	RegisterHam(Ham_TraceAttack, "player", "PrePlayerAttack")
}

public PrePlayerAttack(iVictim, iAttacker)
{
	switch(cs_get_user_team(iAttacker))
	{
		case CS_TEAM_CT, CS_TEAM_T: return HAM_IGNORED
		default: return HAM_SUPERCEDE
	}
	
	return HAM_IGNORED
}
Solution #3 - instantly kill a spectator if they attack a player + block the attack.

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init()
{
	register_plugin("Kill Spectator On Damage", "1.0", "OciXCrom")
	RegisterHam(Ham_TraceAttack, "player", "PrePlayerAttack")
}

public PrePlayerAttack(iVictim, iAttacker)
{
	switch(cs_get_user_team(iAttacker))
	{
		case CS_TEAM_CT, CS_TEAM_T: return HAM_IGNORED
		default:
		{
			if(is_user_alive(iAttacker))
				user_silentkill(iAttacker)
				
			return HAM_SUPERCEDE
		}
	}
	
	return HAM_IGNORED
}
I use plugin two but i dont know why crash my server:

----------------------------------------------
CRASH: Wed 14 Mar 11:16:51 CET 2018
Start Line: ./hlds_linux -game cstrike +ip 178.32.196.240 +port 27022 +maxplayers 32 +sys_ticrate 1000 +fps_max 500 +map de_dust2 +mapchangefile server.cfg -pingboost 2
----------------------------------------------
CRASH: Wed 14 Mar 12:16:42 CET 2018
Start Line: ./hlds_linux -game cstrike +ip 178.32.196.240 +port 27022 +maxplayers 32 +sys_ticrate 1000 +fps_max 500 +map de_dust2 +mapchangefile server.cfg -pingboost 2

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Playing from spectator

Мнение от OciXCrom » 14 Мар 2018, 21:47

I don't see a reason why that would happen. Just tested both on HLDS and ReHLDS and it works fine.

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Playing from spectator

Мнение от lantimilan » 15 Мар 2018, 09:45

Thanks now its okey plugin is active for 10 hours and server working thanks for plugin

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Playing from spectator

Мнение от lantimilan » 18 Мар 2018, 09:08

Fixed close topic ;)

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Bing [Bot] и 8 госта