I made plugin to set hostname tag which level now playing on map, but it work if someone changing lvl through adminroom(buttons room). How i can hook trigger_multiple/once to made it work ?
Map using trigger_multiple/once to set lvl ON ct win
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
public void OnPluginStart()
{
HookEntityOutput("func_button", "OnPressed", Trigger_Multiple);
HookEntityOutput("trigger_multiple", "OnTrigger", Trigger_Multiple);
HookEntityOutput("trigger_once", "OnTrigger", Trigger_Multiple);
}
public Trigger_Multiple(const String:output[], caller, attacker, Float:delay)
{
char lvl[64];
GetEntPropString(caller, Prop_Data, "m_iName", lvl, sizeof(lvl)); // Get lvl name
//buttons
if (StrEqual(lvl, "Button_Hard"))
{
ServerCommand("hostname [HARD]Example Server Name");
}
if (StrEqual(lvl, "Button_Normal"))
{
ServerCommand("hostname [NORMAL]Example Server Name");
}
if (StrEqual(lvl, "Button_Ext"))
{
ServerCommand("hostname [EXTREME]Example Server Name");
}
if (StrEqual(lvl, "Button_Ext2"))
{
ServerCommand("hostname [EXTREME2]Example Server Name");
}
//triggers
if (StrEqual(lvl, "trigger_n_d"))
{
ServerCommand("hostname [HARD]Example Server Name");
}
if (StrEqual(lvl, "trigger_n_e2"))
{
ServerCommand("hostname [EXTREME2]Example Server Name");
}
if (StrEqual(lvl, "trigger_n_m"))
{
ServerCommand("hostname [NORMAL]Example Server Name");
}
if (StrEqual(lvl, "trigger_n_e"))
{
ServerCommand("hostname [EXTREME]Example Server Name");
}
}
//[NORMAL]Example Server Name
//[HARD]Example Server Name
//[EXTREME]Example Server Name
//[EXTREME2]Example Server Name