View Single Post
Author Message
The Professional
Member
Join Date: Nov 2015
Location: İstanbul
Old 03-03-2016 , 15:02   [Help] Very simple
Reply With Quote #1

I just want to get active For T team

I do not know how to use this command;
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

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

#define STEP_DELAY 4.5

new Float:g_fNextStep[33];

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

new const g_szStepSound[MAX_SOUNDS][] = {
    
    
"zombie_plague/zombie_madness1.wav",
    
"zombie_plague/zombie_burn5.wav",
    
"zombie_plague/zombie_madness1.wav",
    
"zombie_plague/zombie_burn5.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 The Professional; 03-03-2016 at 15:04.
The Professional is offline