|
Veteran Member
Join Date: Aug 2013
Location: Denmark
|
09-27-2016
, 11:32
Re: [REQ] More terrorist Speed
|
#11
|
Quote:
Originally Posted by Nursik
Should hook weapon switch, because speed changes when you change weps. And the speed value is so low, didn't know about that in CS:GO.
|
Notice in CS:S, CS:GO, 2.0 equals 200% speed, i thought 200.0 was a typo, since that would result in 20000% speed lol.
Here then:
Spoiler
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdkhooks>
ConVar g_tspeed;
public void OnPluginStart()
{
g_tspeed = CreateConVar("terrorist_speed", "200.0", "Sets terrorist team's speed");
HookEvent("player_spawn", PlayerSpawn);
SDKHook(client, SDKHook_WeaponSwitch, OnPlayerWeaponSwitch);
}
public Action PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if(IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 2)
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", g_tspeed.FloatValue);
return Plugin_Continue;
}
public void OnPlayerWeaponSwitch(int client)
{
if(IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 2)
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", g_tspeed.FloatValue);
}
__________________
|
|
|
|