kill_players_under_map 1.0

This commit is contained in:
Resxt 2022-03-30 00:28:07 +02:00
parent fb95f413dd
commit 8a6ef33443
2 changed files with 65 additions and 0 deletions

View File

@ -36,6 +36,15 @@ You can find the list of perks and pro perks in [perktable.csv](https://github.c
The hardcore mode replaces some game functionalities like enabling friendly fire or disabling killcams.
With this script you can override the tweaks the hardcore mode brings.
## kill_players_under_map.gsc
This is a script to kill players when they are under the map.
Some maps don't have a script to kill players under the map and they can exploit it to kill players while being under the map.
Go under the map on the barrier and check the console to get the value to check.
Then open the in-game console and type `mapname` to get the map name.
Finally simply add a to the `switch (map_name)` with the `mapname` value for the case and the `self.origin[2]` value as the returned value.
## kill_stuck_bots.gsc
This is a temporary solution to inactive bots or bots stuck in corners on custom maps.

View File

@ -0,0 +1,56 @@
Init()
{
out_of_map_y = GetOutOfMapValue(GetDvar("mapname"));
level thread OnPlayerConnect(out_of_map_y);
}
OnPlayerConnect(out_of_map_y)
{
for(;;)
{
level waittill("connected", player);
player thread OnPlayerSpawned(out_of_map_y);
}
}
OnPlayerSpawned(out_of_map_y)
{
level endon("game_ended");
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
while (true)
{
if (IsDefined(self.origin[2]))
{
Print(self.origin[2]); // Comment this line when using on your server
if (self.origin[2] < out_of_map_y)
{
self Suicide();
}
}
wait 0.01;
}
}
}
GetOutOfMapValue(map_name)
{
switch (map_name)
{
case "mp_showdown_sh":
return -318;
case "mp_bog":
return -766;
default:
return -999999;
}
}