搜索
查看: 2655|回复: 4

[AMXX 带源码] AMXX新发现

[复制链接]
发表于 2010-3-17 12:42:47 | 显示全部楼层 |阅读模式 来自 中国–江苏–苏州
* AMX Mod X - Script
*
*        Admin Spectator ESP v1.4_beta
*        Copyright (C) 2006 by KoST
*
*        this plugin along with its compiled version can de downloaded here:
*        http://forums.alliedmods.net/showthread.php?t=23691
*       
*
*  This program is free software; you can redistribute it and/or
*  modify it under the terms of the GNU General Public License
*  as published by the Free Software Foundation; either version 2
*  of the License, or (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*  or download here: http://www.gnu.org/licenses/gpl.txt
*
*  In addition, as a special exception, the author gives permission to
*  link the code of this program with the Half-Life Game Engine ("HL
*  Engine") and Modified Game Libraries ("MODs") developed by Valve,
*  L.L.C ("Valve"). You must obey the GNU General Public License in all
*  respects for all of the code used other than the HL Engine and MODs
*  from Valve. If you modify this file, you may extend this exception
*  to your version of the file, but you are not obligated to do so. If
*  you do not wish to do so, delete this exception statement from your
*  version.
*/
//--------------------------------------------------------------------------------------------------

#include <amxmodx>
#include <engine>

// Here you can adjust the required admin level if needed
// there is a list of all levels http://www.amxmodx.org/funcwiki. ... mp;id=1#const_admin

#define REQUIRED_ADMIN_LEVEL ADMIN_KICK

//--------------------------------------------------------------------------------------------------

#define PLUGIN "Admin Spectator ESP"
#define VERSION "1.4_beta"
#define AUTHOR "KoST"

enum {
        ESP_ON=0,
        ESP_LINE,
        ESP_BOX,
        ESP_NAME,
        ESP_HEALTH_ARMOR,
        ESP_WEAPON,
        ESP_CLIP_AMMO,
        ESP_DISTANCE,
        ESP_TEAM_MATES,
        ESP_AIM_VEC,
}

new bool:admin[33] // is/is not admin
new bool:first_person[33] //is/is not in first person view
new spec[33] // spec[player_id]=the players id if
new laser // precached model
new max_players // if you start hlds with +maxplayers 20 for example this would be 20
new team_colors[4][3]={{0,0,0},{150,0,0},{0,0,150},{0,150,0}}
new esp_colors[5][3]={{0,255,0},{100,60,60},{60,60,100},{255,0,255},{128,128,128}}
new bool:ducking[33] //is/is not player ducked
new damage_done_to[33] //damage_done_to[p1]=p2 // p1 has hit p2
new view_target[33] // attackers victim
new bool:admin_options[33][10] // individual esp options
new bool:is_in_menu[33] // has esp menu open
new pcvar_esp
new pcvar_esp_timer
new pcvar_esp_allow_all
new pcvar_esp_disable_default_keys


// weapon strings
new weapons[30][10]={"None","P228","Scout","HE","XM1014","C4",
        "MAC-10","AUG","Smoke","Elite","Fiveseven",
        "UMP45","SIG550","Galil","Famas","USP",
        "Glock","AWP","MP5","M249","M3","M4A1",
        "TMP","G3SG1","Flash","Deagle","SG552",
        "AK47","Knife","P90"}

public plugin_precache(){
        laser=precache_model("sprites/laserbeam.spr")
}

public plugin_init(){
        register_plugin(PLUGIN,VERSION,AUTHOR)
        server_print("^n^t%s v%s, Copyright (C) 2006 by %s^n",PLUGIN,VERSION,AUTHOR)
       
        // cvars
        pcvar_esp=register_cvar("esp","1")
        pcvar_esp_timer=register_cvar("esp_timer","0.3")
        pcvar_esp_allow_all=register_cvar("esp_allow_all","0")
        pcvar_esp_disable_default_keys=register_cvar("esp_disable_default_keys","0")
        register_cvar("aesp_version",VERSION,FCVAR_SERVER|FCVAR_UNLOGGED|FCVAR_SPONLY)
       
        // client commands
        register_clcmd("esp_menu","cmd_esp_menu",REQUIRED_ADMIN_LEVEL,"Shows ESP Menu")
        register_clcmd("esp_toggle","cmd_esp_toggle",REQUIRED_ADMIN_LEVEL,"Toggle ESP on/off")
        register_clcmd("say /esp_menu","cmd_esp_menu",REQUIRED_ADMIN_LEVEL,"Shows ESP Menu")
        register_clcmd("say /esp_toggle","cmd_esp_toggle",REQUIRED_ADMIN_LEVEL,"Toggle ESP on/off")
        register_clcmd("esp_settings","cmd_esp_settings",REQUIRED_ADMIN_LEVEL," ESP adasdsassdasd")
       
       
        // events
        register_event("StatusValue","spec_target","bd","1=2")
        register_event("SpecHealth2","spec_target","bd")
        register_event("TextMsg","spec_mode","b","2&#Spec_Mode")
        register_event("Damage", "event_Damage", "b", "2!0", "3=0", "4!0")
        register_event("ResetHUD", "reset_hud_alive", "be")
       
       
        // menu
        new keys=MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9
        register_menucmd(register_menuid("Admin Specator ESP"),keys,"menu_esp")
       
        max_players=get_maxplayers()
       
        // start esp_timer for the first time
        set_task(1.0,"esp_timer")
}

public reset_hud_alive(id){
        spec[id]=0
        return PLUGIN_CONTINUE
}

public cmd_esp_settings(id){
        if (admin[id]){
                new out[11]
                read_argv(1,out,10)
                new len=strlen(out)        
                for (new i=0;i<len;i++){
                        if (out=='1'){
                                admin_options[id]=true
                        }else{
                                admin_options[id]=false
                        }
                }
        }
}

public cmd_esp_menu(id){
        if (admin[id] && get_pcvar_num(pcvar_esp)==1){
                show_esp_menu(id)
        }
}

public cmd_esp_toggle(id){
        if (admin[id] && get_pcvar_num(pcvar_esp)==1){
                change_esp_status(id,!admin_options[id][0])
        }
}

public show_esp_menu(id){
        is_in_menu[id]=true
        new menu[301]
        new keys=MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9
        new onoff[2][]={{"\roff\w"},{"\yon\w"}} // \r=red \y=yellow \w white
        new text[2][]={{"(use move forward/backward to switch on/off)"},{"(use esp_toggle command to toggle)"}} // \r=red \y=yellow \w white
        new text_index=get_pcvar_num(pcvar_esp_disable_default_keys)
        if (text_index!=1) text_index=0
        format(menu, 300, "Admin Specator ESP^nis %s %s^n^n1. Line is %s^n2. Box is %s^n3. Name is %s^n4. Health/Armor is %s^n5. Weapon is %s^n6. Clip/Ammo is %s^n7. Distance is %s^n8. Show TeamMates is %s^n9. Show AimVector is %s^n^n0. Exit",
        onoff[admin_options[id][ESP_ON]],
        text[text_index],
        onoff[admin_options[id][ESP_LINE]],
        onoff[admin_options[id][ESP_BOX]],
        onoff[admin_options[id][ESP_NAME]],
        onoff[admin_options[id][ESP_HEALTH_ARMOR]],
        onoff[admin_options[id][ESP_WEAPON]],
        onoff[admin_options[id][ESP_CLIP_AMMO]],
        onoff[admin_options[id][ESP_DISTANCE]],
        onoff[admin_options[id][ESP_TEAM_MATES]],
        onoff[admin_options[id][ESP_AIM_VEC]])
        show_menu(id,keys,menu)
       
        return PLUGIN_HANDLED
}

public menu_esp(id,key){
        if (key==9){ // exit
                is_in_menu[id]=false
                return PLUGIN_HANDLED
        }
        // toggle esp options
        if (admin_options[id][key+1]){
                admin_options[id][key+1]=false
                }else{
                admin_options[id][key+1]=true
        }
        show_esp_menu(id)
        return PLUGIN_HANDLED
}

public event_Damage(id){
        if (id>0) {
                new attacker=get_user_attacker(id)
                if (attacker>0 && attacker<=max_players){
                        if (view_target[attacker]==id){
                                damage_done_to[attacker]=id

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
发表于 2010-3-17 18:02:35 | 显示全部楼层 来自 中国–新疆–阿克苏地区–阿克苏市
额。真没看懂
回复

使用道具 举报

发表于 2010-3-18 00:44:28 | 显示全部楼层 来自 中国–山东–济南
也看不懂
回复

使用道具 举报

发表于 2010-3-18 04:08:29 | 显示全部楼层 来自 中国–河北–石家庄
很久以前的东西了,op死后可以透视
回复

使用道具 举报

发表于 2010-3-20 00:16:21 | 显示全部楼层 来自 中国–陕西–西安
这孩子老爱转载别人的东西....
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表