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

Brushes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lostprophetpunk
Member
Join Date: Oct 2012
Old 09-25-2014 , 04:03   Brushes
Reply With Quote #1

Heya there,

I have already looked through https://forums.alliedmods.net/showthread.php?t=129597

However I am still at a loss as to how to do this for TF2.
lostprophetpunk is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-25-2014 , 12:06   Re: Brushes
Reply With Quote #2

What kind of brush are you trying to create?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
lostprophetpunk
Member
Join Date: Oct 2012
Old 10-06-2014 , 06:29   Re: Brushes
Reply With Quote #3

A trigger multiple.

I know that it would have different keyvalues.
lostprophetpunk is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 10-06-2014 , 09:44   Re: Brushes
Reply With Quote #4

Here is code to create a trigger_multiple

PHP Code:
new entity CreateEntityByName("trigger_multiple");
    
    if(
entity != -1)
    {
        
DispatchKeyValue(entity"spawnflags""4097");
        
        
DispatchSpawn(entity);
        
ActivateEntity(entity);
        
        new 
Float:fPos[3];
        
GetZonePosition(ZoneZoneNumberfPos);
        
TeleportEntity(entityfPosNULL_VECTORNULL_VECTOR); // Teleport trigger_multiple to desired location
        
        
SetEntityModel(entity"models/props/cs_office/vending_machine.mdl");
        
        new 
Float:fBounds[2][3];
        
GetMinMaxBounds(ZoneZoneNumberfBounds);
        
SetEntPropVector(entityProp_Send"m_vecMins"fBounds[0]); // Set the size of the trigger
        
SetEntPropVector(entityProp_Send"m_vecMaxs"fBounds[1]);
        
        
SetEntProp(entityProp_Send"m_nSolidType"2);
        
SetEntProp(entityProp_Send"m_fEffects"GetEntProp(entityProp_Send"m_fEffects") | 32);
        
        
SDKHook(entitySDKHook_StartTouchHook_StartTouch);
        
SDKHook(entitySDKHook_EndTouchHook_EndTouch);
        
SDKHook(entitySDKHook_TouchHook_Touch);
    } 
Some of the code inside is unrelated but yea other than this you have to precache the model "models/props/cs_office/vending_machine.mdl"

Last edited by blaacky; 10-06-2014 at 09:47.
blaacky is offline
lostprophetpunk
Member
Join Date: Oct 2012
Old 12-20-2014 , 10:39   Re: Brushes
Reply With Quote #5

However what values would I need for the m_vecMins and m_vecMax, as I guess the origin would be the center of where is spawns for the teleportentity();
lostprophetpunk is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 12-20-2014 , 17:24   Re: Brushes
Reply With Quote #6

Mins and max is how far fro the origin to make the bounds in either direction.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
lostprophetpunk
Member
Join Date: Oct 2012
Old 12-21-2014 , 01:22   Re: Brushes
Reply With Quote #7

This is my code so far. It doesn't seem to spawn yet I've got all the values set etc. It also compiles just fine.
PHP Code:
#define Duck "models/workshop/player/items/pyro/eotl_ducky/eotl_bonus_duck.mdl"

#include <sourcemod>
#include <tf2>
#include <sdktools>
#include <sdkhooks>
#include <morecolors>
#include <halflife>

public Plugin:myinfo =
{
    
name "Spawn Manager",
    
description "",
    
author "Matt",
    
version "1.0",
    
url "http://www.sourcemod.net/"
};

public 
OnMapStart()
{

PrecacheModel(Duck);

new 
entity CreateEntityByName("trigger_hurt");
    
    if(
entity != -1)
    {
        
DispatchKeyValue(entity"spawnflags""1");
        
DispatchKeyValue(entity"damage""99999");
        
DispatchKeyValue(entity"damagecap""99999");
        
DispatchKeyValue(entity"damagetype""0");
        
        
DispatchSpawn(entity);
        
ActivateEntity(entity);
        
        new 
Float:origin[3]
        
origin[0] = 343.0
        origin
[1] = -182.0
        origin
[2] = 65.0
        TeleportEntity
(entityoriginNULL_VECTORNULL_VECTOR); // Teleport trigger_multiple to desired location
        
        
SetEntityModel(entityDuck);
        
        new 
Float:minbounds[3] = {-100.0, -100.00.0};
        new 
Float:maxbounds[3] = {100.0100.0200.0};
        
SetEntPropVector(entityProp_Send"m_vecMins"minbounds); // Set the size of the trigger
        
SetEntPropVector(entityProp_Send"m_vecMaxs"maxbounds);
        
        
//SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
       // SetEntProp(entity, Prop_Send, "m_fEffects", GetEntProp(entity, Prop_Send, "m_fEffects") | 32);
        
        
SetEntProp(entityProp_Send"m_nSolidType"2);

        new 
enteffects GetEntProp(entityProp_Send"m_fEffects");
        
enteffects |= 32;
        
SetEntProp(entityProp_Send"m_fEffects"enteffects); 
        
        
//SDKHook(entity, SDKHook_StartTouch, Hook_StartTouch);
        //SDKHook(entity, SDKHook_EndTouch, Hook_EndTouch);
       // SDKHook(entity, SDKHook_Touch, Hook_Touch);
    
}


Last edited by lostprophetpunk; 12-21-2014 at 01:23.
lostprophetpunk is offline
lostprophetpunk
Member
Join Date: Oct 2012
Old 12-21-2014 , 16:21   Re: Brushes
Reply With Quote #8

Anyone?
lostprophetpunk is offline
Static2601
Senior Member
Join Date: Jun 2010
Old 12-28-2014 , 23:12   Re: Brushes
Reply With Quote #9

Id have to say that your precaching of your duck dont look right, it should be PrecacheModel("models/workshop/player/items/pyro/eotl_ducky/eotl_bonus_duck.mdl", true);
but it may work just like you have it. I have a few plugins ive done that do this, ill post them if I can find them.
Static2601 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 12-29-2014 , 02:07   Re: Brushes
Reply With Quote #10

The define does the same thing, it's must not being preloaded with the true boolean
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 02:02.


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