Konu

#1
Plugin İşlevsel olarak çalışmıyor eline spike çözmek için gelecek olan gelmiyor yardımcı olursanız sevinirim
.sma spikedefuse.sma (Dosya Boyutu: 2,79 KB | İndirme Sayısı: 12)
#2
(04-10-2024, 20:00)H3YLAZ Adlı Kullanıcıdan Alıntı: Plugin İşlevsel olarak çalışmıyor eline spike çözmek için gelecek olan gelmiyor yardımcı olursanız sevinirim
Kod:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Force Bomb Defuse Model"
#define VERSION "1.1"
#define AUTHOR "YOK"

new const DEFUSE_MODEL[] = "models/v_spikedefuse.mdl";
new g_originalViewModel[MAX_PLAYERS + 1][64];
new bool:g_isDefusing[MAX_PLAYERS + 1];

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR);
   
    RegisterHam(Ham_Item_Deploy, "weapon_c4", "fw_Item_Deploy_Post", 1);
    register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0");
    register_logevent("Event_BombPlanted", 3, "2=Planted_The_Bomb");
   
    register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
}

public plugin_precache() {
    precache_model(DEFUSE_MODEL);
}

public Event_NewRound() {
    for (new i = 1; i <= MaxClients; i++) {
        g_isDefusing[i] = false;
        if (is_user_alive(i)) {
            reset_view_model(i);
        }
    }
}

public Event_BombPlanted() {
    for (new i = 1; i <= MaxClients; i++) {
        if (is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) {
            reset_view_model(i);
        }
    }
}

public fw_PlayerPreThink(id) {
    if (!is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_CT) {
        return FMRES_IGNORED;
    }
   
    static Float:nextCheck[MAX_PLAYERS + 1];
    static Float:gameTime;
    gameTime = get_gametime();
   
    if (nextCheck[id] > gameTime) {
        return FMRES_IGNORED;
    }
   
    nextCheck[id] = gameTime + 0.1;
   
    new bool:isDefusing = cs_get_user_defuse(id);
   
    if (isDefusing && !g_isDefusing[id]) {
        g_isDefusing[id] = true;
        set_defuse_model(id);
    } else if (!isDefusing && g_isDefusing[id]) {
        g_isDefusing[id] = false;
        reset_view_model(id);
    }
   
    return FMRES_IGNORED;
}

public fw_Item_Deploy_Post(ent) {
    new id = get_pdata_cbase(ent, 41, 4);
   
    if (g_isDefusing[id]) {
        set_defuse_model(id);
    } else {
        reset_view_model(id);
    }
   
    return HAM_IGNORED;
}

public set_defuse_model(id) {
    static currentModel[64];
    pev(id, pev_viewmodel2, currentModel, charsmax(currentModel));
   
    if (!equal(currentModel, DEFUSE_MODEL)) {
        pev(id, pev_viewmodel2, g_originalViewModel[id], charsmax(g_originalViewModel[]));
        set_pev(id, pev_viewmodel2, DEFUSE_MODEL);
       
        // Animasyon ayarla
        set_pev(id, pev_weaponanim, 1);  // 1 = başlangıç animasyonu
       
        client_print(id, print_chat, "Bombayı çözmeye başladınız. Model: v_spikedefuse");
    }
}

public reset_view_model(id) {
    if (g_originalViewModel[id][0]) {
        set_pev(id, pev_viewmodel2, g_originalViewModel[id]);
        g_originalViewModel[id][0] = 0;
       
        // Animasyon sıfırla
        set_pev(id, pev_weaponanim, 0);
       
        client_print(id, print_chat, "Bombayı çözmeyi bitirdiniz. Model: geri yüklendi");
    }
}

