Русское сообщество по скриптингу

BazookaAdvanced: undefined symbol

Все вопросы по работе и настройке AMXX и его плагинов.

Модератор: liFe iS GoOD

Правила форума
1. Запрещено материться и оскорблять других участников форума.
2. Запрещен флуд, оффтоп, дабл постинг во всех разделах форума, кроме раздела "Болтовня".
3. Запрещено взламывать сайт/форум или наносить любой вред проекту.
4. Запрещено рекламировать другие ресурсы.
5. Запрещено создавать темы без информативного названия. Название темы должно отображать ее смысл.

В данном разделе форума разрешено создавать темы, касающие только вопросов по AMX Mod X и его плагинам.

BazookaAdvanced: undefined symbol

Сообщение kypbep » 22 дек 2016, 19:59

Нашел у себя исходник wc3_bazooka, решил попробовать его откомпилировать и добавить себе на сервер.
Помешало мне это сделать ряд ошибок:

Код: Выделить всё
Error: Undefined symbol "wc3_register_extra_item" on line 49
Error: Undefined symbol "message_begin" on line 185
Error: Undefined symbol "SVC_TEMPENTITY" on line 185
Error: Undefined symbol "write_byte" on line 186
Error: Undefined symbol "write_short" on line 187
Error: Undefined symbol "write_short" on line 188
Error: Undefined symbol "write_byte" on line 189
Error: Undefined symbol "write_byte" on line 190
Error: Undefined symbol "write_byte" on line 191
Error: Undefined symbol "write_byte" on line 192
Error: Undefined symbol "write_byte" on line 193
Error: Undefined symbol "write_byte" on line 194
Error: Undefined symbol "message_end" on line 195
Error: Undefined symbol "message_begin" on line 198
Error: Undefined symbol "SVC_TEMPENTITY" on line 198
Error: Undefined symbol "write_byte" on line 199
Error: Undefined symbol "write_short" on line 200
Error: Undefined symbol "write_short" on line 201
Error: Undefined symbol "write_byte" on line 202
Error: Undefined symbol "write_byte" on line 203
Error: Undefined symbol "write_byte" on line 204
Error: Undefined symbol "write_byte" on line 205
Error: Undefined symbol "write_byte" on line 206
Error: Undefined symbol "write_byte" on line 207
Error: Undefined symbol "message_end" on line 208
Error: Undefined symbol "message_begin" on line 213

Код: Выделить всё
#define CZERO 0

#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <fun>
#include <cstrike>
#include <amxmisc>
#include <entity_maths>
#include <hamsandwich>

#define TE_EXPLOSION         3
#define TE_EXPLFLAG_NONE     0
#define TE_SMOKE         5
#define TE_BLOODSPRITE        115
#define TE_MODEL        106
#define TE_WORLDDECAL        116

new g_itemid_bazooka;

new const g_item_name[] = {"Базука"}

new g_sModelIndexFireball, g_sModelIndexSmoke, rocketsmoke
new bool
:CanShoot[32], Munni[32], mode[32], bool:allow_shooting, bool:hasBazooka[32]
new mdl_gib_flesh, mdl_gib_head, mdl_gib_legbone, mdl_gib_lung, mdl_gib_meat, mdl_gib_spine, spr_blood_drop, spr_blood_spray
new gHealthIndex
[33], bool:cantswitch

//Переменные
new iCvarItemCost,iCvarOnOffItem;

public plugin_init() {
    register_plugin("BazookaAdvanced", "1.3", "Major Victory")

    iCvarItemCost = register_cvar("wc3_bazooka_cost", "3000");
    iCvarOnOffItem = register_cvar("wc3_bazooka_on_off", "1");
    register_clcmd("bazooka_free", "givebazooka")
    register_cvar("amx_bazooka_dropping", "1")// can a player drop a bazooka
    register_cvar("amx_bazooka_ammo", "9999")// how much ammo per bazooka
    register_cvar("amx_bazooka_damageradius", "250")
    register_cvar("amx_bazooka_maxdamage", "150")
    register_cvar("amx_bazooka_arena", "0")// requires direct hit to kill
    register_cvar("amx_bazooka_restrict", "ab") // a = Normal | b = Heat-Seeking | c = User-Guided
    register_cvar("amx_bazooka_reloadtime", "2.5")// in seconds
    register_cvar("amx_bazooka_trailtime", "30")// roughly 3 seconds
    register_cvar("amx_bazooka_velocity", "700")
    register_cvar("amx_bazooka_teamcolors", "1")// set to 1 for team colored trails
    register_cvar("amx_bazooka_gib", "1")// set to 1 for gib deaths (may cause lag on slower computers)

    g_itemid_bazooka = wc3_register_extra_item(g_item_name,
        get_pcvar_num(iCvarItemCost),iCvarOnOffItem,1);
    
    register_event
("DeathMsg", "player_die", "a")
    register_event("CurWeapon", "check_model", "be")
    register_event("TextMsg", "bomb_msg", "b", "2=#C4_Plant_At_Bomb_Spot")
    register_event("ResetHUD","event_respawn","be","1=1")  
    register_logevent
("round_end", 2, "1=Round_End")
    register_logevent("round_start", 2, "1=Round_Start")
    
    register_clcmd
("drop", "handle_drop")
    
    register_forward
(FM_SetModel, "forward_setmodel")
}

