Raised This Month: $ Target: $400
 0% 

Anti base air in base builder mod


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
VINAGHOST
Member
Join Date: Aug 2016
Location: Việt Nam
Old 11-17-2017 , 07:09   Anti base air in base builder mod
Reply With Quote #1

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(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""ham_Spawn_post"1)
}
public 
ham_Spawn_post(id)
{
    if(!
is_user_alive(id))
        
ExecuteHam(Ham_Spawnid)
    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
(idorigin)
        
// how to dectect player if they near the top of the map ?
        
        
if( /*they near the top of the map*/)
        {
            
ExecuteHam(Ham_Spawnid)
            
client_print(idprint_chat"Air base not allowed)
        }
    }

Thanks ._. and I know my admin can spawn them manually but if they offline who do this ?
VINAGHOST is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode