- Поддерживаемые игры
- CS: Source (v34)
- CS: Source (OrangeBox)
- Автор
- Dr!fter
После того, как я задал вопрос на AlliedModders о том, как остановить унывающий звук ослепляющей гранаты, а оказывается один очень умный человек сделал целое расширение уже давно и выклал его. Очень полезная штука для предотвращения ослепления товарищей по команде
Проверена, только на Windows
Передовые
Пример нового плагина, предотвращения ослепления товарищей по команде:
Обновлено: 08.06.2012
Ссылка на источник
Проверена, только на Windows
Передовые
Код:
/**
* @param client Client index
* @param distance How far the flash is from the player which will effect the volume and length of the "deafen"
*
* @return Plugin_Handled or higher to block. Plugin_Changed if distance was changed. Plugin_Continue to ignore.
*
*/
forward Action:OnDeafen(client, &Float:distance);
/**
* @param entity The flashbang entity
*
* @return Plugin_Handled or higher to block. Anything else to ignore
*
*/
forward Action:OnFlashDetonate(entity);
/**
* @param client Client index
* @param entity The flashbang entity
* @param pos The position vector of the flashbang
* @param percent The percent?
*
* @return Plugin_Handled or higher to ignore player. Plugin_Changed if percent was changed. Plugin_Continue to ignore
*
*/
forward Action:OnGetPercentageOfFlashForPlayer(client, entity, Float:pos[3], &Float:percent);
Код:
#include <sourcemod>
#include <flashtools>
public Action:OnDeafen(client, &Float:time)
{
//Не оглушать никого
return Plugin_Handled;
}
public Action:OnGetPercentageOfFlashForPlayer(client, entity, Float:pos[3], &Float:percent)
{
new owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
new team = GetClientTeam(client);
new team2 = GetClientTeam(owner);
//Не ослеплять товарищей, но ослеплять того, кто кинул гранату
if(team == team2 && owner != client)
{
return Plugin_Handled;
}
return Plugin_Continue;
}
Обновлено: 08.06.2012
Ссылка на источник