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; i <= MaxClients; i++)
{
if (!IsClientInGame(i))
continue;
OnClientPostAdminCheck(i);
}
}
public void OnClientPostAdminCheck(int client)
{
SDKHook(client, SDKHook_EndTouch, Hook_EndTouch);
}
public Action Hook_EndTouch(int client, int other)
{
if (!g_cEnabled.BoolValue || !IsValidEntity(other))
return Plugin_Continue;
char classname[32];
GetEntityClassname(other, classname, 32);
if (StrEqual(classname, "trigger_teleport"))
{
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, view_as<float>(({0.0, 0.0, 0.0})));
}
return Plugin_Continue;
}
__________________