AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] Troubleshoot plugin (https://forums.alliedmods.net/showthread.php?t=324440)

alferd 05-16-2020 07:39

[REQ] Troubleshoot plugin
 
Plugin defects:
1. When I walk slowly I hear footsteps, And even sitting down I hear the sound

Plugin:
PHP Code:

#include <amxmodx>
#include <fakemeta>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Alka"

#define STEP_DELAY 0.5

new Float:g_fNextStep[33];

#define MAX_SOUNDS 4 //Max num of sound for list below

new const g_szStepSound[MAX_SOUNDS][] = {
    
    
"custom_step_sound#1.wav",
    
"custom_step_sound#2.wav",
    
"custom_step_sound#3.wav",
    
"custom_step_sound#4.wav"
};

public 
plugin_init() {
    
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_forward(FM_PlayerPreThink"fwd_PlayerPreThink"0);
}

public 
plugin_precache()
{
    new 
i;
    for(
0MAX_SOUNDS i++)
        
precache_sound(g_szStepSound[i]);
}

public 
fwd_PlayerPreThink(id)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    
set_pev(idpev_flTimeStepSound999);
    
    if(
g_fNextStep[id] < get_gametime())
    {
        if(
fm_get_ent_speed(id) && (pev(idpev_flags) & FL_ONGROUND))
            
emit_sound(idCHAN_BODYg_szStepSound[random(MAX_SOUNDS)], VOL_NORMATTN_STATIC0PITCH_NORM);
        
        
g_fNextStep[id] = get_gametime() + STEP_DELAY;
    }
    return 
FMRES_IGNORED;
}

stock Float:fm_get_ent_speed(id)
{
    if(!
pev_valid(id))
        return 
0.0;
    
    static 
Float:vVelocity[3];
    
pev(idpev_velocityvVelocity);
    
    
vVelocity[2] = 0.0;
    
    return 
vector_length(vVelocity);



alferd 05-18-2020 02:39

Re: [REQ] Troubleshoot plugin
 
Doesn't anyone know how to cover these problems?:shock:

Bugsy 05-18-2020 19:15

Re: [REQ] Troubleshoot plugin
 
What do you want the plugin to do?

alferd 05-19-2020 01:26

Re: [REQ] Troubleshoot plugin
 
Quote:

Originally Posted by Bugsy (Post 2700928)
What do you want the plugin to do?

When you hold down the shift key, the speed slows down and you no longer hear footsteps

When I install this plugin, When I walk slowly, the sound of my footsteps comes
And when I sit and walk, I hear footsteps

This is a plugin problem

DJEarthQuake 05-19-2020 15:19

Re: [REQ] Troubleshoot plugin
 
1 Attachment(s)
Quote:

Originally Posted by alferd (Post 2700519)
Plugin defects:
1. When I walk slowly I hear footsteps, And even sitting down I hear the sound

Tested with game's existing snow steps. Ordinary footsteps indoors and snow footsteps outdoors. Stops when walking, stationary or not on ground.

alferd 05-20-2020 01:05

Re: [REQ] Troubleshoot plugin
 
Quote:

Originally Posted by DJEarthQuake (Post 2701081)
Tested with game's existing snow steps. Ordinary footsteps indoors and snow footsteps outdoors. Stops when walking, stationary or not on ground.

This only works for places with snow, Tnx

Don't have it for other places?
Because we don't have a snow map

DJEarthQuake 05-20-2020 08:16

Re: [REQ] Troubleshoot plugin
 
Quote:

Originally Posted by alferd (Post 2701165)
This only works for places with snow, Tnx

Don't have it for other places?
Because we don't have a snow map

Replace footstep file names.


All times are GMT -4. The time now is 20:19.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.