2016-01-06 02:11:56 +01:00
|
|
|
#pragma semicolon 1
|
|
|
|
|
|
|
|
#include <sourcemod>
|
|
|
|
#include <sdktools>
|
|
|
|
|
|
|
|
#pragma newdecls required
|
|
|
|
|
|
|
|
public Plugin myinfo =
|
|
|
|
{
|
|
|
|
name = "sv_gravity fix",
|
|
|
|
author = "BotoX",
|
2016-05-08 23:03:46 +02:00
|
|
|
description = "Resets sv_gravity at game_end and prevents stupid admins from crashing your server.",
|
|
|
|
version = "1.1",
|
2016-01-06 02:11:56 +01:00
|
|
|
url = ""
|
|
|
|
};
|
|
|
|
|
2016-05-08 23:03:46 +02:00
|
|
|
ConVar g_ConVar_SvGravity;
|
|
|
|
|
|
|
|
public void OnPluginStart()
|
|
|
|
{
|
|
|
|
g_ConVar_SvGravity = FindConVar("sv_gravity");
|
|
|
|
g_ConVar_SvGravity.AddChangeHook(OnConVarChanged);
|
|
|
|
}
|
|
|
|
|
2016-01-06 02:11:56 +01:00
|
|
|
public void OnMapEnd()
|
|
|
|
{
|
2016-05-08 23:03:46 +02:00
|
|
|
g_ConVar_SvGravity.IntValue = 800;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue)
|
|
|
|
{
|
|
|
|
if(convar.IntValue < 1)
|
|
|
|
{
|
|
|
|
convar.IntValue = 800;
|
|
|
|
for(int i = 0; i < 10; i++)
|
|
|
|
PrintToChatAll("Setting sv_gravity to values less than 1 will crash the server!!!");
|
|
|
|
}
|
2016-01-06 02:11:56 +01:00
|
|
|
}
|