Всем привет.
Данный плагин показывает кто нажимает кнопки, но не показывает кто нажимает рычаги на картах. Буду благодарен если кто нибудь сможет отредактировать его. Видел на японском сервере подобный плагин и он показывает кто нажимает рычаги в чате - это отображается как unknown button
Заранее спасибо.
Данный плагин показывает кто нажимает кнопки, но не показывает кто нажимает рычаги на картах. Буду благодарен если кто нибудь сможет отредактировать его. Видел на японском сервере подобный плагин и он показывает кто нажимает рычаги в чате - это отображается как unknown button
#include <sourcemod>
#include <sdktools>
new bool:espresionado[2048];
public Plugin:myinfo =
{
name = "Button Watcher",
author = "Franc1sco franug",
description = "Generates an output when a button is pressed",
version = "1.1",
url = "ZEUS Server | Zombie Europe Server"
};
public OnPluginStart()
{
HookEntityOutput("func_button", "OnPressed", Presionado);
CreateConVar("sm_buttonwatcher", "1.1", "", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
}
public Presionado(const String:output[], caller, activator, Float:delay)
{
if(!IsValidClient(activator)) return;
if(espresionado[caller]) return;
decl String:entity[512];
GetEntPropString(caller, Prop_Data, "m_iName", entity, sizeof(entity));
PrintToChatAll(" \x02[BW] \x0C%N \x04pressed button\x0C %i %s", activator, caller, entity);
LogMessage("[BW] %L pressed the button %i %s", activator, caller, entity)
espresionado[caller] = true;
CreateTimer(5.0, Pasado, caller);
}
public Action:Pasado(Handle:timer, any:entity)
{
espresionado[entity] = false;
}
public IsValidClient( client )
{
if ( !( 1 <= client <= MaxClients ) || !IsClientInGame(client) || !IsPlayerAlive(client) )
return false;
return true;
}
#include <sdktools>
new bool:espresionado[2048];
public Plugin:myinfo =
{
name = "Button Watcher",
author = "Franc1sco franug",
description = "Generates an output when a button is pressed",
version = "1.1",
url = "ZEUS Server | Zombie Europe Server"
};
public OnPluginStart()
{
HookEntityOutput("func_button", "OnPressed", Presionado);
CreateConVar("sm_buttonwatcher", "1.1", "", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
}
public Presionado(const String:output[], caller, activator, Float:delay)
{
if(!IsValidClient(activator)) return;
if(espresionado[caller]) return;
decl String:entity[512];
GetEntPropString(caller, Prop_Data, "m_iName", entity, sizeof(entity));
PrintToChatAll(" \x02[BW] \x0C%N \x04pressed button\x0C %i %s", activator, caller, entity);
LogMessage("[BW] %L pressed the button %i %s", activator, caller, entity)
espresionado[caller] = true;
CreateTimer(5.0, Pasado, caller);
}
public Action:Pasado(Handle:timer, any:entity)
{
espresionado[entity] = false;
}
public IsValidClient( client )
{
if ( !( 1 <= client <= MaxClients ) || !IsClientInGame(client) || !IsPlayerAlive(client) )
return false;
return true;
}
Заранее спасибо.