Raised This Month: $52 Target: $400
 13% 

[CS:GO] Manipulate "map triggers?"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sw33T3R
Senior Member
Join Date: Mar 2014
Location: N/A
Old 10-10-2017 , 12:12   [CS:GO] Manipulate "map triggers?"
Reply With Quote #1

Hello!
How can i manipulate map "triggers"? (For example i want to open a specific door (ent_fire door1 open) or destroy a something (ent_fire 1 break))
I tried doing it by
Code:
ServerCommand("ent_fire 1 break");
but this is doesn't working :/

Does anyone know how to do it and can help me ?
Sw33T3R is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-10-2017 , 15:04   Re: [CS:GO] Manipulate "map triggers?"
Reply With Quote #2

ok... If you start by playing a map with sv_cheats 1 (against bots)

Use command: find_ent <classname>
- you need give a letter or else entity classname to get list of entities from map.
Example find_ent _ or find_ent door
cs_office


I found func_door.
You can get some info how func_door works.
With command: ent_info <classname>
example ent_info func_door
Spoiler


We can either Open or Kill func_door.

You can test in that sv_cheats 1 mode...
ent_fire func_door Open
- I don't remember, would this open all func_doors or just one...


Here SourceMod plugin sample.
When you aim different places and use command sm_test, it print to chat some info and opens func_door if found.

PHP Code:
#include <sdktools>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_test"sm_test);
}

public 
Action sm_test(int clientint arg)
{

    if(
client == || !IsClientInGame(client))    return Plugin_Handled;

    
int entity_index GetClientAimTarget(clientfalse);

    if(
entity_index == -1)
    {
        
PrintToChat(client"[SM] No entities here...");
        return 
Plugin_Handled;
    }

    
char classname[MAX_NAME_LENGTH];
    if(!
GetEntityClassname(entity_indexclassnamesizeof(classname)))
    {
        
PrintToChat(client"[SM] No 'classname', entity %i"entity_index);
        return 
Plugin_Handled;
    }

    
char targetname[MAX_NAME_LENGTH];
    
GetEntPropString(entity_indexProp_Data"m_iName"targetnamesizeof(targetname));

    
PrintToChat(client"[SM] You found %s - %s - %i"classnametargetnameentity_index);

    if(
StrEqual(classname"func_door"false)) AcceptEntityInput(entity_index"Open");


    return 
Plugin_Handled;

__________________
Do not Private Message @me

Last edited by Bacardi; 10-10-2017 at 15:08. Reason: silly me, it's string
Bacardi is offline
Reply


Thread Tools
Display Modes

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 09:20.


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