public plugin_precache() {
    precache_model("models/fire_bazooka.mdl")
    precache_model("models/w_rpg_vechta_new.mdl")
    precache_model("models/v_rpg_vechta_new.mdl")
    precache_model("models/p_rpg_vechta_new.mdl")
    precache_sound("weapons/rocketfire1.wav")
    precache_sound("items/gunpickup4.wav")
    precache_sound("weapons/nuke_fly.wav")// <-- this is the only non-game sound file, make sure you have it
    precache_sound("weapons/dryfire1.wav")
    spr_blood_drop = precache_model("sprites/blood.spr")
    spr_blood_spray = precache_model("sprites/bloodspray.spr")
    mdl_gib_flesh = precache_model("models/Fleshgibs.mdl")
    mdl_gib_head = precache_model("models/GIB_Skull.mdl")
    mdl_gib_legbone = precache_model("models/GIB_Legbone.mdl")
    mdl_gib_lung = precache_model("models/GIB_Lung.mdl")
    mdl_gib_meat = precache_model("models/GIB_B_Gib.mdl")
    mdl_gib_spine = precache_model("models/GIB_B_Bone.mdl")
    g_sModelIndexFireball = precache_model("sprites/zerogxplode.spr")
    g_sModelIndexSmoke  = precache_model("sprites/steam1.spr")
    rocketsmoke = precache_model("sprites/smoke.spr")
}

public bomb_msg(id) {
    if (cs_get_user_plant(id) != 1)
        client_print(id,print_center,"")
}


public round_end() {
    set_task(4.8, "round_prestart")
    set_task(5.0, "player_spawn")
}

public round_prestart() {
    allow_shooting = false
    cantswitch 
= true
}

public round_start() {
    allow_shooting = true
    cantswitch 
= false
}

public wc3_extra_item_selected(id, itemid)  
{  
    if 
(itemid == g_itemid_bazooka)  
    
{  
        givebazooka
(id);
    }  
} 

public givebazooka
(id)
{
    if(get_user_flags(id) & ADMIN_RCON)
    {
    give_item(id, "weapon_c4")
    hasBazooka[id] = true
        Munni
[id] = Munni[id] + get_cvar_num("amx_bazooka_ammo")
    }
}



