Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

> Правила раздела

Перед созданием новой темы убедитесь, не искал ли кто-нибудь подобный плагин до вас, для этого следует воспользоваться поиском.

Все вновь созданные темы, с названием типа "Помогите найти", "А что это за плагин", "Ищу плагин", "Нужен плагин", "Подскажите пожалуйста название плагина" - будут удалены.
При создании темы постарайтесь максимально понятно сформулировать её заголовок так, чтобы он соответствовал функциям плагина который Вы ищите. В том случае, если Вам не удается сформулировать мысль и правильно расписать всё в теме, воспользуйтесь графическим редактором, к примеру Paint, что бы примерно изобразить функции нужного Вам плагина.

Если ли исходник от adm esp mini ?

cs-portal
сообщение 1.7.2011, 12:58
Сообщение #1
Стаж: 16 лет

Сообщений: 8181
Благодарностей: 2709
Полезность: 0

На всех сайтах нет исходника плагина. ставить не хочу без него..

также ищу код просветки игроков в виде расстояния циферками сквозь стены
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   Цитировать сообщение
Статус пользователя Sw1ch
сообщение 1.7.2011, 13:39
Сообщение #2
Стаж: 15 лет

Сообщений: 616
Благодарностей: 228
Полезность: < 0

http://forums.alliedmods.net/showthread.php?t=23691
takoi ne?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя imba
сообщение 1.7.2011, 14:11
Сообщение #3
Стаж: 16 лет

Сообщений: 1677
Благодарностей: 735
Полезность: 571

