Raised This Month: $32 Target: $400
 8% 

[REQ] Troubleshoot plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 05-16-2020 , 07:39   [REQ] Troubleshoot plugin
Reply With Quote #1

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);


Last edited by alferd; 05-16-2020 at 07:49.
alferd is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 05-18-2020 , 02:39   Re: [REQ] Troubleshoot plugin
Reply With Quote #2

Doesn't anyone know how to cover these problems?
alferd is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-18-2020 , 19:15   Re: [REQ] Troubleshoot plugin
Reply With Quote #3

What do you want the plugin to do?
__________________
Bugsy is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 05-19-2020 , 01:26   Re: [REQ] Troubleshoot plugin
Reply With Quote #4

Quote:
Originally Posted by Bugsy View Post
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
alferd is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-19-2020 , 15:19   Re: [REQ] Troubleshoot plugin
Reply With Quote #5

Quote:
Originally Posted by alferd View Post
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.
Attached Files
File Type: sma Get Plugin or Get Source (footstep_custom.sma - 137 views - 2.6 KB)
__________________

Last edited by DJEarthQuake; 05-19-2020 at 15:23.
DJEarthQuake is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 05-20-2020 , 01:05   Re: [REQ] Troubleshoot plugin
Reply With Quote #6

Quote:
Originally Posted by DJEarthQuake View Post
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
alferd is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-20-2020 , 08:16   Re: [REQ] Troubleshoot plugin
Reply With Quote #7

Quote:
Originally Posted by alferd View Post
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.
__________________
DJEarthQuake is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:52.


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