AMXX新发现
* 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, MA02110-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.php?go=module&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 // is/is not admin
new bool:first_person //is/is not in first person view
new spec // spec=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={{0,0,0},{150,0,0},{0,0,150},{0,150,0}}
new esp_colors={{0,255,0},{100,60,60},{60,60,100},{255,0,255},{128,128,128}}
new bool:ducking //is/is not player ducked
new damage_done_to //damage_done_to=p2 // p1 has hit p2
new view_target // attackers victim
new bool:admin_options // individual esp options
new bool:is_in_menu // 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={"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=0
return PLUGIN_CONTINUE
}
public cmd_esp_settings(id){
if (admin){
new out
read_argv(1,out,10)
new len=strlen(out)
for (new i=0;i<len;i++){
if (out=='1'){
admin_options=true
}else{
admin_options=false
}
}
}
}
public cmd_esp_menu(id){
if (admin && get_pcvar_num(pcvar_esp)==1){
show_esp_menu(id)
}
}
public cmd_esp_toggle(id){
if (admin && get_pcvar_num(pcvar_esp)==1){
change_esp_status(id,!admin_options)
}
}
public show_esp_menu(id){
is_in_menu=true
new 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
new onoff[]={{"\roff\w"},{"\yon\w"}} // \r=red \y=yellow \w white
new text[]={{"(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],
text,
onoff],
onoff],
onoff],
onoff],
onoff],
onoff],
onoff],
onoff],
onoff])
show_menu(id,keys,menu)
return PLUGIN_HANDLED
}
public menu_esp(id,key){
if (key==9){ // exit
is_in_menu=false
return PLUGIN_HANDLED
}
// toggle esp options
if (admin_options){
admin_options=false
}else{
admin_options=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==id){
damage_done_to=id 额。真没看懂 也看不懂 很久以前的东西了,op死后可以透视 这孩子老爱转载别人的东西....
页:
[1]