View Single Post
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