1. sayfa (Toplam 1 sayfa)

Reload tuşuna 3 saniye basılı tutunca yok etsin

Gönderilme zamanı: Cmt May 07, 2022 1:28 pm
gönderen theqramboq

Kod: Tümünü seç

public client_PreThink(id)

{
    if (pev(id, pev_button) & IN_RELOAD && g_bHasSpawned[id])
      holdremove(id)
}

public holdremove(id)
{
set_task(3.0, "RemoveSavages_dest", id)
}

public RemoveSavages_dest(id)
{
    DestroySavage(id)
}

DestroySavage(id, bool:effect = false)
{
    if (pev_valid(g_iSavageCamEntity[id]))
    {
        if (is_user_alive(id))
        attach_view(id, id)
        engfunc(EngFunc_RemoveEntity, g_iSavageCamEntity[id])
        g_iSavageCamEntity[id] = -1
        remove_preview(id)
    }
    if (effect)
    {
        if (!pev_valid(g_iSavageEntity[id]))
            return

        new Float:vOrigin[3]
        pev(g_iSavageEntity[id], pev_origin, vOrigin)
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(3)
        write_coord(floatround(vOrigin[0]))
        write_coord(floatround(vOrigin[1]))
        write_coord(floatround(vOrigin[2] + 10))
        write_short(boom)
        write_byte(40)
        write_byte(15)
        write_byte(0)
        message_end()
    }

    if (pev_valid(g_iSavageEntity[id]))
    {
        emit_sound(g_iSavageEntity[id], CHAN_VOICE, "zombie_plague/savage_engine.wav", VOL_NORM, ATTN_NORM, SND_STOP, PITCH_NORM)
        engfunc(EngFunc_RemoveEntity, g_iSavageEntity[id])
        g_iSavageEntity[id] = -1
    }
    if(is_user_alive(id)) zp_grenade_frost_set_rc(id, false)
    g_bHasSpawned[id] = false
}

Reload tuşuna 3 saniye basılı tutunca yok etsin

Gönderilme zamanı: Cmt May 07, 2022 3:36 pm
gönderen theqramboq
Çözdüm