Поиск Гранат модель

mAx

Сообщения
62
Реакции
-7
ищу плагин Гранат модель + оставляет цветную полосу за гранатой
  • HE Grenade
  • Flash Grenade
  • Smoke Grenade
 

mAx

Сообщения
62
Реакции
-7
ищу плагин модель гранат p_ w_ v_
 
Сообщения
278
Реакции
137
I am not sure that it is working but you can try to change grenade models.

Код:
#include <amxmodx>
#include <hamsandwich>
#include <reapi>

enum { HeGrenade_V, HeGrenade_P, Flashbang_V, Flashbang_P, SmokeGrenade_V, SmokeGrenade_P };
new const models[][] = {
    "models/v_hegrenade.mdl",
    "models/p_hegrenade.mdl",
    "models/v_flashbang.mdl",
    "models/p_flashbang.mdl",
    "models/v_smokegrenade.mdl",
    "models/p_smokegrenade.mdl"
};

enum { HeGrenade_W, Flashbang_W, SmokeGrenade_W };
new const models_w[][] = {
    "models/w_hegrenade.mdl",
    "models/w_flashbang.mdl",
    "models/w_smokegrenade.mdl"
};
new modelindex[3];

public plugin_init() {
    RegisterHookChain(RG_ThrowFlashbang, "@ThrowGrenade_FB", .post = true);
    RegisterHookChain(RG_ThrowHeGrenade, "@ThrowGrenade_HG", .post = true);
    RegisterHookChain(RG_ThrowSmokeGrenade, "@ThrowGrenade_SG", .post = true);

    new const grenadenames[] = {
        "weapon_hegrenade","weapon_flashbang","weapon_smokegrenade"
    }

    for(new i = 0; i < sizeof(grenadenames); i++) {
        RegisterHam(Ham_Item_Deploy, grenadenames[i], "Ham_Item_Deploy_Grenade");
    }
}

public plugin_precache() {
    for(new i = 0; i < sizeof(models); i++) {
        precache_model(models[i]);
    }

    for(new i = 0; i < sizeof(models_w); i++) {
        modelindex[i] = precache_model(models_w[i]);
    }
}

@Ham_Item_Deploy_Grenade(const pEntity) {
    new pPlayer = get_member(pEntity, m_pPlayer);

    new weapon = get_user_weapon(pPlayer);
    switch(weapon) {
        case CSW_FLASHBANG: SetModel(pPlayer, models[Flashbang_V], models[Flashbang_P]);
        case CSW_HEGRENADE: SetModel(pPlayer, models[HeGrenade_V], models[HeGrenade_P]);
        case CSW_SMOKEGRENADE: SetModel(pPlayer, models[SmokeGrenade_V], models[SmokeGrenade_P]);
    }
}

SetModel(const pPlayer, const vmodel[], const pmodel[]) {
    set_entvar(pPlayer, var_viewmodel, vmodel);
    set_entvar(pPlayer, var_weaponmodel, pmodel);
}

@ThrowGrenade_FB(const pPlayer, Float:vecStart[3], Float:vecVelocity[3], Float:time) {
    new pEntity = GetHookChainReturn(ATYPE_INTEGER);
    set_entvar(pEntity, var_modelindex, modelindex[Flashbang_W]);
    set_entvar(pEntity, var_model, models_w[Flashbang_W]);
}

@ThrowGrenade_HE(const pPlayer, Float:vecStart[3], Float:vecVelocity[3], Float:time) {
    new pEntity = GetHookChainReturn(ATYPE_INTEGER);
    set_entvar(pEntity, var_modelindex, modelindex[HeGrenade_W]);
    set_entvar(pEntity, var_model, models_w[HeGrenade_W]);
}

@ThrowGrenade_SG(const pPlayer, Float:vecStart[3], Float:vecVelocity[3], Float:time) {
    new pEntity = GetHookChainReturn(ATYPE_INTEGER);
    set_entvar(pEntity, var_modelindex, modelindex[SmokeGrenade_W]);
    set_entvar(pEntity, var_model, models_w[SmokeGrenade_W]);
}
 
