Usunięcie dźwięku chodzenia przy zwiększonej szybkości

S!p

Administrator
Członek Załogi
Dziś próbując ustawić ciche chodzenie osobie ze zwiększoną szybkością zauważyłem że jest problem z funkcją set_user_footsteps
Przy zwiększonej szybkości nie działa...

Rozwiązaniem jest dodanie tego do kodu:

PHP:
#define STANDARDTIMESTEPSOUND 400
new bool:g_silent[33]

fm_set_user_footsteps(index, set = 1) {
        if (set) {                
                set_pev(index, pev_flTimeStepSound, 999)
                g_silent[index] = true
        }
        else {
                set_pev(index, pev_flTimeStepSound, STANDARDTIMESTEPSOUND)
                g_silent[index] = false
        }

        return 1
}

fm_get_user_footsteps(index) {
        return g_silent[index]
}

public plugin_init() {
        register_forward(FM_PlayerPreThink, "forward_player_prethink")
}

public forward_player_prethink(index) {
        if (g_silent[index])
                set_pev(index, pev_flTimeStepSound, 999)
}

public client_disconnect(index) {
        g_silent[index] = false
}

a następnie gdy chcemy dodać komuś ciche chodzenie:
PHP:
fm_set_user_footsteps(index, 1);
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Back
Do góry