#3
(06-10-2024, 14:06)` White* Adlı Kullanıcıdan Alıntı:
(04-10-2024, 20:00)H3YLAZ Adlı Kullanıcıdan Alıntı: Plugin İşlevsel olarak çalışmıyor eline spike çözmek için gelecek olan gelmiyor yardımcı olursanız sevinirim
Kod:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Force Bomb Defuse Model"
#define VERSION "1.1"
#define AUTHOR "YOK"

new const DEFUSE_MODEL[] = "models/v_spikedefuse.mdl";
new g_originalViewModel[MAX_PLAYERS + 1][64];
new bool:g_isDefusing[MAX_PLAYERS + 1];

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR);
   
    RegisterHam(Ham_Item_Deploy, "weapon_c4", "fw_Item_Deploy_Post", 1);
    register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0");
    register_logevent("Event_BombPlanted", 3, "2=Planted_The_Bomb");
   
    register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
}

public plugin_precache() {
    precache_model(DEFUSE_MODEL);
}

public Event_NewRound() {
    for (new i = 1; i <= MaxClients; i++) {
        g_isDefusing[i] = false;
        if (is_user_alive(i)) {
            reset_view_model(i);
        }
    }
}

public Event_BombPlanted() {
    for (new i = 1; i <= MaxClients; i++) {
        if (is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) {
            reset_view_model(i);
        }
    }
}

public fw_PlayerPreThink(id) {
    if (!is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_CT) {
        return FMRES_IGNORED;
    }
   
    static Float:nextCheck[MAX_PLAYERS + 1];
    static Float:gameTime;
    gameTime = get_gametime();
   
    if (nextCheck[id] > gameTime) {
        return FMRES_IGNORED;
    }
   
    nextCheck[id] = gameTime + 0.1;
   
    new bool:isDefusing = cs_get_user_defuse(id);
   
    if (isDefusing && !g_isDefusing[id]) {
        g_isDefusing[id] = true;
        set_defuse_model(id);
    } else if (!isDefusing && g_isDefusing[id]) {
        g_isDefusing[id] = false;
        reset_view_model(id);
    }
   
    return FMRES_IGNORED;
}

public fw_Item_Deploy_Post(ent) {
    new id = get_pdata_cbase(ent, 41, 4);
   
    if (g_isDefusing[id]) {
        set_defuse_model(id);
    } else {
        reset_view_model(id);
    }
   
    return HAM_IGNORED;
}

public set_defuse_model(id) {
    static currentModel[64];
    pev(id, pev_viewmodel2, currentModel, charsmax(currentModel));
   
    if (!equal(currentModel, DEFUSE_MODEL)) {
        pev(id, pev_viewmodel2, g_originalViewModel[id], charsmax(g_originalViewModel[]));
        set_pev(id, pev_viewmodel2, DEFUSE_MODEL);
       
        // Animasyon ayarla
        set_pev(id, pev_weaponanim, 1);  // 1 = başlangıç animasyonu
       
        client_print(id, print_chat, "Bombayı çözmeye başladınız. Model: v_spikedefuse");
    }
}

public reset_view_model(id) {
    if (g_originalViewModel[id][0]) {
        set_pev(id, pev_viewmodel2, g_originalViewModel[id]);
        g_originalViewModel[id][0] = 0;
       
        // Animasyon sıfırla
        set_pev(id, pev_weaponanim, 0);
       
        client_print(id, print_chat, "Bombayı çözmeyi bitirdiniz. Model: geri yüklendi");
    }
}

plugin hala çalışmıyor denedim ama olmadıelimde silah ya da bıçak olsa bile gelmesi çözünce gitmesi lazım ama hiç gelmiyor
#4
İstek konusu, @` White* adlı kullanıcı tarafından 5 gün içinde çözülmüştür.
İsteği çözdüğü için ` White* Adlı kullanıcıya 1 rep puanı ve 1 yardım etme puanı otomatik olarak verilmiştir.
` White* Adlı kullanıcı sizin dışınızda toplam 6 kişiye yardım etmiştir.

Herhangi bir konuda hata olduğunu düşünüyorsanız destek sistemi üzerinden iletişim kurabilirsiniz.

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Benzer Konular

4
Yorum
197
Okunma
Dün, 21:32
9
Yorum
83
Okunma
Dün, 16:53
3
Yorum
309
Okunma
13-04-2025, 19:10
6
Yorum
417
Okunma
07-04-2025, 22:21
15
Yorum
1.213
Okunma
19-03-2025, 19:44
10
Yorum
1.034
Okunma
18-03-2025, 18:48
3
Yorum
1.180
Okunma
05-03-2025, 22:28
Kayıt Ol
Uygun fiyatlı ve yüksek performanslı teamspeak3