AZJA 2010 - NOWA WLOCZEGA

Plugin ma na celu podmianke standardowego noza , ktorego uzywamy w cs'sie na siekiere
Folder models podmieniamy po prostu
Folder sound tez podmieniamy

.sma
Kod php:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>
#define PA4_LOW 10.0
#define PA4_HIGH 20.0
new PLUGIN_NAME[] = "Kosa"
new PLUGIN_VERSION[] = "1.0"
new PLUGIN_AUTHOR[] = "sWH?"

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
register_event("Damage", "Event_Damage", "be", "2!0")
register_forward(FM_EmitSound, "EmitSound")
}

public plugin_precache()
{
precache_model("models/v_siekiera.mdl")
}

public Event_Damage(id)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_CONTINUE

new AttakerWeapon, AttakerPartHit
get_user_attacker(id, AttakerWeapon, AttakerPartHit)

if(AttakerWeapon != CSW_KNIFE)
return PLUGIN_CONTINUE

new Float:Random_Float[3]
for(new i = 0; i < 3; i++) Random_Float[i] = random_float(-100.0, 100.0)
Punch_View(id, Random_Float)

return PLUGIN_CONTINUE
}

public Event_CurWeapon(id)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_CONTINUE

new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
if(weapon == CSW_KNIFE)
{
entity_set_string(id, EV_SZ_viewmodel, "models/v_siekiera.mdl")
}
return PLUGIN_CONTINUE
}

public EmitSound(id, channel, sample[])
{
if(!is_user_alive(id) || !is_user_connected(id))
return FMRES_IGNORED

new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
if(weapon == CSW_KNIFE)
{
if(equal(sample, "weapons/knife_hit", 17))
{
new pitch
switch(random_num(1,3))
{
case 1: pitch = PITCH_NORM
case 2: pitch = PITCH_LOW
case 3: pitch = PITCH_HIGH
}

new Float:volume = random_float(0.5, 1.0)

emit_sound(id, CHAN_WEAPON, "weapons/knife_hitwall1.wav", volume, ATTN_NORM, 0, pitch)
return FMRES_SUPERCEDE

}
else if(equal(sample,"weapons/knife_hitwall1.wav"))
{
emit_sound(id, CHAN_WEAPON, "weapons/knife_hitwall1.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}

stock Punch_View(id, Float:ViewAngle[3])
{
entity_set_vector(id, EV_VEC_punchangle, ViewAngle)
}


Nie popieram. Po co takie debilne dodatki??
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • mkulturalnik.xlx.pl
  •