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

[REQ] Player speed 0 after teleport


Post New Thread Reply   
 
Thread Tools Display Modes
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 11-02-2016 , 15:09   Re: [REQ] Player speed 0 after teleport
Reply With Quote #11

Quote:
Originally Posted by Mitchell View Post
This is what my plugin does, it hooks Trigger_Teleport's OnEndTouch and sets the velocity to zero. Tested it and works fine, not sure why you would want to set the movetype to none then back to walk?
when teleport is called, it will not calculate the additive velocity if it is set to movetype none. by doing none teleport walk, the result velocity is zeroed out. no gamedata required.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
fluffys
Member
Join Date: Jun 2015
Old 11-02-2016 , 19:58   Re: [REQ] Player speed 0 after teleport
Reply With Quote #12

This is possible with Stripper:Source

Code:
modify:
{
	match:
	{
	        "classname" "trigger_teleport"
	}
	insert:
	{
		"OnStartTouch" "!activatorRunScriptCodeself.SetVelocity(Vector(0,0,0));0-1"
	}
}

Last edited by fluffys; 11-02-2016 at 19:58.
fluffys is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 11-03-2016 , 19:25   Re: [REQ] Player speed 0 after teleport
Reply With Quote #13

Quote:
Originally Posted by fluffys View Post
This is possible with Stripper:Source
Spoiler
Just tried this on multiple maps, didn't work
__________________

Last edited by sneaK; 11-03-2016 at 19:26.
sneaK is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-03-2016 , 19:52   Re: [REQ] Player speed 0 after teleport
Reply With Quote #14

Quote:
Originally Posted by blackhawk74 View Post
Just tried this on multiple maps, didn't work
prob cause it doesnt follow the AddOutput format:
Code:
modify:
{
	match:
	{
	        "classname" "trigger_teleport"
	}
	insert:
	{
		"OnEndTouch" "!activator:RunScriptCode:self.SetVelocity(Vector(0,0,0)):0:-1"
	}
}
Mitchell is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 11-03-2016 , 20:00   Re: [REQ] Player speed 0 after teleport
Reply With Quote #15

Quote:
Originally Posted by Mitchell View Post
prob cause it doesnt follow the AddOutput format:
Spoiler
Interestingly does not work either. The latest version of the plugin you wrote up works awesome, looks like I'll be using that, thank you!
__________________
sneaK is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 12-11-2016 , 16:44   Re: [REQ] Player speed 0 after teleport
Reply With Quote #16

Welp, hate to bring this up from the dead but I noticed a bug in Mitchell's version.

Not only does it set player speed to 0 after a trigger_teleport as intended, but it also sets player speed to 0 after trigger_multiple, and trigger_push (both of which do not teleport), which is a bit of an issue. Any thoughts on a fix?
__________________

Last edited by sneaK; 12-11-2016 at 16:46.
sneaK is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-11-2016 , 19:31   Re: [REQ] Player speed 0 after teleport
Reply With Quote #17

Quote:
Originally Posted by blackhawk74 View Post
Welp, hate to bring this up from the dead but I noticed a bug in Mitchell's version.

Not only does it set player speed to 0 after a trigger_teleport as intended, but it also sets player speed to 0 after trigger_multiple, and trigger_push (both of which do not teleport), which is a bit of an issue. Any thoughts on a fix?
That's interesting, since my version only hooks the entity "trigger_teleport" :/
Mitchell is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 12-12-2016 , 11:43   Re: [REQ] Player speed 0 after teleport
Reply With Quote #18

Quote:
Originally Posted by Mitchell View Post
That's interesting, since my version only hooks the entity "trigger_teleport" :/


Here's an example of a trigger_push stopping the player:
Code:
model" "*20"
"origin" "-64 2048 -3792"
"spawnflags" "1"
"speed" "1000"
"pushdir" "0 0 0"
"StartDisabled" "0"
"classname" "trigger_push"
}
Final stage of surf_singletons, but happens on every trigger_push I've encountered

Example of a trigger_multiple on a different map stopping the player:
Code:
{
"model" "*1"
"wait" "0"
"StartDisabled" "0"
"spawnflags" "4161"
"origin" "1315 9 633"
"classname" "trigger_multiple"
"hammerid" "203916"
"OnTrigger" "!activatorSetDamageFilterdmgFilter0-1"
}
Players spawn inside this trigger_multiple, and once they leave it, it completely stops them. Curiously enough I was not able to replicate it when I was in a server by myself, but only with other people. The trigger_push issue I was able to replicate with only myself in the server.
__________________

Last edited by sneaK; 12-12-2016 at 11:55.
sneaK is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 12-21-2016 , 11:24   Re: [REQ] Player speed 0 after teleport
Reply With Quote #19

I've been doing a little investigating, and interestingly enough I simply wasn't able to replicate this issue with only myself in the server. It seems as though the issue crops up consistently when there are several players in the server.

That being said, players are still stopped at every trigger_multiple, and push.
__________________
sneaK is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 12-21-2016 , 22:01   Re: [REQ] Player speed 0 after teleport
Reply With Quote #20

I'm back again...the one Mitchell posted should work though without any issues. You can try this one out, uses SDKHook instead. Untested.

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#pragma newdecls required
#define PLUGIN_VERSION "1.0"

ConVar g_cEnabled;

public 
Plugin myinfo 
{
    
name "Trigger Teleport Velocity",
    
author "Tak (Chaosxk)",
    
description "Sets the player's velocity to zero after teleporting.",
    
version PLUGIN_VERSION,
    
url "https://forums.alliedmods.net/showthread.php?t=289929"
};

public 
void OnPluginStart()
{
    
CreateConVar("sm_trigtele_version"PLUGIN_VERSION"Version for this plugin."FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
g_cEnabled CreateConVar("sm_trigtele_enable""1""Enable/Disable this plugin.");
    
    
//Late-load situations
    
for (int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i))
            continue;
        
OnClientPostAdminCheck(i);
    }
}

public 
void OnClientPostAdminCheck(int client)
{
    
SDKHook(clientSDKHook_EndTouchHook_EndTouch);
}

public 
Action Hook_EndTouch(int clientint other)
{
    if (!
g_cEnabled.BoolValue || !IsValidEntity(other))
        return 
Plugin_Continue;
        
    
char classname[32];
    
GetEntityClassname(otherclassname32);
    
    if (
StrEqual(classname"trigger_teleport"))
    {
        
TeleportEntity(clientNULL_VECTORNULL_VECTORview_as<float>(({0.00.00.0})));
    }
    
    return 
Plugin_Continue;

__________________
Chaosxk 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 09:25.


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