Raised This Month: $ Target: $400
 0% 

How to activate func_button


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
farawayf
Senior Member
Join Date: Jan 2019
Old 01-19-2019 , 11:40   How to activate func_button
Reply With Quote #1

Hello.

How i can activate func_button "target name" with command ? I find that code but it crash server when i type command
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
      
RegAdminCmd"sm_activatebutton"CmdbuttonADMFLAG_ROOT);
}

public 
Action:Cmdbuttonclientargs )
{
    
decl String:TargetName[128];
    new 
CurEnt FindEntityByClassname(-1"func_button");
    while (
CurEnt >= 0
    {
        
GetEntPropString(CurEntProp_Data"m_iName"TargetName128);
        if (
StrEqual(TargetName"button_name")) 
        {
            
LogMessage("%d : %s"CurEntTargetName);
            
ActivateEntity(CurEnt);
        }
        
CurEnt FindEntityByClassname(CurEnt"func_button");
    }


Last edited by farawayf; 01-19-2019 at 11:41.
farawayf is offline
 



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 18:44.


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