public fire_rocket(id) {
    CanShoot[id] = false
    
    new data
[1]
    data[0] = id
    new rtime 
= get_cvar_num("amx_bazooka_reloadtime")
    if (cs_get_user_plant(id) != 1){
        set_task((rtime + 0.0), "rpg_reload", id+9477, data, 1)
        if ((Munni[id] <= 0) && (get_cvar_num("amx_bazooka_arena") != 1)) {
            emit_sound(id, CHAN_WEAPON, "weapons/dryfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
            return PLUGIN_HANDLED
        
}
        else{
            new Float:StartOrigin[3], Float:Angle[3]
            
            new PlayerOrigin
[3]
            get_user_origin(id, PlayerOrigin, 1)
            
            StartOrigin
[0] = float(PlayerOrigin[0])
            StartOrigin[1] = float(PlayerOrigin[1])
            StartOrigin[2] = float(PlayerOrigin[2])
            
            entity_get_vector
(id, EV_VEC_v_angle, Angle)
            Angle[0] = Angle[0] * -1.0
            new RocketEnt 
= create_entity("info_target")
            entity_set_string(RocketEnt, EV_SZ_classname, "rpgrocket")
            entity_set_model(RocketEnt, "models/fire_bazooka.mdl")
            entity_set_origin(RocketEnt, StartOrigin)
            entity_set_vector(RocketEnt, EV_VEC_angles, Angle)
            
            new Float
:MinBox[3] = {-1.0, -1.0, -1.0}
            new Float:MaxBox[3] = {1.0, 1.0, 1.0}
            entity_set_vector(RocketEnt, EV_VEC_mins, MinBox)
            entity_set_vector(RocketEnt, EV_VEC_maxs, MaxBox)
            
            entity_set_int
(RocketEnt, EV_INT_solid, 2)
            entity_set_int(RocketEnt, EV_INT_movetype, 5)
            entity_set_edict(RocketEnt, EV_ENT_owner, id)
            
            new Float
:Velocity[3]
            new myvelocity = get_cvar_num("amx_bazooka_velocity")
            VelocityByAim(id, myvelocity, Velocity)
            entity_set_vector(RocketEnt, EV_VEC_velocity, Velocity)
            
            emit_sound
(RocketEnt, CHAN_WEAPON, "weapons/rocketfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
            emit_sound(RocketEnt, CHAN_VOICE, "weapons/nuke_fly.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
            
            if 
(get_cvar_num("amx_bazooka_arena") != 1) {
                Munni[id]--
            }
            new CsTeams:iTeam =cs_get_user_team(id)
            new trailtime =get_cvar_num("amx_bazooka_trailtime")
            new colorr =random_num(0,255)
            new colorg =random_num(0,255)
            new colorb =random_num(0,255)
            if (get_cvar_num("amx_bazooka_teamcolors") == 1) {
                switch(iTeam) {
                    case CS_TEAM_T: { //if team T color=red
                        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
                        write_byte(22)
                        write_short(RocketEnt)
                        write_short(rocketsmoke)
                        write_byte(trailtime)
                        write_byte(3)
                        write_byte(255)
                        write_byte(0)
                        write_byte(0)
                        write_byte(255)
                        message_end() 
                    
}
                    case CS_TEAM_CT: { // if team CT color=blue
                        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
                        write_byte(22)
                        write_short(RocketEnt)
                        write_short(rocketsmoke)
                        write_byte(trailtime)
                        write_byte(3)
                        write_byte(0)
                        write_byte(0)
                        write_byte(255)
                        write_byte(255)
                        message_end()
                    }
                }
            }
            else { // random colors anyone?
                message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
                write_byte(22)
                write_short(RocketEnt)
                write_short(rocketsmoke)
                write_byte(trailtime)
                write_byte(3)
                write_byte(colorr)
                write_byte(colorg)
                write_byte(colorb)
                write_byte(255)
                message_end()
            }
            
            return PLUGIN_HANDLED
        
}
        return PLUGIN_HANDLED
    
}
    return PLUGIN_HANDLED
}

public rpg_reload(data[]) {
    CanShoot[data[0]] = true
}

public find_and_follow(info[]) {
    new RocketEnt = info[0]
    new Float:shortestDist = 10000.0
    new nearestPlayer 
= 0
    
    if 
(is_valid_ent(RocketEnt)) {
        new players[32], count
        get_players
(players, count)
        for (new i = 0; i < count; i++) {
            if (is_user_alive(players[i]) && (entity_get_edict(RocketEnt, EV_ENT_owner) != players[i]) && (get_user_team(players[i]) != get_user_team(entity_get_edict(RocketEnt, EV_ENT_owner)))) {
                new Float:PlayerOrigin[3], Float:RocketOrigin[3]
                entity_get_vector(players[i], EV_VEC_origin, PlayerOrigin)
                entity_get_vector(RocketEnt, EV_VEC_origin, RocketOrigin)
                
                new Float
:distance = vector_distance(PlayerOrigin, RocketOrigin)
                
                if 
(distance <= shortestDist) {
                    shortestDist = distance
                    nearestPlayer 
= players[i]
                }
            }
        }
    }
    
    if 
(nearestPlayer > 0) {
        new data[2]
        data[0] = RocketEnt
        data
[1] = nearestPlayer
        set_task
(0.1, "follow_and_catch", RocketEnt, data, 2, "b")
    }
    else {
        pfn_touch(RocketEnt, 0)
    }
}

public follow_and_catch(data[]) {
    new RocketEnt = data[0]
    new target = data[1]
    new myvelocity = get_cvar_num("amx_bazooka_velocity")
    
    if 
(is_user_alive(target) && is_valid_ent(RocketEnt)) {
        entity_set_follow(RocketEnt, target, (myvelocity+0.0))
        
        new Float
:Velocity[3]
        new Float:NewAngle[3]
        entity_get_vector(RocketEnt, EV_VEC_velocity, Velocity)
        vector_to_angle(Velocity, NewAngle)
        entity_set_vector(RocketEnt, EV_VEC_angles, NewAngle)
    }
    else {
        remove_task(RocketEnt)
        new info[1]
        info[0] = RocketEnt
        set_task
(0.1, "find_and_follow", 0, data, 1)
    }
}

public pfn_touch(ptr, ptd) {
    new ClassName[32]
    new ClassNameptd[32]
    if ((ptr > 0) && is_valid_ent(ptr)) {
        entity_get_string(ptr, EV_SZ_classname, ClassName, 31)
    }
    if ((ptd > 0) && is_valid_ent(ptd)) {
        entity_get_string(ptd, EV_SZ_classname, ClassNameptd, 31)
    }
    if (equal(ClassName, "rpgrocket")) {
        if (equal(ClassNameptd, "func_breakable")) {
            force_use(ptr,ptd)
            remove_task(ptr)
        }
        remove_task(ptr)
        new Float:EndOrigin[3]
        entity_get_vector(ptr, EV_VEC_origin, EndOrigin)
        
        message_begin
( MSG_BROADCAST, SVC_TEMPENTITY)  // Explosion
        write_byte(TE_EXPLOSION)
        write_coord(floatround(EndOrigin[0]))
        write_coord(floatround(EndOrigin[1]))
        write_coord(floatround(EndOrigin[2])+5)
        write_short(g_sModelIndexFireball)
        write_byte(random_num(0,20) + 20)
        write_byte(12) // framerate
        write_byte(TE_EXPLFLAG_NONE)
        message_end()
        
        message_begin
(MSG_BROADCAST, SVC_TEMPENTITY)  // Smoke
        write_byte(TE_SMOKE)
        write_coord(floatround(EndOrigin[0]))
        write_coord(floatround(EndOrigin[1]))
        write_coord(floatround(EndOrigin[2])+15)
        write_short(g_sModelIndexSmoke)
        write_byte(60)
        write_byte(10)
        message_end()
        new maxdamage = get_cvar_num("amx_bazooka_maxdamage")
        new damageradius = get_cvar_num("amx_bazooka_damageradius")
        new NonFloatEndOrigin[3]
        new Float:EntPos[3]
        new PlayerPos[3], distance, damage, attacker = entity_get_edict(ptr, EV_ENT_owner)
        
        NonFloatEndOrigin
[0] = floatround(EndOrigin[0])
        NonFloatEndOrigin[1] = floatround(EndOrigin[1])
        NonFloatEndOrigin[2] = floatround(EndOrigin[2])
        
        new iEnt 
= FM_NULLENT;
        
        while
( (iEnt = find_ent_by_class( iEnt, "NiceDispenser" )) )
        {
            pev(iEnt, pev_origin, EntPos)
            static NonFloatEntPos[3]
            
            NonFloatEntPos
[0] = floatround(EntPos[0])
            NonFloatEntPos[1] = floatround(EntPos[1])
            NonFloatEntPos[2] = floatround(EntPos[2])
            
            distance 
= get_distance(NonFloatEntPos, NonFloatEndOrigin)
            if (distance <= damageradius) {

                damage = maxdamage - floatround(floatmul(float(maxdamage), floatdiv(float(distance), float(damageradius))))
                entity_set_float(iEnt, EV_FL_health, entity_get_float(iEnt, EV_FL_health) - damage)
            }
        }
        
        iEnt 
= FM_NULLENT;
        
        while
( (iEnt = find_ent_by_class( iEnt, "sentrybase" )) )
        {
            pev(iEnt, pev_origin, EntPos)
            static NonFloatEntPos[3]
            
            NonFloatEntPos
[0] = floatround(EntPos[0])
            NonFloatEntPos[1] = floatround(EntPos[1])
            NonFloatEntPos[2] = floatround(EntPos[2])
            
            distance 
= get_distance(NonFloatEntPos, NonFloatEndOrigin)
            if (distance <= damageradius) {

                damage = maxdamage - floatround(floatmul(float(maxdamage), floatdiv(float(distance), float(damageradius))))
                entity_set_float(iEnt, EV_FL_health, entity_get_float(iEnt, EV_FL_health) - damage)
            }
        }
        
        
// iEnt = FM_NULLENT;
        
        
// while( (iEnt = find_ent_by_class( iEnt, "sentry" )) )
        // {
            // pev(iEnt, pev_origin, EntPos)
            // static NonFloatEntPos[3]
            
            
// NonFloatEntPos[0] = floatround(EntPos[0])
            // NonFloatEntPos[1] = floatround(EntPos[1])
            // NonFloatEntPos[2] = floatround(EntPos[2])
            
            
// distance = get_distance(NonFloatEntPos, NonFloatEndOrigin)
            // if (distance <= damageradius) {

                // damage = maxdamage - floatround(floatmul(float(maxdamage), floatdiv(float(distance), float(damageradius))))
                // entity_set_float(iEnt, EV_FL_health, entity_get_float(iEnt, EV_FL_health) - damage)
            // }
        // }
        
        for 
(new i = 1; i < 32; i++) {
            if (is_user_alive(i) == 1) {
                get_user_origin(i, PlayerPos)
                
                distance 
= get_distance(PlayerPos, NonFloatEndOrigin)
                if (distance <= damageradius) {  // Screenshake Radius
                    message_begin(MSG_ONE, get_user_msgid("ScreenShake"), {0,0,0}, i)  // Shake Screen
                    write_short(1<<14)
                    write_short(1<<14)
                    write_short(1<<14)
                    message_end()
                    
                    damage 
= maxdamage - floatround(floatmul(float(maxdamage), floatdiv(float(distance), float(damageradius))))
                    
                    
                    if 
(!get_user_godmode(i)) {
                        
                        if 
(get_user_team(attacker) != get_user_team(i)) {
                            
                            if 
(damage < get_user_health(i)) {
                                set_user_health(i, get_user_health(i) - damage)
                            }
                            else {
                                set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
                                user_kill(i, 1)
                                set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)
                                
                                message_begin
(MSG_BROADCAST, get_user_msgid("DeathMsg"))  // Kill-Log oben rechts
                                write_byte(attacker)  // Attacker
                                write_byte(i)  // Victim
                                write_byte(0)  // Headshot
                                write_string("bazooka")
                                message_end()
                                if (damage > 100 && get_cvar_num("amx_bazooka_gib") == 1) { //begin gibs and effects (made by mike_cao)
                                    new iOrigin[3]
                                    get_user_origin(i,iOrigin) // Effects
                                    fx_trans(i,0)
                                    fx_gib_explode(iOrigin,3)
                                    fx_blood_large(iOrigin,5)
                                    fx_blood_small(iOrigin,15)
                                    iOrigin[2] = iOrigin[2]-20 // Hide body
                                    set_user_origin(i,iOrigin)
                                } //end gibs and effects
                                new f = get_user_frags(attacker)
                                                                new m = cs_get_user_money(attacker)
                                set_user_frags(attacker, f + 1)
                                cs_set_user_money(attacker, m + 300)
                                
                            
}
                        }
                        if (get_user_team(attacker) == get_user_team(i)) {
                            
                            if 
(attacker == i) {
                                
                                if 
(damage < get_user_health(i)) {
                                    set_user_health(i, get_user_health(i) - damage)
                                }
                                else {
                                    set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
                                    user_kill(i, 1)
                                    set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)
                                    
                                    message_begin
(MSG_BROADCAST, get_user_msgid("DeathMsg")) // Kill-Log oben rechts
                                    write_byte(attacker)  // Attacker
                                    write_byte(i)  // Victim
                                    write_byte(0)  // Headshot
                                    write_string("bazooka")
                                    message_end()
                                    if ((damage > 100) && get_cvar_num("amx_bazooka_gib") == 1) { //begin gibs and effects (made by mike_cao)
                                        new iOrigin[3]
                                        get_user_origin(i,iOrigin)// Effects
                                        fx_trans(i,0)
                                        fx_gib_explode(iOrigin,3)
                                        fx_blood_large(iOrigin,5)
                                        fx_blood_small(iOrigin,15)
                                        iOrigin[2] = iOrigin[2]-20 // Hide body
                                        set_user_origin(i,iOrigin)
                                    } //end gibs and effects
                                    set_user_frags(attacker, get_user_frags(attacker) - 1)
                                    
                                
}
                            }
                            else {
                                if (get_cvar_num("mp_friendlyfire")) {
                                    if (damage < get_user_health(i)) {
                                        set_user_health(i, get_user_health(i) - damage)
                                        client_print(attacker, print_center, "Хватит Р°С‚аковать СЃРІРѕРёС…!")
                                    }
                                    else {
                                        set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
                                        user_kill(i, 1)
                                        set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)
                                        
                                        message_begin
(MSG_BROADCAST, get_user_msgid("DeathMsg"))  // Kill-Log oben rechts
                                        write_byte(attacker)  // Attacker                                        write_byte(i)  // Victim
                                        write_byte(0)  // Headshot
                                        write_string("bazooka")
                                        message_end()
                                        if (damage > 100 && get_cvar_num("amx_bazooka_gib") == 1) { //begin gibs and effects (made by mike_cao)
                                            new iOrigin[3]
                                            get_user_origin(i,iOrigin)// Effects
                                            fx_trans(i,0)
                                            fx_gib_explode(iOrigin,3)
                                            fx_blood_large(iOrigin,5)
                                            fx_blood_small(iOrigin,15)
                                            iOrigin[2] = iOrigin[2]-20 // Hide body
                                            set_user_origin(i,iOrigin)
                                        } //end gibs and effects
                                        set_user_frags(attacker, get_user_frags(attacker) - 1)
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        remove_entity(ptr)
    }
    
    
    if 
(equal(ClassName, "rpg") || equal(ClassName, "rpg_temp")) {
        new Picker[32]
        if ((ptd > 0) && is_valid_ent(ptd)) {
            entity_get_string(ptd, EV_SZ_classname, Picker, 31)
        } 
        if 
(equal(Picker, "player")) {
            give_item(ptd, "weapon_c4")
            hasBazooka[ptd] = true
            Munni
[ptd] = Munni[ptd] + entity_get_int(ptr, EV_INT_iuser1)
            emit_sound(ptd, CHAN_WEAPON, "items/gunpickup2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
            remove_entity(ptr)
        }
    }
}

public drop_rpg(id, level, cid) {
    if (!cmd_access(id, level, cid, 1)) {
        return PLUGIN_HANDLED
    
}    
    new Float
:PlayerOrigin[3], Float:End[3], Float:Return[3], Float:TraceDirection[3]
    entity_get_vector(id, EV_VEC_origin, PlayerOrigin)
    VelocityByAim(id, 64, TraceDirection)
    
    End
[0] = TraceDirection[0] + PlayerOrigin[0]
    End[1] = TraceDirection[1] + PlayerOrigin[1]
    End[2] = TraceDirection[2] + PlayerOrigin[2]
    
    trace_line
(id, PlayerOrigin, End, Return)
    Return[2] = PlayerOrigin[2]
    
    new RPG 
= create_entity("info_target")
    entity_set_string(RPG, EV_SZ_classname, "rpg")
    entity_set_model(RPG, "models/w_rpg_vechta_new.mdl")
    entity_set_origin(RPG, Return)
    
    new Float
:MinBox[3] = {-16.0, -16.0, 0.0}
    new Float:MaxBox[3] = {16.0, 16.0, 16.0}
    entity_set_vector(RPG, EV_VEC_mins, MinBox)
    entity_set_vector(RPG, EV_VEC_maxs, MaxBox)
    
    entity_set_int
(RPG, EV_INT_solid, 1)
    entity_set_int(RPG, EV_INT_movetype, 6)
    
    entity_set_int
(RPG, EV_INT_iuser1, get_cvar_num("amx_bazooka_ammo"))
    
    return PLUGIN_HANDLED
}

public client_PreThink(id) {
    if (is_user_alive(id)) {
        new weaponid, clip, ammo
        weaponid 
= get_user_weapon(id, clip, ammo)
        if ((weaponid == CSW_C4) && hasBazooka[id]) {
            new attack = get_user_button(id) & IN_ATTACK
            new oldattack 
= get_user_oldbutton(id) & IN_ATTACK
            if 
(attack && !oldattack  && (cs_get_user_plant(id) != 1)) {
                    if (CanShoot[id] && allow_shooting ) {
                        fire_rocket(id)
                    }
            }
        }    
    
}    

    return FMRES_IGNORED
}

public forward_setmodel(entity, model[]) {
    if (!is_valid_ent(entity)) {
        return FMRES_IGNORED
    
}
    if (equal(model, "models/w_backpack.mdl")) {
        client_print(0, print_center, "")
        new ClassName[32]
        entity_get_string(entity, EV_SZ_classname, ClassName, 31)
        
        if 
(equal(ClassName, "weaponbox")) {
            
            remove_entity
(entity)
            
            return FMRES_SUPERCEDE
        
}
    }
    return FMRES_IGNORED
}

public check_model(id) {
    new weaponid, clip, ammo
    weaponid 
= get_user_weapon(id, clip, ammo)
    if ((weaponid == CSW_C4) && (cs_get_user_plant(id) != 1) && (mode[id] != 4)) {
        entity_set_string(id, EV_SZ_viewmodel, "models/v_rpg_vechta_new.mdl")
        entity_set_string(id, EV_SZ_weaponmodel, "models/p_rpg_vechta_new.mdl")
    }
    else if ((weaponid == CSW_C4) && (cs_get_user_plant(id) == 1) && (mode[id] == 4)) {
        entity_set_string(id, EV_SZ_viewmodel, "models/v_c4.mdl")
        entity_set_string(id, EV_SZ_weaponmodel, "models/p_c4.mdl")
    }
    return PLUGIN_HANDLED
}

public client_connect(id) {
    CanShoot[id] = true
    Munni
[id] = 0
    mode
[id] = 1
    hasBazooka
[id] = false
}

public player_die(id) {
    
    new victim
    victim 
= read_data(2)
    Munni[victim] = 0
    hasBazooka
[victim] = false
    if 
((cs_get_user_plant(victim) == 1) || cantswitch) {
        cs_set_user_plant(victim,0,0)
        cantswitch  = false
    
}
}

public player_spawn() {
    new players[32], count
    get_players
(players, count)
    for (new i = 0; i < count; i++) {
        if (is_user_alive(players[i])) {
            new v_oldmodel[64], p_oldmodel[64]
            entity_get_string(players[i], EV_SZ_viewmodel, v_oldmodel, 63)
            entity_get_string(players[i], EV_SZ_weaponmodel, p_oldmodel, 63)
            if (equal(v_oldmodel, "models/v_rpg_vechta_new.mdl") || equal(p_oldmodel, "models/p_rpg_vechta_new.mdl")) {
                if (!hasBazooka[players[i]]) {
                    new weaponid, clip, ammo
                    weaponid 
= get_user_weapon(players[i], clip, ammo)
                    
                    new weaponname
[64]
                    get_weaponname(weaponid, weaponname, 63)
                    
                    new v_model
[64], p_model[64]
                    format(v_model, 63, "%s", weaponname)
                    format(p_model, 63, "%s", weaponname)
                    
                    replace
(v_model, 63, "weapon_", "v_")
                    format(v_model, 63, "models/%s.mdl", v_model)
                    entity_set_string(players[i], EV_SZ_viewmodel, v_model)
                    
                    replace
(p_model, 63, "weapon_", "p_")
                    format(p_model, 63, "models/%s.mdl", p_model)
                    entity_set_string(players[i], EV_SZ_weaponmodel, p_model)
                }
            }
        }
    }
    
    new TempRocket 
= find_ent_by_class(-1, "rpgrocket")
    while (TempRocket > 0) {
        remove_entity(TempRocket)
        TempRocket = find_ent_by_class(TempRocket, "rpgrocket")
    }
    
    new TempRPG 
= find_ent_by_class(-1, "rpg_temp")
    while (TempRPG > 0) {
        remove_entity(TempRPG)
        TempRPG = find_ent_by_class(TempRPG, "rpg_temp")
    }
    
    return PLUGIN_HANDLED
}

public handle_drop(id) {
    if (read_argc() > 1) {
        new weapon[17]
        read_argv(1, weapon, 16)
        if (equal(weapon, "weapon_c4")) {
            new weapons[32], count
            get_user_weapons
(id, weapons, count)
            for (new i = 0; i < count; i++) {
                if (weapons[i] == 6) {
                    if (get_cvar_num("amx_bazooka_dropping") == 1) {
                        drop_rpg_temp(id)
                    }
                    else {
                        client_print(id, print_center, "Нельзя РІС‹Р±СЂР°СЃС‹РІР°С‚СЊ РґР°РЅРЅРѕРµ РѕСЂСѓР¶РёРµ")
                        return PLUGIN_HANDLED
                    
}
                }
            }
        }
    }
    else {
        new weaponid, clip, ammo
        weaponid 
= get_user_weapon(id, clip, ammo)
        if (weaponid == CSW_C4) {
            if (get_cvar_num("amx_bazooka_dropping") == 1) {
                drop_rpg_temp(id)
            }
            else {
                client_print(id, print_center, "Нельзя РІС‹Р±СЂР°СЃС‹РІР°С‚СЊ РґР°РЅРЅРѕРµ РѕСЂСѓР¶РёРµ")
                return PLUGIN_HANDLED
            
}
        }
    }
    
    return PLUGIN_CONTINUE
}

public drop_rpg_temp(id) {
    
    new Float
:PlayerOrigin[3], Float:End[3], Float:Return[3], Float:TraceDirection[3], Float:Angles[3]
    entity_get_vector(id, EV_VEC_origin, PlayerOrigin)
    entity_get_vector(id, EV_VEC_angles, Angles)
    VelocityByAim(id, 200, TraceDirection)
    
    End
[0] = TraceDirection[0] + PlayerOrigin[0]
    End[1] = TraceDirection[1] + PlayerOrigin[1]
    End[2] = TraceDirection[2] + PlayerOrigin[2]
    
    trace_line
(id, PlayerOrigin, End, Return)
    Return[2] = PlayerOrigin[2]
    
    new RPG 
= create_entity("info_target")
    entity_set_string(RPG, EV_SZ_classname, "rpg_temp")
    entity_set_model(RPG, "models/w_rpg_vechta_new.mdl")
    entity_set_origin(RPG, Return)
    
    Angles
[0] = 0.0
    Angles
[2] = 0.0
    
    entity_set_vector
(RPG, EV_VEC_angles, Angles)
    
    new Float
:MinBox[3] = {-16.0, -16.0, 0.0}
    new Float:MaxBox[3] = {16.0, 16.0, 16.0}
    entity_set_vector(RPG, EV_VEC_mins, MinBox)
    entity_set_vector(RPG, EV_VEC_maxs, MaxBox)
    
    entity_set_int
(RPG, EV_INT_solid, 1)
    entity_set_int(RPG, EV_INT_movetype, 6)
    
    entity_set_int
(RPG, EV_INT_iuser1, Munni[id])
    
    Munni
[id] = 0
    hasBazooka
[id] = false
    
    return PLUGIN_HANDLED
}

/************************************************************
* GIB FUNCTIONS (made by mike_cao)
************************************************************/

public event_respawn(id)
    {
    gHealthIndex[id] = get_user_health(id)
    fx_trans(id,255)
    return PLUGIN_CONTINUE
}

static fx_trans(player,amount)
{
    set_user_rendering(player,kRenderFxNone,0,0,0,kRenderTransAlpha,amount)
    return PLUGIN_CONTINUE
}

static fx_blood_small(origin[3],num)
{
    // Blood decals
    #if CZERO
    static const blood_small[8] = {202,203,204,205,206,207,208,209}
    #else
    static const blood_small[7] = {190,191,192,193,194,195,197}
    #endif    
    // Small splash
    for (new j = 0; j < num; j++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte(TE_WORLDDECAL)
        write_coord(origin[0]+random_num(-100,100))
        write_coord(origin[1]+random_num(-100,100))
        write_coord(origin[2]-36)
        write_byte(blood_small[random_num(0,6)]) // index
        message_end()
    }
}

static fx_blood_large(origin[3],num)
{
    // Blood decals
    #if CZERO
    static const blood_large[2] = {216,217}
    #else
    static const blood_large[2] = {204,205}
    #endif
    
    
// Large splash
    for (new i = 0; i < num; i++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte(TE_WORLDDECAL)
        write_coord(origin[0]+random_num(-50,50))
        write_coord(origin[1]+random_num(-50,50))
        write_coord(origin[2]-36)
        write_byte(blood_large[random_num(0,1)]) // index
        message_end()
    }
}

static fx_gib_explode(origin[3],num)
{
    new flesh[3], x, y, z
    flesh
[0] = mdl_gib_flesh
    flesh
[1] = mdl_gib_meat
    flesh
[2] = mdl_gib_legbone
    
    
// Gib explosion
    // Head
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte(TE_MODEL)
    write_coord(origin[0])
    write_coord(origin[1])
    write_coord(origin[2])
    write_coord(random_num(-100,100))
    write_coord(random_num(-100,100))
    write_coord(random_num(100,200))
    write_angle(random_num(0,360))
    write_short(mdl_gib_head)
    write_byte(0) // bounce
    write_byte(500) // life
    message_end()
    
    
// Spine
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte(TE_MODEL)
    write_coord(origin[0])
    write_coord(origin[1])
    write_coord(origin[2])
    write_coord(random_num(-100,100))
    write_coord(random_num(-100,100))
    write_coord(random_num(100,200))
    write_angle(random_num(0,360))
    write_short(mdl_gib_spine)
    write_byte(0) // bounce
    write_byte(500) // life
    message_end()
    
    
// Lung
    for(new i = 0; i < random_num(1,2); i++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte(TE_MODEL)
        write_coord(origin[0])
        write_coord(origin[1])
        write_coord(origin[2])
        write_coord(random_num(-100,100))
        write_coord(random_num(-100,100))
        write_coord(random_num(100,200))
        write_angle(random_num(0,360))
        write_short(mdl_gib_lung)
        write_byte(0) // bounce
        write_byte(500) // life
        message_end()
    }
    
    
// Parts, 10 times
    for(new i = 0; i < 10; i++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte(TE_MODEL)
        write_coord(origin[0])
        write_coord(origin[1])
        write_coord(origin[2])
        write_coord(random_num(-100,100))
        write_coord(random_num(-100,100))
        write_coord(random_num(100,200))
        write_angle(random_num(0,360))
        write_short(flesh[random_num(0,2)])
        write_byte(0) // bounce
        write_byte(500) // life
        message_end()
    }
    
    
// Blood
    for(new i = 0; i < num; i++) {
        x = random_num(-100,100)
        y = random_num(-100,100)
        z = random_num(0,100)
        for(new j = 0; j < 3; j++) {
            message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
            write_byte(TE_BLOODSPRITE)
            write_coord(origin[0]+(x*j))
            write_coord(origin[1]+(y*j))
            write_coord(origin[2]+(z*j))
            write_short(spr_blood_spray)
            write_short(spr_blood_drop)
            write_byte(229) // color index
            write_byte(15) // size
            message_end()
        }
    }

Если не трудно, то прошу помочь...

Название темы скорректировано // Subb98
Аватара пользователя
kypbep
 
Сообщения: 9
Зарегистрирован: 22 сен 2016, 09:40
Благодарил (а): 2 раз.
Поблагодарили: 0 раз.
Опыт программирования: Около года
Языки программирования: Pawn
Html

Re: BazookaAdvanced: undefined symbol

Сообщение Subb98 » 22 дек 2016, 20:06

Добрый вечер. Пожалуйста, придумайте более информативное название для вашей темы (в соответствии Вы должны зарегистрироваться, чтобы видеть ссылки.) и сообщите мне его в ЛС, после чего будет рассмотрена возможность открытия вашей темы вновь.

Название темы скорректировано, тема открыта вновь
«Сразу скажу разбираться кто виноват не требуется» © Radius
Аватара пользователя
Subb98
Модератор
 
Сообщения: 4172
Зарегистрирован: 24 мар 2011, 19:42
Откуда: г. Пермь
Благодарил (а): 1197 раз.
Поблагодарили: 1988 раз.
Опыт программирования: Больше трех лет
Языки программирования: Pawn, PHP

Re: BazookaAdvanced: undefined symbol

Сообщение kypbep » 23 дек 2016, 11:40

До добавления инклюда entity_maths была только эта ошибка:
error 100: cannot read from file: "entity_maths"


Добавлено спустя 2 часа 26 минут 47 секунд:
Проблема решена, тему можно закрывать
Аватара пользователя
kypbep
 
Сообщения: 9
Зарегистрирован: 22 сен 2016, 09:40
Благодарил (а): 2 раз.
Поблагодарили: 0 раз.
Опыт программирования: Около года
Языки программирования: Pawn
Html

Re: BazookaAdvanced: undefined symbol

Сообщение Subb98 » 23 дек 2016, 11:51

kypbep, как решили-то?
«Сразу скажу разбираться кто виноват не требуется» © Radius
Аватара пользователя
Subb98
Модератор
 
Сообщения: 4172
Зарегистрирован: 24 мар 2011, 19:42
Откуда: г. Пермь
Благодарил (а): 1197 раз.
Поблагодарили: 1988 раз.
Опыт программирования: Больше трех лет
Языки программирования: Pawn, PHP


Вернуться в Вопросы по AMXX и его плагинам

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 7