PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Jop"
#define VERSION "1.0"
#define AUTHOR "Nemesis"
new const P_KNIFE[] = "models/Leqend_Gaming/ctsilah/leqend_ctbicak2.mdl";
new const V_KNIFE[] = "models/Leqend_Gaming/ctsilah/leqend_ctbicak.mdl";
new const KNIFE_SLASH1[] = "JailBreak_Jop/leqend_slash1.wav";
new const KNIFE_SLASH2[] = "JailBreak_Jop/leqend_slash2.wav";
new const KNIFE_DEPLOY[] = "JailBreak_Jop/leqend_dep.wav";
new const KNIFE_WALL[] = "JailBreak_Jop/leqend_wall.wav";
new const KNIFE_HIT1[] = "JailBreak_Jop/leqend_hit1.wav";
new const KNIFE_HIT2[] = "JailBreak_Jop/leqend_hit2.wav";
new const KNIFE_HIT3[] = "JailBreak_Jop/leqend_hit3.wav";
new const KNIFE_HIT4[] = "JailBreak_Jop/leqend_hit4.wav";
new gDamageKafa, gDamageVucut;
public plugin_init() {
new mapname[32];
get_mapname(mapname,31)
if((containi(mapname,"jail") != -1) || (containi(mapname,"jb_") != -1) ) {
register_plugin(PLUGIN, VERSION, AUTHOR)
gDamageKafa = register_cvar("jop_damage_kafa","80.0")
gDamageVucut = register_cvar("jop_damage_vucut","50.0")
register_event("CurWeapon","eCurWeapon","be","1=1")
RegisterHam(Ham_TakeDamage,"player","eTakeDamage",0)
register_forward(FM_EmitSound, "Fwd_EmitSound")
}
}
public plugin_precache() {
precache_model(P_KNIFE)
precache_model(V_KNIFE)
precache_sound(KNIFE_DEPLOY)
precache_sound(KNIFE_WALL)
precache_sound(KNIFE_SLASH1)
precache_sound(KNIFE_SLASH2)
precache_sound(KNIFE_HIT1)
precache_sound(KNIFE_HIT2)
precache_sound(KNIFE_HIT3)
precache_sound(KNIFE_HIT4)
}
public eCurWeapon(id) {
if((get_user_team(id) == 2) && (get_user_weapon(id) == CSW_KNIFE)) {
set_pev(id,pev_viewmodel2,V_KNIFE)
set_pev(id,pev_weaponmodel2,P_KNIFE)
}
}
public eTakeDamage(victim, inflictor, attacker, Float:damage) {
if((get_user_team(attacker) == 2) && (get_user_weapon(attacker) == CSW_KNIFE)) {
if(get_pdata_int(victim,75) == HIT_HEAD) {
SetHamParamFloat(4,get_pcvar_float(gDamageKafa))
}
else {
SetHamParamFloat(4,get_pcvar_float(gDamageVucut))
}
}
}
public Fwd_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch) {
if(get_user_team(id) == 2) {
if (equal(sample[8], "kni", 3)) {
if (equal(sample[14], "sla", 3)) {
switch (random_num(1, 2)) {
case 1: engfunc(EngFunc_EmitSound, id, channel, KNIFE_SLASH1, volume, attn, flags, pitch)
case 2: engfunc(EngFunc_EmitSound, id, channel, KNIFE_SLASH2, volume, attn, flags, pitch)
}
return FMRES_SUPERCEDE;
}
if(equal(sample,"weapons/knife_deploy1.wav")) {
engfunc(EngFunc_EmitSound, id, channel, KNIFE_DEPLOY, volume, attn, flags, pitch)
return FMRES_SUPERCEDE;
}
if (equal(sample[14], "hit", 3)) {
if (sample[17] == 'w') {
engfunc(EngFunc_EmitSound, id, channel, KNIFE_WALL, volume, attn, flags, pitch)
return FMRES_SUPERCEDE;
}
else {
switch (random_num(1, 4)) {
case 1: engfunc(EngFunc_EmitSound, id, channel, KNIFE_HIT1, volume, attn, flags, pitch)
case 2: engfunc(EngFunc_EmitSound, id, channel, KNIFE_HIT2, volume, attn, flags, pitch)
case 3: engfunc(EngFunc_EmitSound, id, channel, KNIFE_HIT3, volume, attn, flags, pitch)
case 4: engfunc(EngFunc_EmitSound, id, channel, KNIFE_HIT4, volume, attn, flags, pitch)
}
return FMRES_SUPERCEDE;
}
}
}
}
return FMRES_IGNORED
}