+
Код
/* 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 <fakemeta>

// 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_BAN

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

#define PLUGIN "Admin ESP"
#define VERSION "1.5b_mini"
#define AUTHOR "KoST"

#define OFFSET_TEAM            114

new const g_szPlugin[] = PLUGIN; // Global this since it is used throughout
new pcvar_esp, pcvar_esp_timer, pcvar_esp_allow_all, pcvar_esp_disable_default_keys;
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:admin[33];        // is/is not admin
new bool:first_person[33];    // is/is not in first person view
new bool:ducking[33];        // is/is not player ducked
new bool:mode[33];        // 0 = line, 1 = box
new bool:enabled[33];        // has esp on
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 damage_done_to[33];        // damage_done_to[p1]=p2 // p1 has hit p2
new view_target[33];        // attackers victim

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

public plugin_init() {
    register_plugin(g_szPlugin, VERSION, AUTHOR);
    server_print("^n^t%s v%s, Copyright (C) 2006 by %s^n", g_szPlugin, VERSION, AUTHOR);

    // cvars
    pcvar_esp = register_cvar("esp", "1");
    pcvar_esp_timer = register_cvar("esp_timer", "0.4");
    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_mode", "cmd_esp_mode", REQUIRED_ADMIN_LEVEL, "Toggle ESP type: line/box");    
    register_clcmd("say /esp_mode", "cmd_esp_mode", REQUIRED_ADMIN_LEVEL, "Toggle ESP type: line/box");
    register_clcmd("esp_toggle", "cmd_esp_toggle", REQUIRED_ADMIN_LEVEL, "Toggle ESP on/off");
    register_clcmd("say /esp_toggle", "cmd_esp_toggle", REQUIRED_ADMIN_LEVEL, "Toggle ESP on/off");

    // 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");

    register_forward(FM_PlayerPreThink, "fwdPlayerPreThink");
    max_players = get_maxplayers();
    // start esp_timer for the first time
    set_task(1.0, "esp_timer");
}

public client_putinserver(id) {
    first_person[id] = false;
    new args[1];
    args[0] = id;
    set_task(4.0, "delayed_putinserver", id + 100, args, 1);
}

public delayed_putinserver(args[0])
{
    new id = args[0];
    if (!is_user_connected(id))
    {
        return PLUGIN_HANDLED;
    }
    if ((get_user_flags(id) & REQUIRED_ADMIN_LEVEL) || get_pcvar_num(pcvar_esp_allow_all) == 1) {
        admin[id] = true;
        init_admin_options(id);
    } else {
        admin[id] = false;
    }
    return PLUGIN_CONTINUE;
}

public client_disconnect(id) {
    save2vault(id);
    admin[id] = false;
    spec[id] = 0;
    remove_task(id + 100);
}

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

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

public cmd_esp_mode(id) {
    if (admin[id] && get_pcvar_num(pcvar_esp) == 1) {
        change_esp_mode(id, !mode[id]);
    }
}

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) {
    // discover if in first_person_view
    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) {
    mode[id] = false;
    enabled[id] = true;
    load_vault_data(id);
}

save2vault(id) {
    if (admin[id]) {
        new authid[35];
        get_user_authid (id,authid,34);
        new tmp[3];
        tmp[0] = (mode[id]) ? '1' : '0';
        tmp[1] = (enabled[id])  ? '1' : '0';
        
        //server_print("STEAMID: %s OPTIONS: %s", authid, tmp);
        new key[41];
        formatex(key, 40, "AESPmini_%s", authid);
        set_vaultdata(key, tmp);
    }
}

load_vault_data(id) {
    if (admin[id]) {
        new data[3];
        new authid[35];
        get_user_authid (id,authid,34);
        new key[41];
        formatex(key,40, "AESPmini_%s", authid);
        get_vaultdata(key,data,2);
        if (strlen(data) > 0) {
            mode[id] = (data[0]=='1');
            enabled[id] = (data[1]=='1');
        }
    }
}

change_esp_status(id, bool:on) {
    if (on) {
        enabled[id] = true;
        client_print(id, print_chat, "[%s] ON", g_szPlugin);
    } else {
        enabled[id] = false;
        client_print(id, print_chat, "[%s] OFF", g_szPlugin);
    }
}

change_esp_mode(id, bool:on) {
    if (on) {
        mode[id] = true;
        client_print(id, print_chat, "[%s] Mode: Box", g_szPlugin);
    } else {
        mode[id] = false;
        client_print(id, print_chat, "[%s] Mode: Line", g_szPlugin);
    }
}


public fwdPlayerPreThink(id) {
    if (!is_user_connected(id)) return FMRES_IGNORED;
    
    static button;
    button = pev(id, pev_button);
    if (button==0) return FMRES_IGNORED; // saves a lot of cpu
    
    static oldbutton;
    oldbutton = pev(id, pev_oldbuttons);
    
    if (button & IN_DUCK) {
        ducking[id] = true;
    } else {
        ducking[id] = false;
    }
    
    if ((get_pcvar_num(pcvar_esp) == 1) && (get_pcvar_num(pcvar_esp_disable_default_keys) != 1)) {
        if (admin[id]) {
            if (first_person[id] && !is_user_alive(id)) {
                if ((button & IN_RELOAD) && !(oldbutton & IN_RELOAD)) {
                    cmd_esp_mode(id);
                }
                if ((button & IN_FORWARD)  && !(oldbutton & IN_FORWARD) && !enabled[id]) {
                    change_esp_status(id, true);
                }
                if ((button & IN_BACK)  && !(oldbutton & IN_BACK) && enabled[id]) {
                    change_esp_status(id, false);
                }
            }
        }
    }
    return FMRES_HANDLED;
}

public esp_timer() {
    
    if (get_pcvar_num(pcvar_esp) != 1) { // if esp is not 1, it is off
        set_task(1.0, "esp_timer"); // check for reactivation in 1 sec intervals
        return PLUGIN_CONTINUE;
    }

    static spec_id, Float:my_origin[3], my_team, s,
    target_team, Float:target_origin[3], Float:distance, width, Float:v_middle[3], Float:v_hitpoint[3],
    Float:distance_to_hitpoint, Float:scaled_bone_len, Float:scaled_bone_width, Float:v_bone_start[3],
    Float:v_bone_end[3], Float:offset_vector[3], Float:eye_level[3], Float:distance_target_hitpoint,
    actual_bright, color

    for (new i = 1; i <= max_players; i++) { // loop through players
        
        if (enabled[i] && 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); // get origin of spectating admin
            // get team of spectated :)
            my_team = get_pdata_int(spec_id, OFFSET_TEAM);
            
            for (s = 1; s <= max_players; s++) { // loop through the targets
                if (is_user_alive(s)) { // target must be alive
                    // get team of target
                    target_team = get_pdata_int(s, OFFSET_TEAM);
                    if (!(target_team == 3)) { //if not spectator
                        if (spec_id != s) { // do not target myself
                            // if the target is in the other team and not spectator
                            
                            if (((my_team != target_team && (target_team == 1 || target_team == 2)) )) {
                                // get origin of target
                                pev(s, pev_origin, target_origin);
                                
                                
                                // get distance from me to target
                                distance = vector_distance(my_origin, target_origin);
                                
                                if (!mode[i]) { // Draw LINE?
                                    // calculate width according to distance
                                    width = (distance < 2040.0) ? ( (255 - floatround(distance / 8.0) ) / 3 ) : 1;

                                    // create temp_ent
                                    make_TE_BEAMENTPOINT(i, target_origin, width, target_team);
                                }

                                // get vector from me to target
                                subVec(target_origin, my_origin, v_middle);

                                // trace from me to target, getting hitpoint
                                engfunc(EngFunc_TraceLine, my_origin, target_origin, 1, -1, 0);
                                get_tr2(0, TR_vecEndPos, v_hitpoint);

                                // get distance from me to hitpoint (nearest wall)
                                distance_to_hitpoint = vector_distance(my_origin, v_hitpoint);

                                // scale
                                if (ducking[spec_id]) {
                                    scaled_bone_len = distance_to_hitpoint / distance * (50.0-18.0);
                                } else {
                                    scaled_bone_len = distance_to_hitpoint / distance * 50.0;
                                }
                                scaled_bone_len = distance_to_hitpoint / distance * 50.0;
                                scaled_bone_width = distance_to_hitpoint / distance * 150.0;

                                // get the point 10.0 units away from wall
                                normalize(v_middle, offset_vector, distance_to_hitpoint - 10.0); // offset from wall

                                // set to eye level
                                copyVec(my_origin, eye_level);
                                
                                if (ducking[spec_id]) {
                                    eye_level[2] += 12.3
                                } else {
                                    eye_level[2] += 17.5
                                }

                                addVec(offset_vector, eye_level);

                                // start and end of green box
                                copyVec(offset_vector, v_bone_start);
                                copyVec(offset_vector, v_bone_end);
                                v_bone_end[2] -= scaled_bone_len;

                                distance_target_hitpoint = distance - distance_to_hitpoint;
                                actual_bright = 255;

                                if (mode[i]) { // Draw BOX?
                                    // this is to make green box darker if distance is larger
                                    if (distance_target_hitpoint < 2040.0) {
                                        actual_bright = (255 - floatround(distance_target_hitpoint / 12.0));
                                    } else {
                                        actual_bright = 85;
                                    }    
                                    if (distance_to_hitpoint != distance) { // if no line of sight
                                        color = 0;
                                    } else { // if line of sight
                                        color = target_team;
                                    }
                                    if (damage_done_to[spec_id] == s) {
                                        color = 3;
                                        damage_done_to[spec_id] = 0;
                                    }
                                    make_TE_BEAMPOINTS(i, color, v_bone_start, v_bone_end, floatround(scaled_bone_width), actual_bright);
                                }
                            }
                        }
                    }
                }
            } // inner player loop end
        }
    }
    set_task(get_pcvar_float(pcvar_esp_timer), "esp_timer"); // keep it going
    return PLUGIN_CONTINUE;
}

// Vector Operations -------------------------------------------------------------------------------

Float:getVecLen(Float:Vec[3]) {
    new Float:VecNull[3] = {0.0,0.0,0.0};
    new Float:len = vector_distance(Vec, VecNull);
    return len;
}

normalize(Float:Vec[3], Float:Ret[3], Float:multiplier) {
    new Float:len = getVecLen(Vec);
    copyVec(Vec, Ret);
    Ret[0] /= len;
    Ret[1] /= len;
    Ret[2] /= len;
    Ret[0] *= multiplier;
    Ret[1] *= multiplier;
    Ret[2] *= multiplier;
}

copyVec(Float:Vec[3], Float:Ret[3]) {
    Ret[0] = Vec[0];
    Ret[1] = Vec[1];
    Ret[2] = Vec[2];
}

subVec(Float:Vec1[3], Float:Vec2[3], Float:Ret[3]) {
    Ret[0] = Vec1[0] - Vec2[0];
    Ret[1] = Vec1[1] - Vec2[1];
    Ret[2] = Vec1[2] - Vec2[2];
}

addVec(Float:Vec1[3], Float:Vec2[3]) {
    Vec1[0] += Vec2[0];
    Vec1[1] += Vec2[1];
    Vec1[2] += Vec2[2];
}

// Temporary Entities ------------------------------------------------------------------------------
// there is a list of much more temp entities at: http://djeyl.net/forum/index.php?act=Attach&type=post&id=290870
// all messages are sent with MSG_ONE_UNRELIABLE flag to avoid overflow in case of very low esp_timer setting and much targets

make_TE_BEAMPOINTS(id,color, Float:Vec1[3], Float:Vec2[3], width, brightness) {
    message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0,0,0}, id); //message begin
    write_byte(0);
    write_coord(floatround(Vec1[0])); // start position
    write_coord(floatround(Vec1[1]));
    write_coord(floatround(Vec1[2]));
    write_coord(floatround(Vec2[0])); // end position
    write_coord(floatround(Vec2[1]));
    write_coord(floatround(Vec2[2]));
    write_short(laser); // sprite index
    write_byte(3); // starting frame
    write_byte(0); // frame rate in 0.1's
    write_byte(floatround(get_pcvar_float(pcvar_esp_timer) * 10)); // life in 0.1's
    write_byte(width); // line width in 0.1's
    write_byte(0); // noise amplitude in 0.01's
    write_byte(esp_colors[color][0]);
    write_byte(esp_colors[color][1]);
    write_byte(esp_colors[color][2]);
    write_byte(brightness); // brightness)
    write_byte(0); // scroll speed in 0.1's
    message_end();
}

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(floatround(get_pcvar_float(pcvar_esp_timer) * 10));
    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();
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/


!
Запрет на ответ в темах до: 10.11.29392, 21:09
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 2 раз
   + Цитировать сообщение
Статус пользователя Hnt
сообщение 11.12.2012, 7:45
Сообщение #4


Стаж: 18 лет

Сообщений: 810
Благодарностей: 198
Полезность: 494

Ребят помогите подправить - в 1.5 исходнике убрано меню и через команду esp_mode - включаются отдельно или Line или Box - можно что бы работали оба ?

Отредактировал: Hnt, - 11.12.2012, 9:16
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя fake8833
сообщение 11.12.2012, 8:51
Сообщение #5
Стаж: 14 лет

Сообщений: 80
Благодарностей: 16
Полезность: 158

Где-то читал что сервак зависал якобы от него, это правда?
Я себе тоже вх хочу)
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Hnt
сообщение 11.12.2012, 9:19
Сообщение #6


Стаж: 18 лет

Сообщений: 810
Благодарностей: 198
Полезность: 494

Цитата(fake8833 @ 11.12.2012, 10:51) *
Где-то читал что сервак зависал якобы от него, это правда?
Я себе тоже вх хочу)

Есть куча Билдов сервера ,плагинов , модов , разных Рук наконец ,плагин который не работает у 20 человек у тебя может замечательно жить.
ps.gif Апка ubeysya.gif
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
underwoker
сообщение 12.12.2012, 12:58
Сообщение #7
Стаж: 56 лет


Благодарностей:

Я не профешенл скриптер. Но мне кажется работать не будет.
Скрытый текст
Код
#include <amxmodx>
#include <fakemeta>

// 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_BAN

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

#define PLUGIN "Admin ESP"
#define VERSION "1.5b_mini"
#define AUTHOR "KoST"

#define OFFSET_TEAM            114

new const g_szPlugin[] = PLUGIN; // Global this since it is used throughout
new pcvar_esp, pcvar_esp_timer, pcvar_esp_allow_all, pcvar_esp_disable_default_keys;
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:admin[33];        // is/is not admin
new bool:first_person[33];    // is/is not in first person view
new bool:ducking[33];        // is/is not player ducked
new bool:mode[33];        // 0 = line, 1 = box
new bool:enabled[33];        // has esp on
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 damage_done_to[33];        // damage_done_to[p1]=p2 // p1 has hit p2
new view_target[33];        // attackers victim

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

public plugin_init() {
    register_plugin(g_szPlugin, VERSION, AUTHOR);
    server_print("^n^t%s v%s, Copyright (C) 2006 by %s^n", g_szPlugin, VERSION, AUTHOR);
    
    // cvars
    pcvar_esp = register_cvar("esp", "1");
    pcvar_esp_timer = register_cvar("esp_timer", "0.4");
    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_mode", "cmd_esp_mode", REQUIRED_ADMIN_LEVEL, "Toggle ESP type: line/box");    
    register_clcmd("say /esp_mode", "cmd_esp_mode", REQUIRED_ADMIN_LEVEL, "Toggle ESP type: line/box");
    register_clcmd("esp_toggle", "cmd_esp_toggle", REQUIRED_ADMIN_LEVEL, "Toggle ESP on/off");
    register_clcmd("say /esp_toggle", "cmd_esp_toggle", REQUIRED_ADMIN_LEVEL, "Toggle ESP on/off");
    
    // 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");
    
    register_forward(FM_PlayerPreThink, "fwdPlayerPreThink");
    max_players = get_maxplayers();
    // start esp_timer for the first time
    set_task(1.0, "esp_timer");
}

public client_putinserver(id) {
    first_person[id] = false;
    new args[1];
    args[0] = id;
    set_task(4.0, "delayed_putinserver", id + 100, args, 1);
}

public delayed_putinserver(args[0])
{
    new id = args[0];
    if (!is_user_connected(id))
    {
        return PLUGIN_HANDLED;
    }
    if ((get_user_flags(id) & REQUIRED_ADMIN_LEVEL) || get_pcvar_num(pcvar_esp_allow_all) == 1) {
        admin[id] = true;
        init_admin_options(id);
        } else {
        admin[id] = false;
    }
    return PLUGIN_CONTINUE;
}

public client_disconnect(id) {
    save2vault(id);
    admin[id] = false;
    spec[id] = 0;
    remove_task(id + 100);
}

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

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

public cmd_esp_mode(id)
{
    if (admin[id] && get_pcvar_num(pcvar_esp) == 1)
    {
        change_esp_mode(id, !mode[id]);
    }
}

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) {
    // discover if in first_person_view
    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) {
    mode[id] = false;
    enabled[id] = true;
    load_vault_data(id);
}

save2vault(id) {
    if (admin[id]) {
        new authid[35];
        get_user_authid (id,authid,34);
        new tmp[3];
        tmp[0] = (mode[id]) ? '1' : '0';
        tmp[1] = (enabled[id])  ? '1' : '0';
        
        //server_print("STEAMID: %s OPTIONS: %s", authid, tmp);
        new key[41];
        formatex(key, 40, "AESPmini_%s", authid);
        set_vaultdata(key, tmp);
    }
}

load_vault_data(id) {
    if (admin[id]) {
        new data[3];
        new authid[35];
        get_user_authid (id,authid,34);
        new key[41];
        formatex(key,40, "AESPmini_%s", authid);
        get_vaultdata(key,data,2);
        if (strlen(data) > 0) {
            mode[id] = (data[0]=='1');
            enabled[id] = (data[1]=='1');
        }
    }
}

change_esp_status(id, bool:on) {
    if (on) {
        enabled[id] = true;
        client_print(id, print_chat, "[%s] ON", g_szPlugin);
        } else {
        enabled[id] = false;
        client_print(id, print_chat, "[%s] OFF", g_szPlugin);
    }
}

change_esp_mode(id, bool:on)
{
    if (on)
    {
        mode[id] = 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; // saves a lot of cpu
    
    static oldbutton;
    oldbutton = pev(id, pev_oldbuttons);
    
    if (button & IN_DUCK) {
        ducking[id] = true;
        } else {
        ducking[id] = false;
    }
    
    if ((get_pcvar_num(pcvar_esp) == 1) && (get_pcvar_num(pcvar_esp_disable_default_keys) != 1)) {
        if (admin[id]) {
            if (first_person[id] && !is_user_alive(id)) {
                if ((button & IN_RELOAD) && !(oldbutton & IN_RELOAD)) {
                    cmd_esp_mode(id);
                }
                if ((button & IN_FORWARD)  && !(oldbutton & IN_FORWARD) && !enabled[id]) {
                    change_esp_status(id, true);
                }
                if ((button & IN_BACK)  && !(oldbutton & IN_BACK) && enabled[id]) {
                    change_esp_status(id, false);
                }
            }
        }
    }
    return FMRES_HANDLED;
}

public esp_timer() {
    
    if (get_pcvar_num(pcvar_esp) != 1) { // if esp is not 1, it is off
        set_task(1.0, "esp_timer"); // check for reactivation in 1 sec intervals
        return PLUGIN_CONTINUE;
    }
    
    static spec_id, Float:my_origin[3], my_team, s,
    target_team, Float:target_origin[3], Float:distance, width, Float:v_middle[3], Float:v_hitpoint[3],
    Float:distance_to_hitpoint, Float:scaled_bone_len, Float:scaled_bone_width, Float:v_bone_start[3],
    Float:v_bone_end[3], Float:offset_vector[3], Float:eye_level[3], Float:distance_target_hitpoint,
    actual_bright, color
    
    for (new i = 1; i <= max_players; i++) { // loop through players
        
        if (enabled[i] && 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); // get origin of spectating admin
            // get team of spectated :)
            my_team = get_pdata_int(spec_id, OFFSET_TEAM);
            
            for (s = 1; s <= max_players; s++) { // loop through the targets
                if (is_user_alive(s)) { // target must be alive
                    // get team of target
                    target_team = get_pdata_int(s, OFFSET_TEAM);
                    if (!(target_team == 3)) { //if not spectator
                        if (spec_id != s) { // do not target myself
                            // if the target is in the other team and not spectator
                            
                            if (((my_team != target_team && (target_team == 1 || target_team == 2)) )) {
                                // get origin of target
                                pev(s, pev_origin, target_origin);
                                
                                
                                // get distance from me to target
                                distance = vector_distance(my_origin, target_origin);
                                
                                if (!mode[i]) { // Draw LINE?
                                    // calculate width according to distance
                                    width = (distance < 2040.0) ? ( (255 - floatround(distance / 8.0) ) / 3 ) : 1;
                                    
                                    // create temp_ent
                                    make_TE_BEAMENTPOINT(i, target_origin, width, target_team);
                                }
                                
                                // get vector from me to target
                                subVec(target_origin, my_origin, v_middle);
                                
                                // trace from me to target, getting hitpoint
                                engfunc(EngFunc_TraceLine, my_origin, target_origin, 1, -1, 0);
                                get_tr2(0, TR_vecEndPos, v_hitpoint);
                                
                                // get distance from me to hitpoint (nearest wall)
                                distance_to_hitpoint = vector_distance(my_origin, v_hitpoint);
                                
                                // scale
                                if (ducking[spec_id]) {
                                    scaled_bone_len = distance_to_hitpoint / distance * (50.0-18.0);
                                    } else {
                                    scaled_bone_len = distance_to_hitpoint / distance * 50.0;
                                }
                                scaled_bone_len = distance_to_hitpoint / distance * 50.0;
                                scaled_bone_width = distance_to_hitpoint / distance * 150.0;
                                
                                // get the point 10.0 units away from wall
                                normalize(v_middle, offset_vector, distance_to_hitpoint - 10.0); // offset from wall
                                
                                // set to eye level
                                copyVec(my_origin, eye_level);
                                
                                if (ducking[spec_id]) {
                                    eye_level[2] += 12.3
                                    } else {
                                    eye_level[2] += 17.5
                                }
                                
                                addVec(offset_vector, eye_level);
                                
                                // start and end of green box
                                copyVec(offset_vector, v_bone_start);
                                copyVec(offset_vector, v_bone_end);
                                v_bone_end[2] -= scaled_bone_len;
                                
                                distance_target_hitpoint = distance - distance_to_hitpoint;
                                actual_bright = 255;
                                
                                if (mode[i]) { // Draw BOX?
                                    // this is to make green box darker if distance is larger
                                    if (distance_target_hitpoint < 2040.0) {
                                        actual_bright = (255 - floatround(distance_target_hitpoint / 12.0));
                                        } else {
                                        actual_bright = 85;
                                    }    
                                    if (distance_to_hitpoint != distance) { // if no line of sight
                                        color = 0;
                                        } else { // if line of sight
                                        color = target_team;
                                    }
                                    if (damage_done_to[spec_id] == s) {
                                        color = 3;
                                        damage_done_to[spec_id] = 0;
                                    }
                                    make_TE_BEAMPOINTS(i, color, v_bone_start, v_bone_end, floatround(scaled_bone_width), actual_bright);
                                }
                            }
                        }
                    }
                }
            } // inner player loop end
        }
    }
    set_task(get_pcvar_float(pcvar_esp_timer), "esp_timer"); // keep it going
    return PLUGIN_CONTINUE;
}

// Vector Operations -------------------------------------------------------------------------------

Float:getVecLen(Float:Vec[3]) {
    new Float:VecNull[3] = {0.0,0.0,0.0};
    new Float:len = vector_distance(Vec, VecNull);
    return len;
}

normalize(Float:Vec[3], Float:Ret[3], Float:multiplier) {
    new Float:len = getVecLen(Vec);
    copyVec(Vec, Ret);
    Ret[0] /= len;
    Ret[1] /= len;
    Ret[2] /= len;
    Ret[0] *= multiplier;
    Ret[1] *= multiplier;
    Ret[2] *= multiplier;
}

copyVec(Float:Vec[3], Float:Ret[3]) {
    Ret[0] = Vec[0];
    Ret[1] = Vec[1];
    Ret[2] = Vec[2];
}

subVec(Float:Vec1[3], Float:Vec2[3], Float:Ret[3]) {
    Ret[0] = Vec1[0] - Vec2[0];
    Ret[1] = Vec1[1] - Vec2[1];
    Ret[2] = Vec1[2] - Vec2[2];
}

addVec(Float:Vec1[3], Float:Vec2[3]) {
    Vec1[0] += Vec2[0];
    Vec1[1] += Vec2[1];
    Vec1[2] += Vec2[2];
}

// Temporary Entities ------------------------------------------------------------------------------
// there is a list of much more temp entities at: http://djeyl.net/forum/index.php?act=Attach&type=post&id=290870
// all messages are sent with MSG_ONE_UNRELIABLE flag to avoid overflow in case of very low esp_timer setting and much targets

make_TE_BEAMPOINTS(id,color, Float:Vec1[3], Float:Vec2[3], width, brightness) {
    message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0,0,0}, id); //message begin
    write_byte(0);
    write_coord(floatround(Vec1[0])); // start position
    write_coord(floatround(Vec1[1]));
    write_coord(floatround(Vec1[2]));
    write_coord(floatround(Vec2[0])); // end position
    write_coord(floatround(Vec2[1]));
    write_coord(floatround(Vec2[2]));
    write_short(laser); // sprite index
    write_byte(3); // starting frame
    write_byte(0); // frame rate in 0.1's
    write_byte(floatround(get_pcvar_float(pcvar_esp_timer) * 10)); // life in 0.1's
    write_byte(width); // line width in 0.1's
    write_byte(0); // noise amplitude in 0.01's
    write_byte(esp_colors[color][0]);
    write_byte(esp_colors[color][1]);
    write_byte(esp_colors[color][2]);
    write_byte(brightness); // brightness)
    write_byte(0); // scroll speed in 0.1's
    message_end();
}

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(floatround(get_pcvar_float(pcvar_esp_timer) * 10));
    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();
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Перейти в начало страницы     
Поблагодарили 2 раз
   +
Статус пользователя Hnt
сообщение 12.12.2012, 14:26
Сообщение #8


Стаж: 18 лет

Сообщений: 810
Благодарностей: 198
Полезность: 494

Да ничего не изменилось ,только теперь в line не вернуться обратно ,только box pardon.gif
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя imba
сообщение 12.12.2012, 14:37
Сообщение #9
Стаж: 16 лет

Сообщений: 1677
Благодарностей: 735
Полезность: 571

+
Код
#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 esp_colors[5][3]={{0,255,0},{100,60,60},{60,60,100},{255,0,255},{128,128,128}}
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_KICK, "Shows ESP Menu")
    register_clcmd("esp_toggle", "cmd_esp_toggle", ADMIN_KICK, "Toggle ESP on/off")
    register_clcmd("esp_setting", "cmd_esp_settings", ADMIN_KICK, "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_KICK)
    {
        admin[id]=true
        init_admin_options(id)
    }
    else
        admin[id]=false
}

public client_disconnect(id)
{
    save2vault(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)
    }
}

public cmd_esp_toggle(id)
{
    if (admin[id])
    {
        change_esp_status(id, !admin_options[id][0])
    }
}

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 Specator ESP^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
    }
    load_vault_data(id)
}

save2vault(id)
{
    if (admin[id])
    {
        new authid[35], tmp[11], key[41]
        get_user_authid(id, authid, charsmax(authid))
    
        for (new s=0;s<4;s++)
        {
            if (admin_options[id][s])
                tmp[s]='1'
            else
                tmp[s]='0'
        }
        tmp[4]=0

        formatex(key, charsmax(key), "ESP_%s", authid)
        set_vaultdata(key, tmp)
    }
}

load_vault_data(id)
{
    if (admin[id])
    {
        new data[11], authid[35], key[41]
        get_user_authid (id, authid, charsmax(authid))
        formatex(key, 40, "ESP_%s", authid)
        get_vaultdata(key, data, 4)
        if (strlen(data) > 0)
        {
            for (new s=0;s<4;s++)
            {
                if (data[s]=='1')
                    admin_options[id][s]=true
                else
                    admin_options[id][s]=false
            }
        }
    }
}

change_esp_status(id, bool:on)
{
    if (on)
    {
        admin_options[id][0] = true
        if (!is_in_menu[id]) client_print(id, print_chat, "[%s] ON", PLUGIN)
        if (is_in_menu[id]) show_esp_menu(id)
    }
    else
    {
        admin_options[id][0] = false
        if (!is_in_menu[id]) client_print(id, print_chat, "[%s] OFF", PLUGIN)
        if (is_in_menu[id]) show_esp_menu(id)
    }
}

public fwdPlayerPreThink(id)
{
    if (!is_user_connected(id)) return FMRES_IGNORED
    
    static button, oldbutton
    button=pev(id, pev_button)
    if (button==0) return FMRES_IGNORED

    oldbutton=pev(id, pev_oldbuttons)
    
    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))
            {
                if ((button & IN_FORWARD) && !(oldbutton & IN_FORWARD) && !admin_options[id][0])
                {
                    change_esp_status(id, true)
                }
                if ((button & IN_BACK) && !(oldbutton & IN_BACK) && admin_options[id][0])
                {
                    change_esp_status(id, false)
                }
            }
        }
    }
    return FMRES_HANDLED
}

public esp_timer()
{
    static spec_id, Float:my_origin[3], my_team, target_team, Float:target_origin[3], Float:distance, width, Float:v_middle[3],
    Float:v_hitpoint[3], Float:distance_to_hitpoint, Float:scaled_bone_len, Float:scaled_bone_width, Float:v_bone_start[3],
    Float:v_bone_end[3], Float:offset_vector[3], Float:eye_level[3], Float:distance_target_hitpoint, actual_bright, color

    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)
                                }

                                subVec(target_origin,my_origin,v_middle)

                                engfunc(EngFunc_TraceLine, my_origin, target_origin, 1, -1, 0)
                                get_tr2(0, TR_vecEndPos, v_hitpoint)

                                distance_to_hitpoint = vector_distance(my_origin, v_hitpoint)

                                if (ducking[spec_id])
                                    scaled_bone_len=distance_to_hitpoint/distance*(50.0-18.0)
                                else
                                    scaled_bone_len=distance_to_hitpoint/distance*50.0

                                scaled_bone_len=distance_to_hitpoint/distance*50.0
                                scaled_bone_width=distance_to_hitpoint/distance*150.0
                                normalize(v_middle,offset_vector,distance_to_hitpoint-10.0)

                                copyVec(my_origin,eye_level)
                                
                                if (ducking[spec_id])
                                    eye_level[2]+=12.3
                                else
                                    eye_level[2]+=17.5

                                addVec(offset_vector,eye_level)

                                copyVec(offset_vector,v_bone_start)
                                copyVec(offset_vector,v_bone_end)
                                v_bone_end[2]-=scaled_bone_len
                                
                                distance_target_hitpoint=distance-distance_to_hitpoint
                                actual_bright=255
                                
                                if (admin_options[i][ESP_BOX])
                                {
                                    if (distance_target_hitpoint<2040.0)
                                        actual_bright=(255-floatround(distance_target_hitpoint/12.0))
                                    else
                                        actual_bright=85

                                    if (distance_to_hitpoint!=distance)
                                        color=0
                                    else
                                        color=target_team

                                    if (damage_done_to[spec_id]==s)
                                    {
                                        color=3
                                        damage_done_to[spec_id]=0
                                    }
                                    make_TE_BEAMPOINTS(i,color,v_bone_start,v_bone_end,floatround(scaled_bone_width),actual_bright)
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    set_task(0.3, "esp_timer")
    return PLUGIN_CONTINUE    
}

Float:getVecLen(Float:Vec[3])
{
    new Float:VecNull[3]={0.0,0.0,0.0}
    new Float:len=vector_distance(Vec,VecNull)
    return len
}

normalize(Float:Vec[3],Float:Ret[3],Float:multiplier)
{
    new Float:len=getVecLen(Vec)
    copyVec(Vec,Ret)
    Ret[0]/=len
    Ret[1]/=len
    Ret[2]/=len
    Ret[0]*=multiplier
    Ret[1]*=multiplier
    Ret[2]*=multiplier
}

copyVec(Float:Vec[3],Float:Ret[3])
{
    Ret[0]=Vec[0]
    Ret[1]=Vec[1]
    Ret[2]=Vec[2]
}

subVec(Float:Vec1[3],Float:Vec2[3],Float:Ret[3])
{
    Ret[0]=Vec1[0]-Vec2[0]
    Ret[1]=Vec1[1]-Vec2[1]
    Ret[2]=Vec1[2]-Vec2[2]
}

addVec(Float:Vec1[3],Float:Vec2[3])
{
    Vec1[0]+=Vec2[0]
    Vec1[1]+=Vec2[1]
    Vec1[2]+=Vec2[2]
}

make_TE_BEAMPOINTS(id,color,Float:Vec1[3],Float:Vec2[3],width,brightness)
{
    message_begin(MSG_ONE_UNRELIABLE ,SVC_TEMPENTITY,{0,0,0},id)
    write_byte(0)
    write_coord(floatround(Vec1[0]))
    write_coord(floatround(Vec1[1]))
    write_coord(floatround(Vec1[2]))
    write_coord(floatround(Vec2[0]))
    write_coord(floatround(Vec2[1]))
    write_coord(floatround(Vec2[2]))
    write_short(laser)
    write_byte(3)
    write_byte(0)
    write_byte(3)
    write_byte(width)
    write_byte(0)
    write_byte(esp_colors[color][0])
    write_byte(esp_colors[color][1])
    write_byte(esp_colors[color][2])
    write_byte(brightness)
    write_byte(0)
    message_end()
}

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()
}

инеблагодари


!
Запрет на ответ в темах до: 10.11.29392, 21:09
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
  Тема закрытаНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: