Hello ._.
In my server, people always build "air base" which is close to the top of the map.
I want to prevent them by detecting their origin ang check it is too close the top map and I will teleport them to spawn point.
But I can't find any code about get origin of the top of map, can someone give me one ?
This is my code :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>
#include <basebuilder>
#define PLUGIN "BB: Anti base air"
#define VERSION "1.0"
#define AUTHOR "VINAGHOST"
new anti[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "ham_Spawn_post", 1)
}
public ham_Spawn_post(id)
{
if(!is_user_alive(id))
ExecuteHam(Ham_Spawn, id)
else
{
if(!bb_is_user_zombie(id)) anti[id] = true
anti[id] = false
}
}
public client_PostThink(id)
{
if( anti[id] )
{
new origin[3], dist
get_user_origin(id, origin)
// how to dectect player if they near the top of the map ?
if( /*they near the top of the map*/)
{
ExecuteHam(Ham_Spawn, id)
client_print(id, print_chat, "Air base not allowed)
}
}
}
Thanks ._. and I know my admin can spawn them manually but if they offline who do this ?