WinTeam Model

tarsisd2

Пользователь
Регистрация
9 Июн 2017
Сообщения
24
Симпатии
5
Пол
Мужской
hi, i'm trying to create a amazing plugin that when a ct or t wins, player weapon model will change to one with dance animation and win banner, but i didn't work, if anyone has any ideas, or if can elaborate the plugin i will post the plugin and the models, translated to russian as well, see the following example on youtube and what i tried to do


Код:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <hamsandwich>

#define t(%1) cs_get_user_team(%1)

new bool:iModel[32];

new szModel[][] = {
    "models/knife.mdl",
    "models/BigTR_Win.mdl",
    "models/BigCT_Win.mdl",
    "models/BigDRAW_Win.mdl"
}

public plugin_init(){
    RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawn", 0);
   
    register_event("TeamScore", "eventT", "a", "1=TERRORIST");
    register_event("TeamScore", "eventCT", "a", "1=CT");
   
    register_event("TextMsg", "eventDraw", "a", "2&#Round_Draw");
}

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

public fwHamPlayerSpawn(id){
    if (iModel[id]){
        SetKnife(id);
        iModel[id] = false;
    }
}          

public eventT()
    CallKnife(1);

public eventCT()
    CallKnife(2);

public eventDraw()
    CallKnife(3);

SetKnife(id, item_key = 0){
    new weapon = get_user_weapon(id);
   
    if (weapon == CSW_KNIFE)
        entity_set_string(id, EV_SZ_viewmodel, szModel[item_key]);
}

CallKnife(item_key){
    for (new i = 0; i < 32; i++){
        if (is_user_alive(i)){
            if (t(i) == (CsTeams:CS_TEAM_T|CsTeams:CS_TEAM_CT)){
                SetKnife(i, item_key);
                iModel[i] = true;
                client_cmd(i, "weapon_knife");
            }
        }
    }
}
 
Сверху Снизу