AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Zombie Class model not applying [Zombie Plague 5.0.8] (https://forums.alliedmods.net/showthread.php?t=333259)

Xpym4uk76 06-28-2021 08:49

Zombie Class model not applying [Zombie Plague 5.0.8]
 
Hello!
I have some problem with my zombie class script. There is code:
Code:

#include <zp50_core>
#include <fakemeta_util>

// Classic Zombie Attributes
new const zombieclass_name[] = "Regular"
new const zombieclass_info[] = "Berserk on G"
new const zombieclass_models[][] = { "zombie2_regular" }
new const zombieclass_clawmodels[][] = { "models/zombie_plague/v_knife_zombie_regular2.mdl" }
new const zombieclass_skillsound[] = "zombie_plague/run_regular.wav"
const zombieclass_health = 2000
const Float:zombieclass_speed = 1.0
const Float:zombieclass_gravity = 1.0
const Float:zombieclass_knockback = 1.0

new g_ZombieClassID, bool:bSpeed[33]

public plugin_init()
{
        register_event("CurWeapon","CurrentWeapon","be","1=1");
}

public plugin_precache()
{
        register_plugin("[ZP] Class: REGULAR", ZP_VERSION_STRING, "Xpym4uk76")
        register_clcmd("drop", "use_skill")
       
        new index
       
        precache_sound(zombieclass_skillsound)
        g_ZombieClassID = zp_class_zombie_register(zombieclass_name, zombieclass_info, zombieclass_health, zombieclass_speed, zombieclass_gravity)
        zp_class_zombie_register_kb(g_ZombieClassID, zombieclass_knockback)
        for (index = 0; index < sizeof zombieclass_models; index++)
                zp_class_zombie_register_model(g_ZombieClassID, zombieclass_models[index])
        for (index = 0; index < sizeof zombieclass_clawmodels; index++)
                zp_class_zombie_register_claw(g_ZombieClassID, zombieclass_clawmodels[index])
}

public use_skill(id) {
        static Float:fLastUse[33];
        if(fLastUse[id] + 25.0 < get_gametime() && zp_core_is_zombie(id)) {
                bSpeed[id] = true;
                fm_set_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 1);
                set_pev(id, pev_maxspeed, 600.0);
                client_cmd(id, "cl_forwardspeed 600");
                client_cmd(id, "cl_sidespeed 600");
                client_cmd(id, "cl_backspeed 600");
                set_task(5.0, "EndSkill", id+1331);
                emit_sound(id, CHAN_ITEM, zombieclass_skillsound, 1.0, ATTN_NORM, 0, PITCH_NORM);
                fLastUse[id] = get_gametime();
                return PLUGIN_HANDLED;
        }
        else if(fLastUse[id] + 25.0 > get_gametime() && zp_core_is_zombie(id)) {
                client_print(id, print_center, "Способность перезаряжается! Осталось %d сек", floatround(fLastUse[id]+25-get_gametime()))
                return PLUGIN_HANDLED
        }
        return PLUGIN_CONTINUE;
}

public EndSkill(id) {
        id-=1331;
        fm_set_rendering(id, kRenderFxNone, 255, 0, 0, kRenderNormal, 1);
        set_pev(id, pev_maxspeed, 250.0);
}

public CurrentWeapon(id) {
        console_print(id, "%s", zp_class_zombie_get_current(id));
        if(is_user_alive(id)
        && zp_core_is_zombie(id) && bSpeed[id]) {
                set_pev(id, pev_maxspeed, 600.0);
        }
}

I dunno what to do. I didnt see any error in console, class works but not changes model. Model downloading and nothing, new zombie classes not adding in zp_zombieclasses.ini Oh and not changes models - knife model and player model, but its exists in "models folder"

Xpym4uk76 06-28-2021 10:40

Re: Zombie Class model not applying [Zombie Plague 5.0.8]
 
So, i solved the problem!
And problem was that plugin - zp50_admin_models.amxx. That plugin changes the admin models, so i see only the standart zombie model. When i disabled that plugin, zombie class started work as well! :) shitty plugin hehe


All times are GMT -4. The time now is 02:30.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.