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

[SOLVED] [CS:GO] m_target not working?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vaggelis
Senior Member
Join Date: May 2017
Old 05-22-2017 , 11:47   [SOLVED] [CS:GO] m_target not working?
Reply With Quote #1

Hi, after searching for my cells plugin ways to make it better, i tried to get target's name via m_target
but it's not working, it prints nothing.
PHP Code:
public Action:CmdTest(clientargs)
{
    new 
ent
    
    
while((ent FindEntityByClassname(ent"func_button")) != -1)
    {
        new 
String:butt_target[32];
        
GetEntPropString(entProp_Data"m_target"butt_targetsizeof(butt_target))
        
PrintToConsole(client"[%s]"butt_target)
    }


Last edited by Vaggelis; 05-22-2017 at 19:10. Reason: title change
Vaggelis is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-22-2017 , 18:15   Re: [CSGO] m_target not working?
Reply With Quote #2

Whrn using hammer. You use inputs and outputs to trigger stuff.

Unfortunately a button doesn't have a netprop that say points to a door.
__________________
Neuro Toxin is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 05-22-2017 , 18:38   Re: [CSGO] m_target not working?
Reply With Quote #3

Vaggelis is offline
Agent Wesker
Senior Member
Join Date: Apr 2012
Old 05-24-2017 , 10:55   Re: [SOLVED] [CS:GO] m_target not working?
Reply With Quote #4

You can hook func_button using https://sm.alliedmods.net/new-api/sd...okEntityOutput

Then when the function is called, parse the entity names and check if they are func_doors.

function void(const char[] output, int caller, int activator, float delay)

output = string you need to parse from
caller = button
activator = client

Last edited by Agent Wesker; 05-24-2017 at 10:58.
Agent Wesker is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 05-26-2017 , 12:56   Re: [SOLVED] [CS:GO] m_target not working?
Reply With Quote #5

Quote:
Originally Posted by Agent Wesker View Post
You can hook func_button using https://sm.alliedmods.net/new-api/sd...okEntityOutput

Then when the function is called, parse the entity names and check if they are func_doors.

function void(const char[] output, int caller, int activator, float delay)

output = string you need to parse from
caller = button
activator = client
Not working
Vaggelis is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 05-26-2017 , 16:00   Re: [SOLVED] [CS:GO] m_target not working?
Reply With Quote #6

Quote:
Originally Posted by Vaggelis View Post
Not working
Of course it's not going to work without any code..
Mitchell is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 05-26-2017 , 17:40   Re: [SOLVED] [CS:GO] m_target not working?
Reply With Quote #7

Quote:
Originally Posted by Mitchell View Post
Of course it's not going to work without any code..
for me, output returns OnPressed, can u show how would u do that?
Vaggelis is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-26-2017 , 19:19   Re: [SOLVED] [CS:GO] m_target not working?
Reply With Quote #8

OP wants the entity the button triggers via outputs.

This is not possible via stock Sourcemod.
__________________
Neuro Toxin is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 05-26-2017 , 20:30   Re: [SOLVED] [CS:GO] m_target not working?
Reply With Quote #9

Quote:
Originally Posted by Neuro Toxin View Post
OP wants the entity the button triggers via outputs.

This is not possible via stock Sourcemod.
Well what is 'output' set to? Couldn't you figure out the entity targetname through that and find all entities with that name?
Mitchell is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-26-2017 , 21:31   Re: [SOLVED] [CS:GO] m_target not working?
Reply With Quote #10

With an extension you can read input/output data.

I don't think a standard plugin can read this data.
__________________
Neuro Toxin 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 17:27.


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