Raised This Month: $ Target: $400
 0% 

[TF2] Teleport Exit Disappear


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
7106
Senior Member
Join Date: Jun 2013
Old 05-02-2014 , 08:49   [TF2] Teleport Exit Disappear
Reply With Quote #1

if player go to teleport entrance teleport exit disappear
7106 is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 05-02-2014 , 14:01   Re: [TF2] Teleport Exit Disappear
Reply With Quote #2

Something like this?
PHP Code:
#include <sdktools>

public OnPluginStart()
{
    
HookEvent("player_teleported"TeleporterUsedEventHookMode_Post)
}

public 
Action:TeleporterUsed(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"builderid"))
    new 
ent = -1;
    while ((
ent FindEntityByClassname(-1"obj_teleporter")) != -1)
    {
        new 
player GetEntPropEnt(entProp_Send"m_hBuilder");
        if(
player == client)
        {
            
SetVariantInt(1000)
            
AcceptEntityInput(ent"RemoveHealth")
        }
    }

__________________
...

Last edited by Oshizu; 05-03-2014 at 12:36.
Oshizu is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 05-02-2014 , 14:04   Re: [TF2] Teleport Exit Disappear
Reply With Quote #3

Quote:
Originally Posted by Oshizu View Post
Something like this?
PHP Code:
#include <sdktools>

public OnPluginStart()
{
    
HookEvent("player_teleported"TeleporterUsedEventHookMode_Post)
}

public 
Action:TeleporterUsed(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"))
    new 
ent = -1;
    while ((
ent FindEntityByClassname(-1"obj_teleporter_exit")) != -1)
    {
        new 
player GetEntPropEnt(entProp_Send"m_hBuilder");
        if(
player == client)
        {
            
SetVariantInt(1000)
            
AcceptEntityInput(ent"RemoveHealth")
        }
    }

PHP Code:
#include <sdktools>

public OnPluginStart()
{
    
HookEvent("player_teleported"TeleporterUsed);
}

public 
TeleporterUsed(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
ent = -1;
    while ((
ent FindEntityByClassname(-1"obj_teleporter_exit")) != -1)
    {
        new 
player GetEntPropEnt(entProp_Send"m_hBuilder");
        if(
player == client)
        {
            
SetVariantInt(1000);
            
AcceptEntityInput(ent"RemoveHealth");
        }
    }

Just cleaned your code up

Last edited by WildCard65; 05-02-2014 at 14:06.
WildCard65 is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 05-02-2014 , 14:14   Re: [TF2] Teleport Exit Disappear
Reply With Quote #4

Quote:
Originally Posted by WildCard65 View Post
PHP Code:
#include <sdktools>

public OnPluginStart()
{
    
HookEvent("player_teleported"TeleporterUsed);
}

public 
TeleporterUsed(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"builderid"));
    new 
ent = -1;
    while ((
ent FindEntityByClassname(-1"obj_teleporter")) != -1)
    {
        new 
player GetEntPropEnt(entProp_Send"m_hBuilder");
        if(
player == client)
        {
            
SetVariantInt(1000);
            
AcceptEntityInput(ent"RemoveHealth");
        }
    }

Just cleaned your code up
Cheers
__________________
...

Last edited by Oshizu; 05-03-2014 at 12:36.
Oshizu is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 05-02-2014 , 16:00   Re: [TF2] Teleport Exit Disappear
Reply With Quote #5

There's no such thing as obj_teleporter_exit, last I checked...you need to check if the obj_teleporter has m_iObjectMode set to 1.

Also, I think you want to check builderid instead of userid; userid is the player who took the Teleporter.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
7106
Senior Member
Join Date: Jun 2013
Old 05-02-2014 , 21:53   Re: [TF2] Teleport Exit Disappear
Reply With Quote #6

Oh...i mean there is error in team fortress 2
Everyone didnt understand my request
Sorry for my very bad english
There is bug in my server : if player go to teleport entrance, teleport exit just explode WITHOUT ANY PLUGINS
so i wanna fix above bug
My server address w71068790.cafe24.com
U can test

Last edited by 7106; 05-02-2014 at 22:00.
7106 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 05-03-2014 , 12:35   Re: [TF2] Teleport Exit Disappear
Reply With Quote #7

It is not a bug, it's feature.
When the game tests the teleport exit and determines that it is not valid for transport (blocked, in a void, touching some weird trigger) it explodes it.

This happens on very poorly made maps that have errors in them... To disable it, you would have to use a me ory patch or something to block the check function.
__________________
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 04:35.


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