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

[REQ] Player speed 0 after teleport


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 11-01-2016 , 12:33   [REQ] Player speed 0 after teleport
Reply With Quote #1

I'm looking for a simple plugin; after a player goes through a trigger_teleport I would like that player's speed to immediately be set to 0 (mainly to prevent telehopping, in case of surf & bhop). If at all possible I'd like a cvar to disable the plugin's function entirely, because I don't want it on all maps.

Not sure if it matters in this case, but game is CS:GO. Thank you!
__________________

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

try this: (sm_trigtele_enabled is default to zero so you will need to set it to 1 for it to work.)
Attached Files
File Type: sp Get Plugin or Get Source (trigger_teleport.sp - 340 views - 911 Bytes)

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

Hey Mitch, thanks for the help, unfortunately did not work. I ensured sm_trigtele_enable was set to 1, was still able to telehop, no error logs or anything. Tested on a couple different maps.
__________________

Last edited by sneaK; 11-01-2016 at 20:01.
sneaK is offline
Deathknife
Senior Member
Join Date: Aug 2014
Old 11-01-2016 , 22:38   Re: [REQ] Player speed 0 after teleport
Reply With Quote #4

Try this, requires DHOOKS.
sm_reset_speed_on_tp 0/1 = off/on
Attached Files
File Type: zip speed-reset.zip (6.8 KB, 124 views)
__________________
Deathknife is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 11-01-2016 , 22:45   Re: [REQ] Player speed 0 after teleport
Reply With Quote #5

Quote:
Originally Posted by Deathknife View Post
Try this, requires DHOOKS.
sm_reset_speed_on_tp 0/1 = off/on
That works wonderfully, thank you!

Edit: I realized "Teleport" is already defined in sdktools, can I just change:

Code:
	Handle temp = LoadGameConfigFile("sdktools.games");
and that'll correctly reference the gamedata given by sourcemod (eliminating the need to manually update every time the value is broken by a game update)? Just tested it and it seemed to be working fine.
__________________

Last edited by sneaK; 11-01-2016 at 23:17.
sneaK is offline
Deathknife
Senior Member
Join Date: Aug 2014
Old 11-02-2016 , 07:20   Re: [REQ] Player speed 0 after teleport
Reply With Quote #6

Quote:
Originally Posted by blackhawk74 View Post
That works wonderfully, thank you!

Edit: I realized "Teleport" is already defined in sdktools, can I just change:

Code:
    Handle temp = LoadGameConfigFile("sdktools.games");
and that'll correctly reference the gamedata given by sourcemod (eliminating the need to manually update every time the value is broken by a game update)? Just tested it and it seemed to be working fine.
Completely forgot about sdktools, yeah that will definitely work and it is better overall.
__________________
Deathknife is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-02-2016 , 07:56   Re: [REQ] Player speed 0 after teleport
Reply With Quote #7

I actually just looked at the wrong entity output, this works without DHooks.
Also Deathknife, you don't need to store the value for ConVar handles, they already do, that's what ConVar.BoolValue is.
Attached Files
File Type: sp Get Plugin or Get Source (trigger_teleport.sp - 359 views - 912 Bytes)
Mitchell is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 11-02-2016 , 12:44   Re: [REQ] Player speed 0 after teleport
Reply With Quote #8

you can just

set entity move type none
teleport with velocity of 0 0 0
set move type walk
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-02-2016 , 12:49   Re: [REQ] Player speed 0 after teleport
Reply With Quote #9

Quote:
Originally Posted by friagram View Post
you can just

set entity move type none
teleport with velocity of 0 0 0
set move type walk
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?
Mitchell is offline
psychonic

BAFFLED
Join Date: May 2008
Old 11-02-2016 , 13:11   Re: [REQ] Player speed 0 after teleport
Reply With Quote #10

Quote:
Originally Posted by blackhawk74 View Post
That works wonderfully, thank you!

Edit: I realized "Teleport" is already defined in sdktools, can I just change:

Code:
    Handle temp = LoadGameConfigFile("sdktools.games");
and that'll correctly reference the gamedata given by sourcemod (eliminating the need to manually update every time the value is broken by a game update)? Just tested it and it seemed to be working fine.
In general, you shouldn't rely on gamedata that you don't "own". If SM were to change the name of the section, or removal it for some reason (maybe finding an alternative way to call), your plugin would break. The preferred method is to just copy it to your own gamedata file.
psychonic is offline
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 00:36.


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