Compare commits

...

4 Commits

Author SHA1 Message Date
Ciallo
cb9f4efe60
Update gamedata after 2/2/23 CSGO update
Closes #4
2023-02-04 00:08:30 +03:00
Ciallo
8fabe86bb9
Update gamedata after 21/10/22 CSGO update (#3) 2022-10-22 14:50:14 +03:00
Nora
dbd7683201
Add a way to increase or decrease speed via commands (#2) 2021-11-18 03:06:26 +03:00
GAMMACASE
2532f958c9 Update gamedata after 10/11/21 CSGO update 2021-11-10 16:10:43 +03:00
2 changed files with 15 additions and 8 deletions

View File

@ -36,7 +36,7 @@
{
"library" "server"
"windows" "\x53\x8B\xDC\x83\xEC\x08\x83\xE4\xF0\x83\xC4\x04\x55\x8B\x6B\x04\x89\x6C\x24\x04\x8B\xEC\x83\xEC\x5C\x56\x8B\xF1"
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x9C\x00\x00\x00\xA1\x2A\x2A\x2A\x2A\x8B\x5D\x08\x3D\x2A\x2A\x2A\x2A"
"linux" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x4C\xA1\x2A\x2A\x2A\x2A\x8B\x5D\x08\x3D\x2A\x2A\x2A\x2A\x0F\x84\x2A\x2A\x2A\x2A\x8B\x10\x8B\x52\x3C\x81\xFA\x2A\x2A\x2A\x2A\x0F\x85\x2A\x2A\x2A\x2A\x8B\x70\x1C\x39\xC6\x0F\x84\x2A\x2A\x2A\x2A\x8B\x06\x8B\x40\x3C\x3D\x2A\x2A\x2A\x2A\x0F\x85\x2A\x2A\x2A\x2A\x8B\x7E\x1C\x39\xFE\x0F\x84\x2A\x2A\x2A\x2A\x8B\x07\x8B\x40\x3C\x3D\x2A\x2A\x2A\x2A\x0F\x85\x2A\x2A\x2A\x2A\x8B\x47\x1C"
}
}
}

View File

@ -12,7 +12,7 @@ public Plugin myinfo =
name = "NoclipSpeed",
author = "GAMMA CASE",
description = "Let's you change noclip speed.",
version = "1.1.0",
version = "1.1.1",
url = "http://steamcommunity.com/id/_GAMMACASE_/"
};
@ -56,8 +56,8 @@ public void OnPluginStart()
{
gEVType = GetEngineVersion();
RegConsoleCmd("sm_ns", SM_NoclipSpeed, "Sets noclip speed.");
RegConsoleCmd("sm_noclipspeed", SM_NoclipSpeed, "Sets noclip speed.");
RegConsoleCmd("sm_ns", SM_NoclipSpeed, "Sets noclip speed. Can also be used to set or change speed via argument (Examples: sm_ns 1500 or sm_ns +100)");
RegConsoleCmd("sm_noclipspeed", SM_NoclipSpeed, "Sets noclip speed. Can also be used to set or change speed via argument (Examples: sm_ns 1500 or sm_ns +100)");
gMaxAllowedNoclipFactor = CreateConVar("noclipspeed_max_factor", "35", "Max allowed factor for noclip (factor * 300 = speed)", .hasMin = true);
@ -217,11 +217,18 @@ public Action SM_NoclipSpeed(int client, int args)
float spd = StringToFloat(buff);
gPlayerNoclipSpeed[client] = Clamp(NoclipUPSToFactor(spd), 0.0, gMaxAllowedNoclipFactor.FloatValue);
// NaN check in case of an invalid argument
if(spd == 0.0 || spd != spd)
{
PrintToChat(client, SNAME..."Invalid speed value specified, check your arguments!");
return Plugin_Handled;
}
gPlayerNoclipSpeed[client] = Clamp(buff[0] == '+' || buff[0] == '-' ? gPlayerNoclipSpeed[client] + NoclipUPSToFactor(spd) : NoclipUPSToFactor(spd), 0.0, gMaxAllowedNoclipFactor.FloatValue);
Format(buff, sizeof(buff), "%f", gPlayerNoclipSpeed[client]);
sv_noclipspeed.ReplicateToClient(client, buff);
PrintToChat(client, SNAME..."Changed noclip speed to: %.2f u/s", NoclipFactorToUPS(gPlayerNoclipSpeed[client]));
PrintToChat(client, SNAME..."Changed noclip speed to: %i u/s", RoundToNearest(NoclipFactorToUPS(gPlayerNoclipSpeed[client])));
}
return Plugin_Handled;
@ -233,7 +240,7 @@ public int NoclipSpeed_Menu(Menu menu, MenuAction action, int param1, int param2
{
case MenuAction_Display:
{
menu.SetTitle("Noclip speed\n \nCurrent speed: %.2f\n ", NoclipFactorToUPS(gPlayerNoclipSpeed[param1]));
menu.SetTitle("Noclip speed\n \nCurrent speed: %i\n ", RoundToNearest(NoclipFactorToUPS(gPlayerNoclipSpeed[param1])));
}
case MenuAction_DrawItem:
@ -299,4 +306,4 @@ float Clamp(float val, float min, float max)
bool CloseEnough(float a, float b, float eps = FLT_EPSILON)
{
return FloatAbs(a - b) <= eps;
}
}