مرحبا شباب ممكت تعملولي من هل الاشياء بلجن.SMA
ارجوكم لاني كل ما لدي اعملو بجي خطا حاولو تصلحو اليوم وتسلمو على المساعدة وشكرا :]
/* [ZP] KnifeMod v1.0 */
#include
#include
#include
#include
#include
#include
// VIP flag
#define VIP ADMIN_LEVEL_B
// Knifes
enum {
mastercombat = 1,
razor,
strong,
axe,
katana,
hammer
}
// Knifes parametres
enum {
name = 0,
v_model,
p_model,
sound_path
}
new knife[7][4][64] = {
{"\yStandart", "models/v_knife.mdl", "models/p_knife.mdl", "weapon/"},
{"\yذœذ°رپر‚ذµر€ ذ؛ذ¾ذ¼ذ±ذ°ر‚\r[ذ،ر‚ذ°ذ½ذ´ذ°ر€ر‚]", "models/zp_knife/v_mastercombatknife.mdl","models/zp_knife/p_mastercombatknife.mdl", "zp_knife/mastercombat/"},
{"\yذ،ر‚ر€ذ¾ذ½ذ³\r[ذ£ر€ذ¾ذ½]", "models/zp_knife/v_strong_knife.mdl", "models/zp_knife/p_strong_knife.mdl", "zp_knife/strong/"},
{"\yذگر…ذµ\r[ذ“ر€ذ°ذ²ذ¸ر‚ذ¸]", "models/zp_knife/v_axe_knife.mdl", "models/zp_knife/p_axe_knife.mdl", "zp_knife/axe/"},
{"\yذڑذ°ر‚ذ°ذ½ذ°\r[ذر‚ذ±ر€ذ¾رپ]", "models/zp_knife/v_katana.mdl", "models/zp_knife/p_katana.mdl", "zp_knife/katana/"},
{"\rذڑرƒذ²ذ°ذ»ذ´ذ° [ذگذ´ذ¼ذ¸ذ½/ذ’ذ¸ذ؟]", "models/zp_knife/v_hammer.mdl", "models/zp_knife/p_hammer.mdl", "zp_knife/hammer/"}
new g_knife_mastercombat[33], cvar_knife_mastercombat_jump, cvar_knife_mastercombat_spd, cvar_knife_mastercombat_dmg, cvar_knife_mastercombat_knock, cvar_knife_mastercombat_spd_attack2
new g_knife_strong[33], cvar_knife_strong_jump, cvar_knife_strong_spd, cvar_knife_strong_dmg, cvar_knife_strong_knock, cvar_knife_strong_spd_attack2
new g_knife_axe[33], cvar_knife_axe_jump, cvar_knife_axe_spd, cvar_knife_axe_dmg, cvar_knife_axe_knock, cvar_knife_axe_spd_attack2
new g_knife_katana[33], cvar_knife_katana_jump, cvar_knife_katana_spd, cvar_knife_katana_dmg, cvar_knife_katana_knock, cvar_knife_katana_spd_attack2
new g_knife_hammer[33], cvar_knife_hammer_jump, cvar_knife_hammer_spd, cvar_knife_hammer_dmg, cvar_knife_hammer_knock, cvar_hammer_spd_attack2
new cvar_DMG
public plugin_init() {
register_plugin("[ZP] Knife Mod", "1.2", "ذذµر‚ ذ¸ذ¼ذµذ½ذ¸ ذ°ذ²ر‚ذ¾ر€ذ°");
register_event("CurWeapon", "eventCurWeapon", "be");
register_forward(FM_EmitSound, "forwardEmitSound");
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
cvar_DMG = register_cvar("zp_xDMG", "5")
register_clcmd("say /knife", "knifesMenu", VIP, "[ZP] KnifeMod");
register_clcmd("knife", "knifesMenu", VIP, "[ZP] KnifeMod");
cvar_knife_mastercombat_jump= register_cvar("zp_knife_combat_jump", "270.0");
cvar_knife_mastercombat_spd = register_cvar("zp_knife_combat_spd", "290.0");
cvar_knife_mastercombat_dmg = register_cvar("zp_knife_combat_dmg" , "5.0");
cvar_knife_mastercombat_knock = register_cvar("zp_knife_combat_knock" , "6.0");
cvar_knife_mastercombat_spd_attack2 = register_cvar("zp_knife_combat_spd_attack2" , "1.0");
cvar_knife_strong_jump = register_cvar("zp_knife_strong_jump", "299.0");
cvar_knife_strong_spd = register_cvar("zp_knife_strong_spd", "280.0");
cvar_knife_strong_dmg = register_cvar("zp_knife_strong_dmg" , "9.0");
cvar_knife_strong_knock = register_cvar("zp_knife_strong_knock" , "8.0");
cvar_knife_strong_spd_attack2 = register_cvar("zp_knife_strong_spd_attack2" , "1.8");
cvar_knife_axe_jump = register_cvar("zp_knife_axe_jump", "335.0");
cvar_knife_axe_spd = register_cvar("zp_knife_axe_spd", "270.0");
cvar_knife_axe_dmg = register_cvar("zp_knife_axe_dmg" , "6.0");
cvar_knife_axe_knock = register_cvar("zp_knife_axe_knock" , "6.0");
cvar_knife_axe_spd_attack2 = register_cvar("zp_knife_axe_spd_attack2" , "1.5");
cvar_knife_katana_jump = register_cvar("zp_knife_katana_jump", "355.0");
cvar_knife_katana_spd = register_cvar("zp_knife_katana_spd", "290.0");
cvar_knife_katana_dmg = register_cvar("zp_knife_katana_dmg" , "5.5");
cvar_knife_katana_knock = register_cvar("zp_knife_katana_knock" , "12.5");
cvar_knife_katana_spd_attack2 = register_cvar("zp_knife_katana_spd_attack2" , "1.3");
cvar_knife_hammer_jump = register_cvar("zp_knife_hammer_jump", "400.0");
cvar_knife_hammer_spd= register_cvar("zp_knife_hammer_spd", "400.0");
cvar_knife_hammer_dmg = register_cvar("zp_knife_hammer_dmg" , "12.0");
cvar_knife_hammer_knock = register_cvar("zp_knife_hammer_knock" , "13.0");
cvar_hammer_spd_attack2 = register_cvar("zp_knife_hammer_spd_attack2" , "1.5");
register_event("HLTV", "event_round_start", "a", "1=0", "2=0
}
public plugin_precache() {
for(new i = 1; i <= 6; i++) {
precache_model(knife[i][1]);
precache_model(knife[i][2]);
}
precache_sound("zp_knife/mastercombat/knife_deploy1.wav");
precache_sound("zp_knife/mastercombat/knife_hit1.wav");
precache_sound("zp_knife/mastercombat/knife_hit2.wav");
precache_sound("zp_knife/mastercombat/knife_hit3.wav");
precache_sound("zp_knife/mastercombat/knife_hit4.wav");
precache_sound("zp_knife/mastercombat/knife_hitwall1.wav");
precache_sound("zp_knife/mastercombat/knife_slash1.wav");
precache_sound("zp_knife/mastercombat/knife_slash2.wav");
precache_sound("zp_knife/mastercombat/knife_stab.wav");
precache_sound("zp_knife/strong/knife_deploy1.wav");
precache_sound("zp_knife/strong/knife_hit1.wav");
precache_sound("zp_knife/strong/knife_hit2.wav");
precache_sound("zp_knife/strong/knife_hit3.wav");
precache_sound("zp_knife/strong/knife_hit4.wav");
precache_sound("zp_knife/strong/knife_hitwall1.wav");
precache_sound("zp_knife/strong/knife_slash1.wav");
precache_sound("zp_knife/strong/knife_slash2.wav");
precache_sound("zp_knife/strong/knife_stab.wav");
precache_sound("zp_knife/axe/knife_deploy1.wav");
precache_sound("zp_knife/axe/knife_hit1.wav");
precache_sound("zp_knife/axe/knife_hit2.wav");
precache_sound("zp_knife/axe/knife_hit3.wav");
precache_sound("zp_knife/axe/knife_hit4.wav");
precache_sound("zp_knife/axe/knife_hitwall1.wav");
precache_sound("zp_knife/axe/knife_slash1.wav");
precache_sound("zp_knife/axe/knife_slash2.wav");
precache_sound("zp_knife/axe/knife_stab.wav");
precache_sound("zp_knife/katana/knife_deploy1.wav");
precache_sound("zp_knife/katana/knife_hit1.wav");
precache_sound("zp_knife/katana/knife_hit2.wav");
precache_sound("zp_knife/katana/knife_hit3.wav");
precache_sound("zp_knife/katana/knife_hit4.wav");
precache_sound("zp_knife/katana/knife_hitwall1.wav");
precache_sound("zp_knife/katana/knife_slash1.wav");
precache_sound("zp_knife/katana/knife_slash2.wav");
precache_sound("zp_knife/katana/knife_stab.wav");
precache_sound("zp_knife/hammer/knife_deploy1.wav");
precache_sound("zp_knife/hammer/knife_hit1.wav");
precache_sound("zp_knife/hammer/knife_hit2.wav");
precache_sound("zp_knife/hammer/knife_hit3.wav");
precache_sound("zp_knife/hammer/knife_hit4.wav");
precache_sound("zp_knife/hammer/knife_hitwall1.wav");
precache_sound("zp_knife/hammer/knife_slash1.wav");
precache_sound("zp_knife/hammer/knife_slash2.wav");
precache_sound("zp_knife/hammer/knife_stab.wav");
}
public knifesMenu(id) {
if(!is_user_human(id))
client_print(id, print_chat, "");
return;
}
new menu = menu_create("\r[ذ’ر‹ذ±ذ¾ر€ ر‚ذ¸ذ؟ذ° ذ½ذ¾ذ¶ذ°]:", "menuHandler");
if(get_user_flags(id) & VIP) {
menu_additem(menu, knife[hammer][name]);
menu_additem(menu, knife[mastercombat][name]);
menu_additem(menu, knife[strong][name]);
menu_additem(menu, knife[katana][name]);
menu_additem(menu, knife[axe][name]);
}
else {
menu_additem(menu, "\d (ذ”ذ¾رپر‚رƒذ؟ذ½ذ¾ ذ°ذ´ذ¼ذ¸ذ½ذ°ذ¼");
}
menu_setprop(menu, MPROP_EXIT, -1);
menu_display(id, menu, 0);
return;
}
public menuHandler(id, menu, item) {
switch(item) {
case 0:{
if(get_user_flags(id) & VIP) {
playerKnife[id] = mastercombat;
}
case 1:{
if(get_user_flags(id) & VIP) {
playerKnife[id] = strong;
}
case 2:{
if(get_user_flags(id) & VIP) {
playerKnife[id] = axe;
}
case 3:{
if(get_user_flags(id) & VIP) {
playerKnife[id] = katana;
}
case 5:{
if(get_user_flags(id) & VIP) {
playerKnife[id] = hammer;
}
else {
knifesMenu(id);
return;
}
}
}
setKnife(id);
return;
}
public setKnife(id) {
if(!is_user_human(id)) {
return;
}
new model[64];
pev(id, pev_viewmodel2, model, charsmax(model));
if(contain(model, "knife.mdl") != -1) {
set_pev(id, pev_viewmodel2, knife[playerKnife[id]][v_model]);
set_pev(id, pev_weaponmodel2, knife[playerKnife[id]][p_model]);
}
return;
}
public eventCurWeapon(id) {
if(read_data(2) != CSW_KNIFE) {
return;
}
setKnife(id);
}
public forwardEmitSound(id, channel, const sound[]) {
if(!is_user_alive(id) || !is_user_human(id) || !playerKnife[id])
return FMRES_IGNORED;
if(containi(sound, "weapons/knife_") != -1) {
new knifeSound[65];
copy(knifeSound, charsmax(knifeSound), sound);
replace(knifeSound, charsmax(knifeSound), "weapons/", knife[playerKnife[id]][sound_path]);
engfunc(EngFunc_EmitSound, id, CHAN_WEAPON, knifeSound, 1.0, ATTN_NORM, 0, PITCH_NORM);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public client_putinserver(id) {
playerKnife[id] = random_num(1, 3);
setKnife(id);
return;
}
public client_disconnect(id) {
playerKnife[id] = 0;
return;
}
public is_user_human(id)
{
return !zp_get_user_zombie(id) && !zp_get_user_nemesis(id);
}
stock log_kill(killer, victim, weapon[],headshot) {
user_silentkill( victim );
message_begin( MSG_ALL, get_user_msgid( "DeathMsg" ), {0,0,0}, 0 );
write_byte( killer );
write_byte( victim );
write_byte( headshot );
write_string( weapon );
message_end();
new kfrags = get_user_frags( killer );
set_user_frags( killer, kfrags++ );
new vfrags = get_user_frags( victim );
set_user_frags( victim, vfrags++ );
return PLUGIN_CONTINUE
}
public fw_TakeDamage(victim, inflictor, attacker, Float: damage)
{
if(victim!=attacker)
{
if(is_user_connected(attacker))
{
if ( get_user_weapon( attacker ) == CSW_KNIFE && !zp_get_user_zombie(attacker))
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_DMG))
}
}
}
ارجوكم لاني كل ما لدي اعملو بجي خطا حاولو تصلحو اليوم وتسلمو على المساعدة وشكرا :]
/* [ZP] KnifeMod v1.0 */
#include
#include
#include
#include
#include
#include
// VIP flag
#define VIP ADMIN_LEVEL_B
// Knifes
enum {
mastercombat = 1,
razor,
strong,
axe,
katana,
hammer
}
// Knifes parametres
enum {
name = 0,
v_model,
p_model,
sound_path
}
new knife[7][4][64] = {
{"\yStandart", "models/v_knife.mdl", "models/p_knife.mdl", "weapon/"},
{"\yذœذ°رپر‚ذµر€ ذ؛ذ¾ذ¼ذ±ذ°ر‚\r[ذ،ر‚ذ°ذ½ذ´ذ°ر€ر‚]", "models/zp_knife/v_mastercombatknife.mdl","models/zp_knife/p_mastercombatknife.mdl", "zp_knife/mastercombat/"},
{"\yذ،ر‚ر€ذ¾ذ½ذ³\r[ذ£ر€ذ¾ذ½]", "models/zp_knife/v_strong_knife.mdl", "models/zp_knife/p_strong_knife.mdl", "zp_knife/strong/"},
{"\yذگر…ذµ\r[ذ“ر€ذ°ذ²ذ¸ر‚ذ¸]", "models/zp_knife/v_axe_knife.mdl", "models/zp_knife/p_axe_knife.mdl", "zp_knife/axe/"},
{"\yذڑذ°ر‚ذ°ذ½ذ°\r[ذر‚ذ±ر€ذ¾رپ]", "models/zp_knife/v_katana.mdl", "models/zp_knife/p_katana.mdl", "zp_knife/katana/"},
{"\rذڑرƒذ²ذ°ذ»ذ´ذ° [ذگذ´ذ¼ذ¸ذ½/ذ’ذ¸ذ؟]", "models/zp_knife/v_hammer.mdl", "models/zp_knife/p_hammer.mdl", "zp_knife/hammer/"}
new g_knife_mastercombat[33], cvar_knife_mastercombat_jump, cvar_knife_mastercombat_spd, cvar_knife_mastercombat_dmg, cvar_knife_mastercombat_knock, cvar_knife_mastercombat_spd_attack2
new g_knife_strong[33], cvar_knife_strong_jump, cvar_knife_strong_spd, cvar_knife_strong_dmg, cvar_knife_strong_knock, cvar_knife_strong_spd_attack2
new g_knife_axe[33], cvar_knife_axe_jump, cvar_knife_axe_spd, cvar_knife_axe_dmg, cvar_knife_axe_knock, cvar_knife_axe_spd_attack2
new g_knife_katana[33], cvar_knife_katana_jump, cvar_knife_katana_spd, cvar_knife_katana_dmg, cvar_knife_katana_knock, cvar_knife_katana_spd_attack2
new g_knife_hammer[33], cvar_knife_hammer_jump, cvar_knife_hammer_spd, cvar_knife_hammer_dmg, cvar_knife_hammer_knock, cvar_hammer_spd_attack2
new cvar_DMG
public plugin_init() {
register_plugin("[ZP] Knife Mod", "1.2", "ذذµر‚ ذ¸ذ¼ذµذ½ذ¸ ذ°ذ²ر‚ذ¾ر€ذ°");
register_event("CurWeapon", "eventCurWeapon", "be");
register_forward(FM_EmitSound, "forwardEmitSound");
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
cvar_DMG = register_cvar("zp_xDMG", "5")
register_clcmd("say /knife", "knifesMenu", VIP, "[ZP] KnifeMod");
register_clcmd("knife", "knifesMenu", VIP, "[ZP] KnifeMod");
cvar_knife_mastercombat_jump= register_cvar("zp_knife_combat_jump", "270.0");
cvar_knife_mastercombat_spd = register_cvar("zp_knife_combat_spd", "290.0");
cvar_knife_mastercombat_dmg = register_cvar("zp_knife_combat_dmg" , "5.0");
cvar_knife_mastercombat_knock = register_cvar("zp_knife_combat_knock" , "6.0");
cvar_knife_mastercombat_spd_attack2 = register_cvar("zp_knife_combat_spd_attack2" , "1.0");
cvar_knife_strong_jump = register_cvar("zp_knife_strong_jump", "299.0");
cvar_knife_strong_spd = register_cvar("zp_knife_strong_spd", "280.0");
cvar_knife_strong_dmg = register_cvar("zp_knife_strong_dmg" , "9.0");
cvar_knife_strong_knock = register_cvar("zp_knife_strong_knock" , "8.0");
cvar_knife_strong_spd_attack2 = register_cvar("zp_knife_strong_spd_attack2" , "1.8");
cvar_knife_axe_jump = register_cvar("zp_knife_axe_jump", "335.0");
cvar_knife_axe_spd = register_cvar("zp_knife_axe_spd", "270.0");
cvar_knife_axe_dmg = register_cvar("zp_knife_axe_dmg" , "6.0");
cvar_knife_axe_knock = register_cvar("zp_knife_axe_knock" , "6.0");
cvar_knife_axe_spd_attack2 = register_cvar("zp_knife_axe_spd_attack2" , "1.5");
cvar_knife_katana_jump = register_cvar("zp_knife_katana_jump", "355.0");
cvar_knife_katana_spd = register_cvar("zp_knife_katana_spd", "290.0");
cvar_knife_katana_dmg = register_cvar("zp_knife_katana_dmg" , "5.5");
cvar_knife_katana_knock = register_cvar("zp_knife_katana_knock" , "12.5");
cvar_knife_katana_spd_attack2 = register_cvar("zp_knife_katana_spd_attack2" , "1.3");
cvar_knife_hammer_jump = register_cvar("zp_knife_hammer_jump", "400.0");
cvar_knife_hammer_spd= register_cvar("zp_knife_hammer_spd", "400.0");
cvar_knife_hammer_dmg = register_cvar("zp_knife_hammer_dmg" , "12.0");
cvar_knife_hammer_knock = register_cvar("zp_knife_hammer_knock" , "13.0");
cvar_hammer_spd_attack2 = register_cvar("zp_knife_hammer_spd_attack2" , "1.5");
register_event("HLTV", "event_round_start", "a", "1=0", "2=0
}
public plugin_precache() {
for(new i = 1; i <= 6; i++) {
precache_model(knife[i][1]);
precache_model(knife[i][2]);
}
precache_sound("zp_knife/mastercombat/knife_deploy1.wav");
precache_sound("zp_knife/mastercombat/knife_hit1.wav");
precache_sound("zp_knife/mastercombat/knife_hit2.wav");
precache_sound("zp_knife/mastercombat/knife_hit3.wav");
precache_sound("zp_knife/mastercombat/knife_hit4.wav");
precache_sound("zp_knife/mastercombat/knife_hitwall1.wav");
precache_sound("zp_knife/mastercombat/knife_slash1.wav");
precache_sound("zp_knife/mastercombat/knife_slash2.wav");
precache_sound("zp_knife/mastercombat/knife_stab.wav");
precache_sound("zp_knife/strong/knife_deploy1.wav");
precache_sound("zp_knife/strong/knife_hit1.wav");
precache_sound("zp_knife/strong/knife_hit2.wav");
precache_sound("zp_knife/strong/knife_hit3.wav");
precache_sound("zp_knife/strong/knife_hit4.wav");
precache_sound("zp_knife/strong/knife_hitwall1.wav");
precache_sound("zp_knife/strong/knife_slash1.wav");
precache_sound("zp_knife/strong/knife_slash2.wav");
precache_sound("zp_knife/strong/knife_stab.wav");
precache_sound("zp_knife/axe/knife_deploy1.wav");
precache_sound("zp_knife/axe/knife_hit1.wav");
precache_sound("zp_knife/axe/knife_hit2.wav");
precache_sound("zp_knife/axe/knife_hit3.wav");
precache_sound("zp_knife/axe/knife_hit4.wav");
precache_sound("zp_knife/axe/knife_hitwall1.wav");
precache_sound("zp_knife/axe/knife_slash1.wav");
precache_sound("zp_knife/axe/knife_slash2.wav");
precache_sound("zp_knife/axe/knife_stab.wav");
precache_sound("zp_knife/katana/knife_deploy1.wav");
precache_sound("zp_knife/katana/knife_hit1.wav");
precache_sound("zp_knife/katana/knife_hit2.wav");
precache_sound("zp_knife/katana/knife_hit3.wav");
precache_sound("zp_knife/katana/knife_hit4.wav");
precache_sound("zp_knife/katana/knife_hitwall1.wav");
precache_sound("zp_knife/katana/knife_slash1.wav");
precache_sound("zp_knife/katana/knife_slash2.wav");
precache_sound("zp_knife/katana/knife_stab.wav");
precache_sound("zp_knife/hammer/knife_deploy1.wav");
precache_sound("zp_knife/hammer/knife_hit1.wav");
precache_sound("zp_knife/hammer/knife_hit2.wav");
precache_sound("zp_knife/hammer/knife_hit3.wav");
precache_sound("zp_knife/hammer/knife_hit4.wav");
precache_sound("zp_knife/hammer/knife_hitwall1.wav");
precache_sound("zp_knife/hammer/knife_slash1.wav");
precache_sound("zp_knife/hammer/knife_slash2.wav");
precache_sound("zp_knife/hammer/knife_stab.wav");
}
public knifesMenu(id) {
if(!is_user_human(id))
client_print(id, print_chat, "");
return;
}
new menu = menu_create("\r[ذ’ر‹ذ±ذ¾ر€ ر‚ذ¸ذ؟ذ° ذ½ذ¾ذ¶ذ°]:", "menuHandler");
if(get_user_flags(id) & VIP) {
menu_additem(menu, knife[hammer][name]);
menu_additem(menu, knife[mastercombat][name]);
menu_additem(menu, knife[strong][name]);
menu_additem(menu, knife[katana][name]);
menu_additem(menu, knife[axe][name]);
}
else {
menu_additem(menu, "\d (ذ”ذ¾رپر‚رƒذ؟ذ½ذ¾ ذ°ذ´ذ¼ذ¸ذ½ذ°ذ¼");
}
menu_setprop(menu, MPROP_EXIT, -1);
menu_display(id, menu, 0);
return;
}
public menuHandler(id, menu, item) {
switch(item) {
case 0:{
if(get_user_flags(id) & VIP) {
playerKnife[id] = mastercombat;
}
case 1:{
if(get_user_flags(id) & VIP) {
playerKnife[id] = strong;
}
case 2:{
if(get_user_flags(id) & VIP) {
playerKnife[id] = axe;
}
case 3:{
if(get_user_flags(id) & VIP) {
playerKnife[id] = katana;
}
case 5:{
if(get_user_flags(id) & VIP) {
playerKnife[id] = hammer;
}
else {
knifesMenu(id);
return;
}
}
}
setKnife(id);
return;
}
public setKnife(id) {
if(!is_user_human(id)) {
return;
}
new model[64];
pev(id, pev_viewmodel2, model, charsmax(model));
if(contain(model, "knife.mdl") != -1) {
set_pev(id, pev_viewmodel2, knife[playerKnife[id]][v_model]);
set_pev(id, pev_weaponmodel2, knife[playerKnife[id]][p_model]);
}
return;
}
public eventCurWeapon(id) {
if(read_data(2) != CSW_KNIFE) {
return;
}
setKnife(id);
}
public forwardEmitSound(id, channel, const sound[]) {
if(!is_user_alive(id) || !is_user_human(id) || !playerKnife[id])
return FMRES_IGNORED;
if(containi(sound, "weapons/knife_") != -1) {
new knifeSound[65];
copy(knifeSound, charsmax(knifeSound), sound);
replace(knifeSound, charsmax(knifeSound), "weapons/", knife[playerKnife[id]][sound_path]);
engfunc(EngFunc_EmitSound, id, CHAN_WEAPON, knifeSound, 1.0, ATTN_NORM, 0, PITCH_NORM);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public client_putinserver(id) {
playerKnife[id] = random_num(1, 3);
setKnife(id);
return;
}
public client_disconnect(id) {
playerKnife[id] = 0;
return;
}
public is_user_human(id)
{
return !zp_get_user_zombie(id) && !zp_get_user_nemesis(id);
}
stock log_kill(killer, victim, weapon[],headshot) {
user_silentkill( victim );
message_begin( MSG_ALL, get_user_msgid( "DeathMsg" ), {0,0,0}, 0 );
write_byte( killer );
write_byte( victim );
write_byte( headshot );
write_string( weapon );
message_end();
new kfrags = get_user_frags( killer );
set_user_frags( killer, kfrags++ );
new vfrags = get_user_frags( victim );
set_user_frags( victim, vfrags++ );
return PLUGIN_CONTINUE
}
public fw_TakeDamage(victim, inflictor, attacker, Float: damage)
{
if(victim!=attacker)
{
if(is_user_connected(attacker))
{
if ( get_user_weapon( attacker ) == CSW_KNIFE && !zp_get_user_zombie(attacker))
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_DMG))
}
}
}