Raised This Month: $93 Target: $400
 23% 

[Tutorial] Creating brush entities


Post New Thread Reply   
 
Thread Tools Display Modes
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 06-21-2010 , 07:08   Re: [Tutorial] Creating brush entities
Reply With Quote #11

this section is for source pawn related tutorials and snippets, you're better off asking in the metamod:source section.
blodia is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 06-22-2010 , 11:39   Re: [Tutorial] Creating brush entities
Reply With Quote #12

Could one spawn working ladders?
AtomicStryker is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 06-22-2010 , 13:05   Re: [Tutorial] Creating brush entities
Reply With Quote #13

i haven't tried but i don't think you can, in the wiki it mentions "This is an internal entity. When the map is compiled by VBSP it is processed and then removed: it does not exist when the map is running." its the same with some other entities.
blodia is offline
almcaeobtac
Senior Member
Join Date: Nov 2008
Location: Florida
Old 06-22-2010 , 15:29   Re: [Tutorial] Creating brush entities
Reply With Quote #14

Great work, this will be extremely useful!
__________________
almcaeobtac is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-30-2010 , 19:31   Re: [Tutorial] Creating brush entities
Reply With Quote #15

This tutorial helped me allot. Thank you blodia !
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 07-01-2010 , 08:36   Re: [Tutorial] Creating brush entities
Reply With Quote #16

Wow! You've done an impossible thing. Nice!
Chrisber is offline
flud
Senior Member
Join Date: Jun 2009
Location: Latvija
Old 07-05-2010 , 06:31   Re: [Tutorial] Creating brush entities
Reply With Quote #17

anyone try trigger_teleport ?

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION    "2.0"

new String:model[PLATFORM_MAX_PATH] = "models/props_mall/mall_shopliftscanner.mdl";

public 
Plugin:myinfo = {
    
name "test",
    
author "FluD",
    
description "test device",
    
version PLUGIN_VERSION,
    
url "www.alliedmods.net"
}

public 
OnPluginStart(){

    
RegConsoleCmd("sm_test"cmd_test"");
}

public 
Action:cmd_test(client,args){

    new 
index CreateEntityByName("prop_dynamic");
    if (
index != -1){
        new 
Float:position[3];
        
GetCollisionPoint(clientposition);

        if (!
IsModelPrecached(model))
        {
            
PrecacheModel(model);
        }
        
DispatchKeyValue(index"model"model);
        
DispatchKeyValue(index"classname""prop_dynamic");
        
DispatchKeyValue(index"disableselfshadowing""1");
        
DispatchKeyValue(index"disablevertexlighting""1");
        
DispatchKeyValue(index"fademindist""-1");
        
DispatchKeyValue(index"fadescale""1");
        
DispatchKeyValue(index"renderamt""255");
        
DispatchKeyValue(index"rendercolor""255 0 0");
        
DispatchKeyValue(index"skin""0");
        
DispatchKeyValue(index"solid""0");
        
DispatchKeyValueVector(index"Origin"position);
        
DispatchSpawn(index);
    }

    new 
trigger CreateEntityByName("trigger_teleport");
    if (
trigger != -1){
        new 
Float:position[3];
        
GetCollisionPoint(clientposition);

        
DispatchKeyValueVector(trigger"origin"position );
        
DispatchKeyValue(trigger"classname""trigger_teleport");
        
DispatchKeyValue(trigger"spawnflags""15");
        
DispatchKeyValue(trigger"StartDisabled""0");
        
DispatchKeyValue(trigger"target""t_out");
        
DispatchSpawn(trigger);
        
ActivateEntity(trigger);
        
SetEntityModel(triggermodel);

        new 
Float:minbounds[3];
        
minbounds[0] = -100.0;
        
minbounds[1] = -100.0;
        
minbounds[2] = 0.0;

        new 
Float:maxbounds[3];
        
minbounds[0] = 100.0;
        
minbounds[1] = 100.0;
        
minbounds[2] = 200.0;

        
SetEntPropVector(triggerProp_Send"m_vecMins"minbounds);
        
SetEntPropVector(triggerProp_Send"m_vecMaxs"maxbounds);
        
        
SetEntProp(triggerProp_Send"m_nSolidType"2);

        new 
enteffects GetEntProp(triggerProp_Send"m_fEffects");
        
enteffects |= 32;
        
SetEntProp(triggerProp_Send"m_fEffects"enteffects);
    }

    new 
destination CreateEntityByName("info_teleport_destination");
    if (
destination != -1){
        new 
Float:position[3];
        
GetCollisionPoint(clientposition);
        
position[0] = (position[0] + 200);

        
DispatchKeyValueVector(destination"origin"position);
        
DispatchKeyValue(destination"angles""0 0 0");
        
DispatchKeyValue(destination"spawnflags""15");
        
DispatchKeyValue(destination"targetname""t_out");
        
DispatchKeyValue(destination"classname""info_teleport_destination");
        
DispatchSpawn(destination);
    }
    return 
Plugin_Continue;
}