Последнее редактирование:
Сообщения
278
Реакции
137
Nordic Warrior, thank you.

I thought it should be pre. If not working, try post.

Код:
#include <amxmodx>
#include <hamsandwich>
#include <reapi>

enum { HeGrenade_V, HeGrenade_P, Flashbang_V, Flashbang_P, SmokeGrenade_V, SmokeGrenade_P };
new const models[][] = {
    "models/v_hegrenade.mdl",
    "models/p_hegrenade.mdl",
    "models/v_flashbang.mdl",
    "models/p_flashbang.mdl",
    "models/v_smokegrenade.mdl",
    "models/p_smokegrenade.mdl"
};

enum { HeGrenade_W, Flashbang_W, SmokeGrenade_W };
new const models_w[][] = {
    "models/w_hegrenade.mdl",
    "models/w_flashbang.mdl",
    "models/w_smokegrenade.mdl"
};
new modelindex[3];

public plugin_init() {
    RegisterHookChain(RG_CBasePlayerWeapon_DefaultDeploy, "@CBasePlayerWeapon_DefaultDeploy", .post = false);
    RegisterHookChain(RG_ThrowFlashbang, "@ThrowGrenade_FB", .post = true);
    RegisterHookChain(RG_ThrowHeGrenade, "@ThrowGrenade_HG", .post = true);
    RegisterHookChain(RG_ThrowSmokeGrenade, "@ThrowGrenade_SG", .post = true);
}

public plugin_precache() {
    for(new i = 0; i < sizeof(models); i++) {
        precache_model(models[i]);
    }

    for(new i = 0; i < sizeof(models_w); i++) {
        modelindex[i] = precache_model(models_w[i]);
    }
}

@CBasePlayerWeapon_DefaultDeploy(const pEntity, szViewModel[], szWeaponModel[], iAnim, szAnimExt[], skiplocal) {
    new pPlayer = get_member(pEntity, m_pPlayer);
    new weapon = get_user_weapon(pPlayer);

    switch(weapon) {
        case CSW_FLASHBANG: {
            SetHookChainArg(2, ATYPE_STRING, models[Flashbang_V]);
            SetHookChainArg(3, ATYPE_STRING, models[Flashbang_W]);
        }
        case CSW_SMOKEGRENADE: {
            SetHookChainArg(2, ATYPE_STRING, models[SmokeGrenade_V]);
            SetHookChainArg(3, ATYPE_STRING, models[SmokeGrenade_W]);
        }
        case CSW_HEGRENADE: {
            SetHookChainArg(2, ATYPE_STRING, models[HeGrenade_V]);
            SetHookChainArg(3, ATYPE_STRING, models[HeGrenade_W]);
        }
    }
}

@ThrowGrenade_FB(const pPlayer, Float:vecStart[3], Float:vecVelocity[3], Float:time) {
    new pEntity = GetHookChainReturn(ATYPE_INTEGER);
    set_entvar(pEntity, var_modelindex, modelindex[Flashbang_W]);
    set_entvar(pEntity, var_model, models_w[Flashbang_W]);
}

@ThrowGrenade_HE(const pPlayer, Float:vecStart[3], Float:vecVelocity[3], Float:time) {
    new pEntity = GetHookChainReturn(ATYPE_INTEGER);
    set_entvar(pEntity, var_modelindex, modelindex[HeGrenade_W]);
    set_entvar(pEntity, var_model, models_w[HeGrenade_W]);
}

@ThrowGrenade_SG(const pPlayer, Float:vecStart[3], Float:vecVelocity[3], Float:time) {
    new pEntity = GetHookChainReturn(ATYPE_INTEGER);
    set_entvar(pEntity, var_modelindex, modelindex[SmokeGrenade_W]);
    set_entvar(pEntity, var_model, models_w[SmokeGrenade_W]);
}
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу