Raised This Month: $51 Target: $400
 12% 

Solved How to hook trigger_ activating


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
farawayf
Senior Member
Join Date: Jan 2019
Old 03-01-2019 , 04:55   How to hook trigger_ activating
Reply With Quote #1

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[], callerattackerFloat:delay)
{
    
char lvl[64];

    
GetEntPropString(callerProp_Data"m_iName"lvlsizeof(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 

Last edited by farawayf; 03-01-2019 at 09:36.
farawayf is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode