AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [REQ] Player speed 0 after teleport (https://forums.alliedmods.net/showthread.php?t=289929)

sneaK 11-01-2016 12:33

[REQ] Player speed 0 after teleport
 
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!

Mitchell 11-01-2016 12:48

Re: [REQ] Player speed 0 after teleport
 
1 Attachment(s)
try this: (sm_trigtele_enabled is default to zero so you will need to set it to 1 for it to work.)

sneaK 11-01-2016 19:45

Re: [REQ] Player speed 0 after teleport
 
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.

Deathknife 11-01-2016 22:38

Re: [REQ] Player speed 0 after teleport
 
1 Attachment(s)
Try this, requires DHOOKS.
sm_reset_speed_on_tp 0/1 = off/on

sneaK 11-01-2016 22:45

Re: [REQ] Player speed 0 after teleport
 
Quote:

Originally Posted by Deathknife (Post 2466986)
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.

Deathknife 11-02-2016 07:20

Re: [REQ] Player speed 0 after teleport
 
Quote:

Originally Posted by blackhawk74 (Post 2466987)
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.

Mitchell 11-02-2016 07:56

Re: [REQ] Player speed 0 after teleport
 
1 Attachment(s)
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.

friagram 11-02-2016 12:44

Re: [REQ] Player speed 0 after teleport
 
you can just

set entity move type none
teleport with velocity of 0 0 0
set move type walk

Mitchell 11-02-2016 12:49

Re: [REQ] Player speed 0 after teleport
 
Quote:

Originally Posted by friagram (Post 2467097)
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?

psychonic 11-02-2016 13:11

Re: [REQ] Player speed 0 after teleport
 
Quote:

Originally Posted by blackhawk74 (Post 2466987)
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.


All times are GMT -4. The time now is 14:35.

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