Post by 6lackyy on Jul 27, 2022 13:39:55 GMT
hey, so i added many more knife menus into zp knife menu and there are no problems in compiling it, but when i join into map, select team then it freezes and crashes... in the logs theres nothing about plugin crashing, errors or anything...
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <engine>
#include <hamsandwich>
#include <zombieplague>
#define PLUGIN "Choose knifes"
#define VERSION "1.0"
#define AUTHOR "CHyC/4e/l"
#define VIP ADMIN_LEVEL_H
#define MAXPLAYERS 32
new nata_v_model[] = "models/bleky/nata/v_nata.mdl"
new combat_v_model[] = "models/bleky/combat/v_combat.mdl"
new daggers_v_model[] = "models/bleky/daggers/v_daggers.mdl"
new pickaxe_v_model[] = "models/bleky/pickaxe/v_pickaxe.mdl"
new crowbar_v_model[] = "models/bleky/crowbar/v_crowbar.mdl"
new crow_v_model[] = "models/bleky/crow/v_crow.mdl"
new balrog_v_model[] = "models/bleky/balrog/v_balrog.mdl"
new warfan_v_model[] = "models/bleky/warfan/v_warfan.mdl"
new janus_v_model[] = "models/bleky/janus/v_janus.mdl"
new miracle_v_model[] = "models/bleky/miracle/v_miracle.mdl"
new runebreak_v_model[] = "models/bleky/runebreak/v_runebreak.mdl"
new dualdark_v_model[] = "models/bleky/dualdark/v_dualdark.mdl"
new dreadnova_v_model[] = "models/bleky/dreadnova/v_dreadnova.mdl"
const m_pPlayer = 41
const m_flNextPrimaryAttack = 46
const m_flNextSecondaryAttack = 47
const m_flTimeWeaponIdle = 48
new g_hasSpeed[33], SayText
new bool:g_WasShowed[MAXPLAYERS + 1]
new g_knife_nata[33], cvar_knife_nata_jump, cvar_knife_nata_spd, cvar_knife_nata_dmg, cvar_knife_nata_knock, cvar_knife_nata_spd_attack2
new g_knife_combat[33], cvar_knife_combat_jump, cvar_knife_combat_spd, cvar_knife_combat_dmg, cvar_knife_combat_knock, cvar_knife_combat_spd_attack2
new g_knife_daggers[33], cvar_knife_daggers_jump, cvar_knife_daggers_spd, cvar_knife_daggers_dmg, cvar_knife_daggers_knock, cvar_knife_daggers_spd_attack2
new g_knife_pickaxe[33], cvar_knife_pickaxe_jump, cvar_knife_pickaxe_spd, cvar_knife_pickaxe_dmg, cvar_knife_pickaxe_knock, cvar_pickaxe_spd_attack2
new g_knife_crowbar[33], cvar_knife_crowbar_jump, cvar_knife_crowbar_spd, cvar_knife_crowbar_dmg, cvar_knife_crowbar_knock, cvar_crowbar_spd_attack2
new g_knife_crow[33], cvar_knife_crow_jump, cvar_knife_crow_spd, cvar_knife_crow_dmg, cvar_knife_crow_knock, cvar_crow_spd_attack2
new g_knife_balrog[33], cvar_knife_balrog_jump, cvar_knife_balrog_spd, cvar_knife_balrog_dmg, cvar_knife_balrog_knock, cvar_balrog_spd_attack2
new g_knife_warfan[33], cvar_knife_warfan_jump, cvar_knife_warfan_spd, cvar_knife_warfan_dmg, cvar_knife_warfan_knock, cvar_warfan_spd_attack2
new g_knife_janus[33], cvar_knife_janus_jump, cvar_knife_janus_spd, cvar_knife_janus_dmg, cvar_knife_janus_knock, cvar_janus_spd_attack2
new g_knife_miracle[33], cvar_knife_miracle_jump, cvar_knife_miracle_spd, cvar_knife_miracle_dmg, cvar_knife_miracle_knock, cvar_miracle_spd_attack2
new g_knife_runebreak[33], cvar_knife_runebreak_jump, cvar_knife_runebreak_spd, cvar_knife_runebreak_dmg, cvar_knife_runebreak_knock, cvar_runebreak_spd_attack2
new g_knife_dualdark[33], cvar_knife_dualdark_jump, cvar_knife_dualdark_spd, cvar_knife_dualdark_dmg, cvar_knife_dualdark_knock, cvar_dualdark_spd_attack2
new g_knife_dreadnova[33], cvar_knife_dreadnova_jump, cvar_knife_dreadnova_spd, cvar_knife_dreadnova_dmg, cvar_knife_dreadnova_knock, cvar_dreadnova_spd_attack2
new const g_sound_knife[] = { "items/gunpickup2.wav" }
new const nata_sounds[][] =
{
"bleky/nata/deploy.wav",
"bleky/nata/hit.wav",
"bleky/nata/hitwall.wav",
"bleky/nata/slash.wav",
"bleky/nata/stab.wav"
}
new const combat_sounds[][] =
{
"bleky/combat/deploy.wav",
"bleky/combat/hit.wav",
"bleky/combat/hitwall.wav",
"bleky/combat/slash.wav",
"bleky/combat/stab.wav"
}
new const daggers_sounds[][] =
{
"bleky/daggers/deploy.wav",
"bleky/daggers/hit.wav",
"bleky/daggers/hitwall.wav",
"bleky/daggers/slash.wav",
"bleky/daggers/stab.wav"
}
new const pickaxe_sounds[][] =
{
"bleky/pickaxe/deploy.wav",
"bleky/pickaxe/hit.wav",
"bleky/pickaxe/hitwall.wav",
"bleky/pickaxe/slash.wav",
"bleky/pickaxe/stab.wav"
}
new const crowbar_sounds[][] =
{
"bleky/crowbar/deploy.wav",
"bleky/crowbar/hit.wav",
"bleky/crowbar/hitwall.wav",
"bleky/crowbar/slash.wav",
"bleky/crowbar/stab.wav"
}
new const crow_sounds[][] =
{
"bleky/crow/deploy.wav",
"bleky/crow/hit.wav",
"bleky/crow/hitwall.wav",
"bleky/crow/slash.wav",
"bleky/crow/stab.wav"
}
new const balrog_sounds[][] =
{
"bleky/balrog/deploy.wav",
"bleky/balrog/hit.wav",
"bleky/balrog/hitwall.wav",
"bleky/balrog/slash.wav",
"bleky/balrog/stab.wav"
}
new const warfan_sounds[][] =
{
"bleky/warfan/deploy.wav",
"bleky/warfan/hit.wav",
"bleky/warfan/hitwall.wav",
"bleky/warfan/slash.wav",
"bleky/warfan/stab.wav"
}
new const janus_sounds[][] =
{
"bleky/janus/deploy.wav",
"bleky/janus/hit.wav",
"bleky/janus/hitwall.wav",
"bleky/janus/slash.wav",
"bleky/janus/stab.wav"
}
new const miracle_sounds[][] =
{
"bleky/miracle/deploy.wav",
"bleky/miracle/hit.wav",
"bleky/miracle/hitwall.wav",
"bleky/miracle/slash.wav",
"bleky/miracle/stab.wav"
}
new const runebreak_sounds[][] =
{
"bleky/runebreak/deploy.wav",
"bleky/runebreak/hit.wav",
"bleky/runebreak/hitwall.wav",
"bleky/runebreak/slash.wav",
"bleky/runebreak/stab.wav"
}
new const dualdark_sounds[][] =
{
"bleky/dualdark/deploy.wav",
"bleky/dualdark/hit.wav",
"bleky/dualdark/hitwall.wav",
"bleky/dualdark/slash.wav",
"bleky/dualdark/stab.wav"
}
new const dreadnova_sounds[][] =
{
"bleky/dreadnova/deploy.wav",
"bleky/dreadnova/hit.wav",
"bleky/dreadnova/hitwall.wav",
"bleky/dreadnova/slash.wav",
"bleky/dreadnova/stab.wav"
}
new const oldknife_sounds[][] =
{
"weapons/knife_deploy1.wav",
"weapons/knife_hit1.wav",
"weapons/knife_hit2.wav",
"weapons/knife_hit3.wav",
"weapons/knife_hit4.wav",
"weapons/knife_hitwall1.wav",
"weapons/knife_slash1.wav",
"weapons/knife_slash2.wav",
"weapons/knife_stab.wav"
}
public plugin_init()
{
register_plugin(PLUGIN , VERSION , AUTHOR);
register_cvar("zp_addon_knife", VERSION, FCVAR_SERVER);
SayText = get_user_msgid("SayText")
register_clcmd("say /knife","knife_menu",ADMIN_ALL,"knife_menu")
register_clcmd("/knife","knife_menu",ADMIN_ALL,"knife_menu")
register_event("CurWeapon","checkWeapon","be","1=1");
register_event("Damage" , "event_Damage" , "b" , "2>0");
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
register_forward(FM_EmitSound, "fw_EmitSound");
register_message(get_user_msgid("DeathMsg"), "message_DeathMsg");
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "fw_Knife_SecondaryAttack_Post", 1)
cvar_knife_nata_jump= register_cvar("zp_knife_nata_jump", "355.0");
cvar_knife_nata_spd = register_cvar("zp_knife_nata_spd", "255.0");
cvar_knife_nata_dmg = register_cvar("zp_knife_nata_dmg" , "3.0");
cvar_knife_nata_knock = register_cvar("zp_knife_nata_knock" , "6.0");
cvar_knife_nata_spd_attack2 = register_cvar("zp_knife_nata_spd_attack2" , "1.6");
cvar_knife_combat_jump= register_cvar("zp_knife_combat_jump", "355.0");
cvar_knife_combat_spd = register_cvar("zp_knife_combat_spd", "255.0");
cvar_knife_combat_dmg = register_cvar("zp_knife_combat_dmg" , "4.5");
cvar_knife_combat_knock = register_cvar("zp_knife_combat_knock" , "6.0");
cvar_knife_combat_spd_attack2 = register_cvar("zp_knife_combat_spd_attack2" , "1.4");
cvar_knife_daggers_jump= register_cvar("zp_knife_daggers_jump", "355.0");
cvar_knife_daggers_spd = register_cvar("zp_knife_daggers_spd", "255.0");
cvar_knife_daggers_dmg = register_cvar("zp_knife_daggers_dmg" , "5.0");
cvar_knife_daggers_knock = register_cvar("zp_knife_daggers_knock" , "6.0");
cvar_knife_daggers_spd_attack2 = register_cvar("zp_knife_daggers_spd_attack2" , "1.2");
cvar_knife_pickaxe_jump= register_cvar("zp_knife_pickaxe_jump", "355.0");
cvar_knife_pickaxe_spd= register_cvar("zp_knife_pickaxe_spd", "255.0");
cvar_knife_pickaxe_dmg = register_cvar("zp_knife_pickaxe_dmg" , "5.5");
cvar_knife_pickaxe_knock = register_cvar("zp_knife_pickaxe_knock" , "6.0");
cvar_pickaxe_spd_attack2 = register_cvar("zp_knife_pickaxe_spd_attack2" , "1.4");
cvar_knife_crowbar_jump= register_cvar("zp_knife_crowbar_jump", "355.0");
cvar_knife_crowbar_spd= register_cvar("zp_knife_crowbar_spd", "255.0");
cvar_knife_crowbar_dmg = register_cvar("zp_knife_crowbar_dmg" , "6.0");
cvar_knife_crowbar_knock = register_cvar("zp_knife_crowbar_knock" , "6.0");
cvar_crowbar_spd_attack2 = register_cvar("zp_knife_crowbar_spd_attack2" , "1.2");
cvar_knife_crow_jump= register_cvar("zp_knife_crow_jump", "355.0");
cvar_knife_crow_spd= register_cvar("zp_knife_crow_spd", "255.0");
cvar_knife_crow_dmg = register_cvar("zp_knife_crow_dmg" , "6.5");
cvar_knife_crow_knock = register_cvar("zp_knife_crow_knock" , "6.0");
cvar_crow_spd_attack2 = register_cvar("zp_knife_crow_spd_attack2" , "1.5");
cvar_knife_balrog_jump= register_cvar("zp_knife_balrog_jump", "355.5");
cvar_knife_balrog_spd= register_cvar("zp_knife_balrog_spd", "255.0");
cvar_knife_balrog_dmg = register_cvar("zp_knife_balrog_dmg" , "7.0");
cvar_knife_balrog_knock = register_cvar("zp_knife_balrog_knock" , "6.0");
cvar_balrog_spd_attack2 = register_cvar("zp_knife_balrog_spd_attack2" , "1.6");
cvar_knife_warfan_jump= register_cvar("zp_knife_warfan_jump", "360.0");
cvar_knife_warfan_spd= register_cvar("zp_knife_warfan_spd", "255.0");
cvar_knife_warfan_dmg = register_cvar("zp_knife_warfan_dmg" , "7.5");
cvar_knife_warfan_knock = register_cvar("zp_knife_warfan_knock" , "6.0");
cvar_warfan_spd_attack2 = register_cvar("zp_knife_warfan_spd_attack2" , "1.4");
cvar_knife_janus_jump= register_cvar("zp_knife_janus_jump", "360.5");
cvar_knife_janus_spd= register_cvar("zp_knife_janus_spd", "255.0");
cvar_knife_janus_dmg = register_cvar("zp_knife_janus_dmg" , "8.0");
cvar_knife_janus_knock = register_cvar("zp_knife_janus_knock" , "6.0");
cvar_janus_spd_attack2 = register_cvar("zp_knife_janus_spd_attack2" , "1.6");
cvar_knife_miracle_jump= register_cvar("zp_knife_miracle_jump", "365.0");
cvar_knife_miracle_spd= register_cvar("zp_knife_miracle_spd", "255.0");
cvar_knife_miracle_dmg = register_cvar("zp_knife_miracle_dmg" , "8.5");
cvar_knife_miracle_knock = register_cvar("zp_knife_miracle_knock" , "15.0");
cvar_miracle_spd_attack2 = register_cvar("zp_knife_miracle_spd_attack2" , "1.5");
cvar_knife_runebreak_jump= register_cvar("zp_knife_runebreak_jump", "365.5");
cvar_knife_runebreak_spd= register_cvar("zp_knife_runebreak_spd", "255.0");
cvar_knife_runebreak_dmg = register_cvar("zp_knife_runebreak_dmg" , "9.0");
cvar_knife_runebreak_knock = register_cvar("zp_knife_runebreak_knock" , "6.0");
cvar_runebreak_spd_attack2 = register_cvar("zp_knife_runebreak_spd_attack2" , "1.6");
cvar_knife_dualdark_jump= register_cvar("zp_knife_dualdark_jump", "370.0");
cvar_knife_dualdark_spd= register_cvar("zp_knife_dualdark_spd", "255.0");
cvar_knife_dualdark_dmg = register_cvar("zp_knife_dualdark_dmg" , "11");
cvar_knife_dualdark_knock = register_cvar("zp_knife_dualdark_knock" , "6.0");
cvar_dualdark_spd_attack2 = register_cvar("zp_knife_dualdark_spd_attack2" , "1.4");
cvar_knife_dreadnova_jump= register_cvar("zp_knife_dreadnova_jump", "375.0");
cvar_knife_dreadnova_spd= register_cvar("zp_knife_dreadnova_spd", "255.0");
cvar_knife_dreadnova_dmg = register_cvar("zp_knife_dreadnova_dmg" , "14.5");
cvar_knife_dreadnova_knock = register_cvar("zp_knife_dreadnova_knock" , "6.0");
cvar_dreadnova_spd_attack2 = register_cvar("zp_knife_dreadnova_spd_attack2" , "1.5");
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}
public client_connect(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = false
}
public client_disconnect(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = false
}
public plugin_precache()
{
precache_model(nata_v_model)
precache_model(combat_v_model)
precache_model(daggers_v_model)
precache_model(pickaxe_v_model)
precache_model(crowbar_v_model)
precache_model(crow_v_model)
precache_model(balrog_v_model)
precache_model(warfan_v_model)
precache_model(janus_v_model)
precache_model(miracle_v_model)
precache_model(runebreak_v_model)
precache_model(dualdark_v_model)
precache_model(dreadnova_v_model)
precache_sound(g_sound_knife)
for(new i = 0; i < sizeof combat_sounds; i++)
precache_sound(combat_sounds[i])
for(new i = 0; i < sizeof nata_sounds; i++)
precache_sound(nata_sounds[i])
for(new i = 0; i < sizeof combat_sounds; i++)
precache_sound(combat_sounds[i])
for(new i = 0; i < sizeof daggers_sounds; i++)
precache_sound(daggers_sounds[i])
for(new i = 0; i < sizeof pickaxe_sounds; i++)
precache_sound(pickaxe_sounds[i])
for(new i = 0; i < sizeof crowbar_sounds; i++)
precache_sound(crowbar_sounds[i])
for(new i = 0; i < sizeof crow_sounds; i++)
precache_sound(crow_sounds[i])
for(new i = 0; i < sizeof balrog_sounds; i++)
precache_sound(balrog_sounds[i])
for(new i = 0; i < sizeof warfan_sounds; i++)
precache_sound(warfan_sounds[i])
for(new i = 0; i < sizeof janus_sounds; i++)
precache_sound(janus_sounds[i])
for(new i = 0; i < sizeof miracle_sounds; i++)
precache_sound(miracle_sounds[i])
for(new i = 0; i < sizeof runebreak_sounds; i++)
precache_sound(runebreak_sounds[i])
for(new i = 0; i < sizeof dualdark_sounds; i++)
precache_sound(dualdark_sounds[i])
for(new i = 0; i < sizeof dreadnova_sounds; i++)
precache_sound(dreadnova_sounds[i])
}
public event_round_start(id)
{
for (new i; i < MAXPLAYERS + 1; i++)
g_WasShowed[i] = false
}
public knife_menu(id)
{
if (g_WasShowed[id])
{
print_col_chat(id, "^1[^4ZP^1] Knife menu can be opened once per round!")
return PLUGIN_HANDLED
}
if(is_user_alive(id) && !zp_get_user_zombie(id))
{
my_menu(id)
}
return PLUGIN_HANDLED
}
public my_menu(id)
{
new menu = menu_create("\yChose your knife!", "menu_handler");
menu_additem(menu, "\wNata Knife \r[ LVL 0 ]", "2", 0);
menu_additem(menu, "\wCombat \r[ LVL 5 ]", "3", 0);
menu_additem(menu, "\wDaggers \r[ LVL 10 ]", "4", 0);
menu_additem(menu, "\wPickaxe \r[ LVL 15 ]", "5", 0);
menu_additem(menu, "\wMaverick Crowbar \r[ LVL 20 ]", "6", 0);
menu_additem(menu, "\wCrow-9 \r[ LVL 25 ]", "7", 0);
menu_additem(menu, "\wBalrog-IX \r[ LVL 30 ]", "8", 0);
menu_additem(menu, "\wWar Fan \r[ LVL 35 ]", "9", 0);
menu_additem(menu, "\wJanus-9 \r[ LVL 40 ]", "10", 0);
menu_additem(menu, "\wMiracle Sword \r[ LVL 45 ]", "11", 0);
menu_additem(menu, "\wBlade Runebreaker \r[ LVL 50 ]", "12", 0);
menu_additem(menu, "\wDual Dark Spirit \r[ LVL 55 ]", "13", 0);
menu_additem(menu, "\wDread Nova \r[ ADMIN ]", "14", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
give_nata(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 2:
{
give_combat(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 3:
{
give_daggers(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 4:
{
give_pickaxe(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 5:
{
give_crowbar(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 6:
{
give_crow(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 7:
{
give_balrog(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 8:
{
give_warfan(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 9:
{
give_janus(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 10:
{
give_miracle(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 11:
{
give_runebreak(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 12:
{
give_dualdark(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 13:
{
give_dreadnova(id)
menu_destroy(menu);
return PLUGIN_HANDLED
}
}
menu_destroy(menu);
return PLUGIN_HANDLED
}
public give_nata(id)
{
g_knife_nata[id] = true
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_combat(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = true
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_daggers(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = true
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_pickaxe(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = true
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_crowbar(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = true
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_crow(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = true
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_balrog(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = true
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_warfan(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = true
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_janus(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = true
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_miracle(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = true
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_runebreak(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = true
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_dualdark(id)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = true
g_knife_dreadnova[id] = false
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public give_dreadnova(id)
{
if (get_user_flags(id) & VIP)
{
g_knife_nata[id] = false
g_knife_combat[id] = false
g_knife_daggers[id] = false
g_knife_pickaxe[id] = false
g_knife_crowbar[id] = false
g_knife_crow[id] = false
g_knife_balrog[id] = false
g_knife_warfan[id] = false
g_knife_janus[id] = false
g_knife_miracle[id] = false
g_knife_runebreak[id] = false
g_knife_dualdark[id] = false
g_knife_dreadnova[id] = true
g_hasSpeed[id] = true
g_WasShowed[id] = true
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
else
{
client_cmd(id, "/knife")
g_WasShowed[id] = true
}
}
public checkWeapon(id)
{
new plrWeapId
plrWeapId = get_user_weapon(id)
if (plrWeapId == CSW_KNIFE && (g_knife_nata[id] || g_knife_combat[id] || g_knife_daggers[id] || g_knife_pickaxe[id] || g_knife_crowbar[id] || g_knife_crow[id] || g_knife_balrog[id] || g_knife_warfan[id] || g_knife_janus[id] || g_knife_miracle[id] || g_knife_runebreak[id] || g_knife_dualdark[id] || g_knife_dreadnova[id]))
{
checkModel(id)
}
}
public checkModel(id)
{
if (zp_get_user_zombie(id))
return PLUGIN_HANDLED
if (g_knife_nata[id])
{
set_pev(id, pev_viewmodel2, nata_v_model)
}
if (g_knife_combat[id])
{
set_pev(id, pev_viewmodel2, combat_v_model)
}
if (g_knife_daggers[id])
{
set_pev(id, pev_viewmodel2, daggers_v_model)
}
if (g_knife_pickaxe[id])
{
set_pev(id, pev_viewmodel2, pickaxe_v_model)
}
if (g_knife_crowbar[id])
{
set_pev(id, pev_viewmodel2, crowbar_v_model)
}
if (g_knife_crow[id])
{
set_pev(id, pev_viewmodel2, crow_v_model)
}
if (g_knife_balrog[id])
{
set_pev(id, pev_viewmodel2, balrog_v_model)
}
if (g_knife_warfan[id])
{
set_pev(id, pev_viewmodel2, warfan_v_model)
}
if (g_knife_janus[id])
{
set_pev(id, pev_viewmodel2, janus_v_model)
}
if (g_knife_miracle[id])
{
set_pev(id, pev_viewmodel2, miracle_v_model)
}
if (g_knife_runebreak[id])
{
set_pev(id, pev_viewmodel2, runebreak_v_model)
}
if (g_knife_dualdark[id])
{
set_pev(id, pev_viewmodel2, dualdark_v_model)
}
if (g_knife_dreadnova[id])
{
set_pev(id, pev_viewmodel2, dreadnova_v_model)
}
return PLUGIN_HANDLED
}
public fw_EmitSound(id, channel, const sound[])
{
if(!is_user_alive(id) || zp_get_user_zombie(id))
return FMRES_IGNORED
for(new i = 0; i < sizeof nata_sounds; i++)
for(new i = 0; i < sizeof combat_sounds; i++)
for(new i = 0; i < sizeof daggers_sounds; i++)
for(new i = 0; i < sizeof pickaxe_sounds; i++)
for(new i = 0; i < sizeof crowbar_sounds; i++)
for(new i = 0; i < sizeof crow_sounds; i++)
for(new i = 0; i < sizeof balrog_sounds; i++)
for(new i = 0; i < sizeof warfan_sounds; i++)
for(new i = 0; i < sizeof janus_sounds; i++)
for(new i = 0; i < sizeof miracle_sounds; i++)
for(new i = 0; i < sizeof runebreak_sounds; i++)
for(new i = 0; i < sizeof dualdark_sounds; i++)
for(new i = 0; i < sizeof dreadnova_sounds; i++)
{
if(equal(sound, oldknife_sounds[i]))
{
if (g_knife_nata[id])
{
emit_sound(id, channel, nata_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_combat[id])
{
emit_sound(id, channel, combat_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_daggers[id])
{
emit_sound(id, channel, daggers_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_pickaxe[id])
{
emit_sound(id, channel, pickaxe_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_crowbar[id])
{
emit_sound(id, channel, crowbar_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_crow[id])
{
emit_sound(id, channel, crow_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_balrog[id])
{
emit_sound(id, channel, balrog_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_warfan[id])
{
emit_sound(id, channel, warfan_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_janus[id])
{
emit_sound(id, channel, janus_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_miracle[id])
{
emit_sound(id, channel, miracle_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_runebreak[id])
{
emit_sound(id, channel, runebreak_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_dualdark[id])
{
emit_sound(id, channel, dualdark_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (g_knife_dreadnova[id])
{
emit_sound(id, channel, dreadnova_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
if (!g_knife_combat[id] || !g_knife_nata[id] || !g_knife_combat[id] || !g_knife_daggers[id] || !g_knife_pickaxe[id] || !g_knife_crowbar[id] || !g_knife_crow[id] || !g_knife_balrog[id] || !g_knife_warfan[id] || !g_knife_janus[id] || !g_knife_miracle[id] || !g_knife_runebreak[id] || !g_knife_dualdark[id] || !g_knife_dreadnova[id])
{
emit_sound(id, channel, oldknife_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
}
}
return FMRES_IGNORED
}
public message_DeathMsg(msg_id, msg_dest, id)
{
static szTruncatedWeapon[33], iattacker, ivictim
get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
iattacker = get_msg_arg_int(1)
ivictim = get_msg_arg_int(2)
if(!is_user_connected(iattacker) || iattacker == ivictim)
return PLUGIN_CONTINUE
if (!zp_get_user_zombie(iattacker))
{
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_nata[iattacker])
set_msg_arg_string(4, "nata knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_combat[iattacker])
set_msg_arg_string(4, "combat knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_daggers[iattacker])
set_msg_arg_string(4, "daggers knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_pickaxe[iattacker])
set_msg_arg_string(4, "pickaxe knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_pickaxe[iattacker])
set_msg_arg_string(4, "crowbar knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_pickaxe[iattacker])
set_msg_arg_string(4, "crow knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_pickaxe[iattacker])
set_msg_arg_string(4, "balrog knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_pickaxe[iattacker])
set_msg_arg_string(4, "warfan knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_pickaxe[iattacker])
set_msg_arg_string(4, "janus knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_pickaxe[iattacker])
set_msg_arg_string(4, "miracle knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_pickaxe[iattacker])
set_msg_arg_string(4, "runebreak knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_pickaxe[iattacker])
set_msg_arg_string(4, "dualdark knife")
}
if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_knife_pickaxe[iattacker])
set_msg_arg_string(4, "dreadnova knife")
}
}
return PLUGIN_CONTINUE
}
stock print_col_chat(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^4"); // Green Color
replace_all(msg, 190, "!y", "^1"); // Default Color
replace_all(msg, 190, "!t", "^3"); // Team Color
if (id) players[0] = id; else get_players(players, count, "ch");
{
for ( new i = 0; i < count; i++ )
{
if ( is_user_connected(players[i]) )
{
message_begin(MSG_ONE_UNRELIABLE, SayText, _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
public fw_PlayerPreThink(id)
{
if(!is_user_alive(id) || zp_get_user_zombie(id))
return FMRES_IGNORED
new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
if (weapon == CSW_KNIFE && g_knife_nata[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_nata_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_nata_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_combat[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_combat_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_combat_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_daggers[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_daggers_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_daggers_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_pickaxe[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_pickaxe_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_pickaxe_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_crowbar[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_crowbar_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_crowbar_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_crow[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_crow_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_crow_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_balrog[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_balrog_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_balrog_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_warfan[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_warfan_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_warfan_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_janus[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_janus_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_janus_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_miracle[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_miracle_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_miracle_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_runebreak[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_runebreak_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_runebreak_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_dualdark[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_dualdark_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_dualdark_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if (weapon == CSW_KNIFE && g_knife_dreadnova[id])
{
g_hasSpeed[id] = true
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_knife_dreadnova_spd))
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)
if (!(flags & FL_ONGROUND))
return FMRES_IGNORED
if (flags & FL_WATERJUMP)
return FMRES_IGNORED
if (waterlvl > 1)
return FMRES_IGNORED
new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)
fVelocity[2] += get_pcvar_num(cvar_knife_dreadnova_jump)
set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
return FMRES_IGNORED
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if(!is_user_connected(attacker))
return HAM_IGNORED
if(zp_get_user_zombie(attacker))
return HAM_IGNORED
new weapon = get_user_weapon(attacker)
if (weapon == CSW_KNIFE && g_knife_nata[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_nata_dmg))
}
if (weapon == CSW_KNIFE && g_knife_combat[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_combat_dmg))
}
if (weapon == CSW_KNIFE && g_knife_daggers[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_daggers_dmg))
}
if (weapon == CSW_KNIFE && g_knife_pickaxe[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_pickaxe_dmg))
}
if (weapon == CSW_KNIFE && g_knife_crowbar[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_crowbar_dmg))
}
if (weapon == CSW_KNIFE && g_knife_crow[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_crow_dmg))
}
if (weapon == CSW_KNIFE && g_knife_balrog[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_balrog_dmg))
}
if (weapon == CSW_KNIFE && g_knife_warfan[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_warfan_dmg))
}
if (weapon == CSW_KNIFE && g_knife_janus[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_janus_dmg))
}
if (weapon == CSW_KNIFE && g_knife_miracle[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_miracle_dmg))
}
if (weapon == CSW_KNIFE && g_knife_runebreak[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_runebreak_dmg))
}
if (weapon == CSW_KNIFE && g_knife_dualdark[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_dualdark_dmg))
}
if (weapon == CSW_KNIFE && g_knife_dreadnova[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_dreadnova_dmg))
}
return HAM_IGNORED
}
public fw_Knife_SecondaryAttack_Post(knife)
{
static id
id = get_pdata_cbase(knife, m_pPlayer, 4)
if(zp_get_user_zombie(id))
return HAM_IGNORED
if(is_user_connected(id) && g_knife_nata[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_knife_nata_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_combat[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_knife_combat_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_daggers[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_knife_daggers_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_pickaxe[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_pickaxe_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_crowbar[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_crowbar_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_crow[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_crow_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_balrog[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_balrog_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_warfan[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_warfan_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_janus[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_janus_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_miracle[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_miracle_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_runebreak[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_runebreak_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_dualdark[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_dualdark_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
if(is_user_connected(id) && g_knife_dreadnova[id])
{
static Float:flRate
flRate = get_pcvar_float(cvar_dreadnova_spd_attack2)
set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)
set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)
set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)
}
return HAM_IGNORED
}
public event_Damage(id)
{
new weapon , attacker = get_user_attacker(id , weapon);
if(!is_user_alive(attacker))
return PLUGIN_CONTINUE;
if(weapon == CSW_KNIFE && g_knife_nata[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_combat[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_daggers[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_pickaxe[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_crowbar[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_crow[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_balrog[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_warfan[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_janus[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_miracle[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_runebreak[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_dualdark[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
if(weapon == CSW_KNIFE && g_knife_dreadnova[attacker])
{
new Float:vec[3];
new Float:oldvelo[3];
get_user_velocity(id, oldvelo);
create_velocity_vector(id , attacker , vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id , vec);
}
return PLUGIN_CONTINUE;
}
stock create_velocity_vector(victim,attacker,Float:velocity[3])
{
if(!zp_get_user_zombie(victim) || !is_user_alive(attacker))
return 0;
new Float:vicorigin[3];
new Float:attorigin[3];
entity_get_vector(victim , EV_VEC_origin , vicorigin);
entity_get_vector(attacker , EV_VEC_origin , attorigin);
new Float:origin2[3]
origin2[0] = vicorigin[0] - attorigin[0];
origin2[1] = vicorigin[1] - attorigin[1];
new Float:largestnum = 0.0;
if(floatabs(origin2[0])>largestnum) largestnum = floatabs(origin2[0]);
if(floatabs(origin2[1])>largestnum) largestnum = floatabs(origin2[1]);
origin2[0] /= largestnum;
origin2[1] /= largestnum;
if (g_knife_nata[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_nata_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_nata_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_combat[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_combat_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_combat_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_daggers[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_daggers_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_daggers_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_pickaxe[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_pickaxe_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_pickaxe_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_crowbar[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_crowbar_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_crowbar_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_crow[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_crow_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_crow_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_balrog[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_balrog_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_balrog_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_warfan[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_warfan_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_warfan_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_janus[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_janus_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_janus_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_miracle[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_miracle_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_miracle_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_runebreak[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_runebreak_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_runebreak_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_dualdark[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_dualdark_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_dualdark_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if (g_knife_dreadnova[attacker])
{
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_dreadnova_knock) * 3000) ) / get_entity_distance(victim , attacker);
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_dreadnova_knock) * 3000) ) / get_entity_distance(victim , attacker);
}
if(velocity[0] <= 20.0 || velocity[1] <= 20.0)
velocity[2] = random_float(200.0 , 275.0);
return 1;
}
public client_putinserver(id)
{
switch(random_num(0, 0))
{
case 0:
{
g_knife_nata[id] = true
g_hasSpeed[id] = true
}
}
}