Raised This Month: $ Target: $400
 0% 

Making a trigger_multiple solid?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Skippy
Senior Member
Join Date: Nov 2011
Old 03-16-2013 , 04:18   Making a trigger_multiple solid?
Reply With Quote #1

How can I make a trigger multiple solid? Is there a certain flag I can set for it. Right now I'm trying to accomplish with making it allow only admins past the trigger and everyone else be blocked by it. I'm hook the OnStartTouchAll and then I don't really know what to do next.
__________________
Plugins:
[Any] Aim Menu

Want a TF2 plugin? Feel free to pm me to discuss it.
Skippy is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 03-16-2013 , 07:37   Re: Making a trigger_multiple solid?
Reply With Quote #2

You might be better off using SDKHook's StartTouch hook instead.
bl4nk is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 03-16-2013 , 11:02   Re: Making a trigger_multiple solid?
Reply With Quote #3

Try this before dispatching the entity:

DispatchKeyValue(entity, "Solid", "6");
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
Skippy
Senior Member
Join Date: Nov 2011
Old 03-16-2013 , 12:12   Re: Making a trigger_multiple solid?
Reply With Quote #4

Okay I don't really know how to set that up. I've never really messed with hammer triggers. Also this trigger is already built into the map with the name of "admin_hallway".
__________________
Plugins:
[Any] Aim Menu

Want a TF2 plugin? Feel free to pm me to discuss it.
Skippy is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 03-16-2013 , 12:30   Re: Making a trigger_multiple solid?
Reply With Quote #5

Hook OnStartTouch for the trigger_multiple. Save everyone's positions every second, and if OnStartTouch is activated by a non-admin, move them back to their previous saved position.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
Skippy
Senior Member
Join Date: Nov 2011
Old 03-16-2013 , 13:33   Re: Making a trigger_multiple solid?
Reply With Quote #6

I came up with this coding. I don't know if the OnGameFrame is the correct way to save the clients positions.

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

new Float:g_flSavedPos[MAXPLAYERS+1][3];

public 
OnPluginStart()
{
    
HookEntityOutput("trigger_multiple""OnStartTouch"StartTouchTrigger);
}

public 
StartTouchTrigger(const String:name[], calleractivatorFloat:delay)
{
    
decl String:TriggerName[32];
    
GetEntPropString(callerProp_Data"m_iName"TriggerNamesizeof(TriggerName));
            
    if(
StrContains(TriggerName"boxing_melee") != -1
    {
        if(
GetUserAdmin(activator) == INVALID_ADMIN_ID)
        {
            
TeleportEntity(activatorg_flSavedPos[activator], NULL_VECTORNULL_VECTOR);
        }
        
PrintToChat(activator"Touched");    
    }
}

public 
OnGameFrame()
{
    for (new 
1<= MaxClientsi++) 
    {
        if (
IsClientInGame(i))  
        {
            if(
GetUserAdmin(i) == INVALID_ADMIN_ID)
            {
                
GetClientAbsOrigin(ig_flSavedPos[i]);
            }    
        }
    }

__________________
Plugins:
[Any] Aim Menu

Want a TF2 plugin? Feel free to pm me to discuss it.
Skippy is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 03-16-2013 , 14:00   Re: Making a trigger_multiple solid?
Reply With Quote #7

Yeah, just like that! Although OnGameFrame is probably too often; also, having it more often might increase the chances of a position inside of the brush being saved, and then you'd probably get a server hang. That might never happen, but...I'm not sure.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

Last edited by MasterOfTheXP; 03-16-2013 at 14:00.
MasterOfTheXP is offline
Skippy
Senior Member
Join Date: Nov 2011
Old 03-16-2013 , 14:11   Re: Making a trigger_multiple solid?
Reply With Quote #8

Well I tested it and I'm not being teleported out. I'm just getting the message that I touched it.

Edit: It might be saving my position when I touch it so how can I detect if the player is not touching the brush to save their position?
__________________
Plugins:
[Any] Aim Menu

Want a TF2 plugin? Feel free to pm me to discuss it.

Last edited by Skippy; 03-16-2013 at 14:16. Reason: Detect when not touching the brush.
Skippy is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 03-16-2013 , 15:14   Re: Making a trigger_multiple solid?
Reply With Quote #9

Teleporting all entities (activators) may not have been what you wanted either. Remember you'll need to filter the entities if you want HHH, rockets, arrows etc. to remain unaffected.

As for the problem, try updating the position less frequently, as Master suggested. Use a global timer that saves everyone's position every second.
__________________
11530 is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 03-16-2013 , 15:18   Re: Making a trigger_multiple solid?
Reply With Quote #10

Quote:
Originally Posted by Skippy View Post
Well I tested it and I'm not being teleported out. I'm just getting the message that I touched it.

Edit: It might be saving my position when I touch it so how can I detect if the player is not touching the brush to save their position?
Make a global bool, in your onstarttouch callback make it true,
make another callback for trigger multiple but for onendtouch or something (dont have the exact name as I am at work)

Make the bool false in the endtouch callback.
You might need SDKHook for that callback not sure

Like Master of the xp said you are saving you're coordinates way to much, you should do it each second not each gameframe or you will teleport to the position you where 0.1 secs orso ago
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 03-16-2013 at 15:23.
striker07 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 01:22.


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