stock GetCollisionPoint(clientFloat:pos[3]){

    
decl Float:vOrigin[3], Float:vAngles[3];

    
GetClientEyePosition(clientvOrigin);
    
GetClientEyeAngles(clientvAngles);

    new 
Handle:trace TR_TraceRayFilterEx(vOriginvAnglesMASK_SOLIDRayType_InfiniteTraceEntityFilterPlayer);

    if(
TR_DidHit(trace))
    {
        
TR_GetEndPosition(postrace);
        
CloseHandle(trace);

        return;
    }
    
CloseHandle(trace);
}

public 
bool:TraceEntityFilterPlayer(entitycontentsMask){
    return 
entity GetMaxClients() || !entity;

does not work I will be glad if someone can help
__________________
Beware of a terrible language
flud is offline
Send a message via Skype™ to flud
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 07-05-2010 , 07:02   Re: [Tutorial] Creating brush entities
Reply With Quote #18

i would try and test/fix it for you but unfortunately since the css update i haven't been able to get the steam srcds or the standalone working so i can't do anything until its fixed.

do you get any errors? have you tried TeleportEntity instead of setting the origin and angles keyvalue. you also don't need to set the classname keyvalue. although it shouldn't matter try creating the info_teleport_destination before the trigger_teleport
blodia is offline
flud
Senior Member
Join Date: Jun 2009
Location: Latvija
Old 07-05-2010 , 11:04   Re: [Tutorial] Creating brush entities
Reply With Quote #19

my bad it's work

PHP Code:
        new Float:minbounds[3]; 
        
minbounds[0] = -100.0
        
minbounds[1] = -100.0
        
minbounds[2] = 0.0

        new 
Float:maxbounds[3]; 
        
minbounds[0] = 100.0
        
minbounds[1] = 100.0
        
minbounds[2] = 200.0
change to
PHP Code:
        new Float:minbounds[3] = {-100.0, -100.00.0}; 
        new 
Float:maxbounds[3] = {100.0100.0200.0}; 
__________________
Beware of a terrible language
flud is offline
Send a message via Skype™ to flud
flud
Senior Member
Join Date: Jun 2009
Location: Latvija
Old 07-06-2010 , 02:50   Re: [Tutorial] Creating brush entities
Reply With Quote #20

Quote:
Originally Posted by blodia View Post
you can addoutputs to the entities and hook the output so you can call a function whenever the output is fired. e.g you could have a trigger_once/trigger_multiple thats fires a blank output that is hooked, this will allow you to run code on whoever triggered the output.
Snippets? how to

i try but nothing
PHP Code:
public OnPluginStart(){
HookEntityOutput("trigger_teleport""OnTouching"Entity_OnPlayerTouch);
}

public 
Entity_OnPlayerTouch(const String:output[], calleractivatorFloat:delay){
   
PrintToChatAll("TRIGGERED");

ops again my fault, all ok, just need know entity exist then hook
__________________
Beware of a terrible language

Last edited by flud; 07-06-2010 at 17:32.
flud is offline
Send a message via Skype™ to flud
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 03:13.


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