Решено Admin Loader Radius edition

Статус
Новые ответы в этой теме размещать нельзя.

Sekret

Участник
Сообщения
39
Симпатии
12
Баллы
29
#1
Добрый день ребят, не подскажите где надо поменять в плагине(суть такова, сменил лоадер от неугомона на от радиуса) и перестал работать плагин есп мини(линии наблюдения у админов) сам плагин вот(где там надо сменить чтоб заработал, исходного кода от радиуса нет конечно) но если я запутался подскажите в чём проблема

Код:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Admin Spectator ESP"
#define VERSION "1.6"
#define AUTHOR "KoST"

#define OFFSET_TEAM    114

enum {
    ESP_ON = 0,
    ESP_LINE,
    ESP_BOX
}

new bool:admin[33], bool:first_person[33], bool:ducking[33], bool:admin_options[33][10], bool:is_in_menu[33]
new team_colors[4][3]={{0,0,0},{150,0,0},{0,0,150},{0,150,0}}
new view_target[33], damage_done_to[33], spec[33], pcvar_esp_default_keys, laser, max_players

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    pcvar_esp_default_keys    = register_cvar("esp_disable_default_keys","0")
    
    register_clcmd("esp_menu", "cmd_esp_menu", ADMIN_LEVEL_H, "Shows ESP Menu")
    register_clcmd("esp_setting", "cmd_esp_settings", ADMIN_LEVEL_H, "ESP adasdsassdasd")
    
    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")
    
    register_forward(FM_PlayerPreThink, "fwdPlayerPreThink") 
    
    new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2
    register_menucmd(register_menuid("Admin Specator ESP"), keys, "menu_esp")
    
    max_players = get_maxplayers()
    
    set_task(1.0, "esp_timer")
}

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

public client_putinserver(id)
{
    first_person[id]=false
    if (get_user_flags(id) & ADMIN_LEVEL_H)
    {
        admin[id]=true
        init_admin_options(id)
    }
    else
        admin[id]=false
}

public client_disconnect(id)
{
    admin[id] = false
    spec[id] = 0
}

public reset_hud_alive(id)
    spec[id] = 0

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

public cmd_esp_menu(id)
{
    if (admin[id])
    {
        show_esp_menu(id)
    }
}


show_esp_menu(id)
{
    is_in_menu[id] = true
    new menu[501]
    new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2
    new onoff[2][] = {{"\roff\w"},{"\yon\w"}}
    new text[2][] = {{"(use move forward/backward to switch on/off)"},{"(use esp_toggle command to toggle)"}}
    new text_index = get_pcvar_num(pcvar_esp_default_keys)
    if (text_index!=1) text_index=0
    formatex(menu, 500, "Admin ESP-90x^n %s %s^n^n1. Линии %s^n2. Квадраты %s^n^n0. Выход", onoff[admin_options[id][ESP_ON]], text[text_index],
    onoff[admin_options[id][ESP_LINE]],
    onoff[admin_options[id][ESP_BOX]])
    show_menu(id, keys,menu)
    
    return PLUGIN_HANDLED
}

public menu_esp(id, key)
{
    if (key==9)
    {
        is_in_menu[id]=false
        return PLUGIN_HANDLED
    }
    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
        }
    }
    return PLUGIN_CONTINUE
}

public spec_mode(id)
{
    new specMode[12]
    read_data(2, specMode, 11)
    
    if(equal(specMode,"#Spec_Mode4"))
        first_person[id]=true
    else
        first_person[id]=false

    return PLUGIN_CONTINUE
}

public spec_target(id)
{
    if (id>0)
    {
        new target=read_data(2)
        if (target!=0)
            spec[id]=target
    }
    return PLUGIN_CONTINUE
}

init_admin_options(id)
{
    for (new i=0;i<4;i++)
    {
        admin_options[id][i] = true
    }
}
public fwdPlayerPreThink(id)
{
    if (!is_user_connected(id)) return FMRES_IGNORED
    
    static button
    button=pev(id, pev_button)
    if (button==0) return FMRES_IGNORED

    
    if (button & IN_DUCK)
        ducking[id]=true
    else
        ducking[id]=false
    
    if (get_pcvar_num(pcvar_esp_default_keys) !=1)
    {
        if (admin[id])
        {
            if (first_person[id] && !is_user_alive(id))
                admin_options[id][0] = true
        }
    }
    return FMRES_HANDLED
}

public esp_timer()
{
    static spec_id, Float:my_origin[3], my_team, target_team, Float:target_origin[3], Float:distance, width

    for (new i=1;i<=max_players;i++)
    {
        if (admin_options[i][ESP_ON] && first_person[i] && is_user_connected(i) && admin[i] && (!is_user_alive(i)) && (spec[i]>0) && is_user_alive(spec[i]))
        {
            spec_id=spec[i]
            pev(i, pev_origin, my_origin)
            my_team = get_pdata_int(spec_id, OFFSET_TEAM)
            
            for (new s=1;s<=max_players;s++)
            {
                if (is_user_alive(s))
                {
                    target_team = get_pdata_int(s, OFFSET_TEAM)
                    if (!(target_team ==3))
                    {
                        if (spec_id !=s)
                        {
                            if (((my_team != target_team && (target_team ==1 || target_team ==2))))
                            {
                                pev(s, pev_origin, target_origin)
                                distance=vector_distance(my_origin, target_origin)
                                
                                if (admin_options[i][ESP_LINE])
                                {
                                    if (distance<2040.0)
                                        width=(255-floatround(distance/8.0))/3
                                    else
                                        width=1

                                    make_TE_BEAMENTPOINT(i, target_origin, width,target_team)
                                }
                                
                            }
                        }
                    }
                }
            }
        }
    }
    set_task(0.4, "esp_timer")
    return PLUGIN_CONTINUE 
}


make_TE_BEAMENTPOINT(id,Float:target_origin[3],width,target_team)
{
    message_begin(MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,{0,0,0},id)
    write_byte(1)
    write_short(id)
    write_coord(floatround(target_origin[0]))
    write_coord(floatround(target_origin[1]))
    write_coord(floatround(target_origin[2]))
    write_short(laser)
    write_byte(1)     
    write_byte(1)
    write_byte(3)
    write_byte(width)
    write_byte(0)
    write_byte(team_colors[target_team][0])
    write_byte(team_colors[target_team][1])
    write_byte(team_colors[target_team][2])
    write_byte(255)
    write_byte(0)
    message_end()
}
 
Статус
Новые ответы в этой теме размещать нельзя.