Kod: Tümünü seç
#define IN_WALK (1 << 18)
new button = get_uc(uc_handle, UC_Buttons);
if(button & IN_WALK) {
return FMRES_IGNORED;
}
Moderatör: Moderatörler
Kod: Tümünü seç
#define IN_WALK (1 << 18)
new button = get_uc(uc_handle, UC_Buttons);
if(button & IN_WALK) {
return FMRES_IGNORED;
}
Link: | |
Linklerini gizle |
Link: | |
Linklerini gizle |
Kod: Tümünü seç
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Alka"
#define STEP_DELAY 0.3
#define IN_WALK (1 << 18)
new Float:g_fNextStep[33];
#define MAX_SOUNDS 4 //Max num of sound for list below
new const g_szStepSound[MAX_SOUNDS][] = {
"normaly1.wav",
"normaly2.wav",
"normaly3.wav",
"normaly4.wav"
};
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_PlayerPreThink, "fwd_PlayerPreThink", 0);
}
public plugin_precache()
{
new i;
for(i = 0; i < MAX_SOUNDS ; i++)
precache_sound(g_szStepSound[i]);
}
public fwd_PlayerPreThink(id,uc_handle)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
set_pev(id, pev_flTimeStepSound, 999);
if(g_fNextStep[id] < get_gametime())
{
if(fm_get_ent_speed(id) && (pev(id, pev_flags) & FL_ONGROUND))
emit_sound(id, CHAN_BODY, g_szStepSound[random(MAX_SOUNDS)], VOL_NORM, ATTN_STATIC, 0, PITCH_NORM);
g_fNextStep[id] = get_gametime() + STEP_DELAY;
}
new button = get_uc(uc_handle, UC_Buttons);
if(button & IN_WALK) {
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
stock Float:fm_get_ent_speed(id)
{
if(!pev_valid(id))
return 0.0;
static Float:vVelocity[3];
pev(id, pev_velocity, vVelocity);
vVelocity[2] = 0.0;
return vector_length(vVelocity);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1254\\ deff0\\ deflang1055{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
Link: | |
Linklerini gizle |