Code:
.wrap {border: 1px solid transparent;border-radius: 8px;margin: 0 auto;- cel defaultmax-width: 1152px;min-width: 625px;padding: 15px;}
modificaCode:
.wrap {margin: 0 auto;- pentru ecran complet}
Code:
$legend = array();while ($row = $db->sql_fetchrow($result)){ $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : ''; $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))) { $legend[] = '<span' . $colour_text . '>' . $group_name . '</span>'; } else { $legend[] = '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>'; }}$db->sql_freeresult($result);$legend = implode(', ', $legend);
Code:
$legend = array();while ($row = $db->sql_fetchrow($result)){ $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : ''; $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))) { $legend[] = '.:: <span' . $colour_text . '>' . $group_name . '</span> ::.'; } else { $legend[] = '.::<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a> ::.'; }}$db->sql_freeresult($result);$legend = implode(' ', $legend); - pentru a arata .::Admin::. .::Smod::. ,etc
Statistics: Posted by Rainq — Fri Jan 19, 2024 11:19 am
Statistics: Posted by SuperioR — Wed Jan 17, 2024 8:00 pm
Code:
#include <amxmodx>#include <fakemeta>#include <fun> #include <engine> #include <hamsandwich>#include <zombieplague>#define PLUGIN "knifemenu"#define VERSION "1.0"#define AUTHOR "kgb-forum"#define MAXPLAYERS 32new combat_v_model[] = "models/zb/v_crowbarcso1.mdl"new combat_p_model[] = "models/p_knife.mdl"new strong_v_model[] = "models/zb/v_strong_knife.mdl"new strong_p_model[] = "models/zb/p_strong_knife.mdl"new axe_v_model[] = "models/zb/v_crowbarcso1.mdl" new axe_p_model[] = "models/p_knife.mdl" new katana_v_model[] = "models/zb/v_katana_knife.mdl" new katana_p_model[] = "models/zb/p_katana_knife.mdl"new hammer_v_model[] = "models/zb/v_hammer_knife.mdl" new hammer_p_model[] = "models/zb/p_hammer_knife.mdl"new g_hasSpeed[33]new bool:g_WasShowed[MAXPLAYERS + 1]new g_knife_combat[33], cvar_knife_combat_jump, cvar_knife_combat_dmg, cvar_knife_combat_knocknew g_knife_strong[33], cvar_knife_strong_jump, cvar_knife_strong_dmg, cvar_knife_strong_knocknew g_knife_axe[33], cvar_knife_axe_jump, cvar_knife_axe_dmg, cvar_knife_axe_knocknew g_knife_katana[33], cvar_knife_katana_jump, cvar_knife_katana_dmg, cvar_knife_katana_knocknew g_knife_hammer[33], cvar_knife_hammer_jump, cvar_knife_hammer_dmg, cvar_knife_hammer_knocknew const g_sound_knife[] = { "items/gunpickup2.wav" }new const combat_sounds[][] ={ "zmwpn/zb_knife/combat_deploy.wav", "zmwpn/zb_knife/combat_hit.wav" , "zmwpn/zb_knife/combat_hit.wav" , "zmwpn/zb_knife/combat_hit.wav" , "zmwpn/zb_knife/combat_hit.wav" , "zmwpn/zb_knife/combat_hitwall.wav", "zmwpn/zb_knife/combat_slash.wav", "zmwpn/zb_knife/combat_slash.wav", "zmwpn/zb_knife/combat_stab.wav"}new const strong_sounds[][] ={ "zmwpn/zb_knife/strong_deploy.wav", "zmwpn/zb_knife/strong_hit.wav", "zmwpn/zb_knife/strong_hit.wav", "zmwpn/zb_knife/strong_hit.wav", "zmwpn/zb_knife/strong_hit.wav", "zmwpn/zb_knife/strong_hitwall.wav", "zmwpn/zb_knife/strong_slash.wav", "zmwpn/zb_knife/strong_slash.wav", "zmwpn/zb_knife/strong_stab.wav"}new const axe_sounds[][] ={ "zmwpn/zb_knife/axe_deploy.wav", "zmwpn/zb_knife/axe_hit.wav", "zmwpn/zb_knife/axe_hit.wav", "zmwpn/zb_knife/axe_hit.wav", "zmwpn/zb_knife/axe_hit.wav", "zmwpn/zb_knife/axe_hitwall.wav", "zmwpn/zb_knife/axe_slash.wav", "zmwpn/zb_knife/axe_slash.wav", "zmwpn/zb_knife/axe_stab.wav"}new const katana_sounds[][] ={ "zmwpn/zb_knife/katana_deploy.wav", "zmwpn/zb_knife/katana_hit.wav", "zmwpn/zb_knife/katana_hit.wav", "zmwpn/zb_knife/katana_hit.wav", "zmwpn/zb_knife/katana_hit.wav", "zmwpn/zb_knife/katana_hitwall.wav", "zmwpn/zb_knife/katana_slash.wav", "zmwpn/zb_knife/katana_slash.wav", "zmwpn/zb_knife/katana_stab.wav"}new const hammer_sounds[][] ={ "zmwpn/zb_knife/hammer_deploy.wav", "zmwpn/zb_knife/hammer_hit.wav", "zmwpn/zb_knife/hammer_hit.wav", "zmwpn/zb_knife/hammer_hit.wav", "zmwpn/zb_knife/hammer_hit.wav", "zmwpn/zb_knife/hammer_hitwall.wav", "zmwpn/zb_knife/hammer_slash.wav", "zmwpn/zb_knife/hammer_slash.wav", "zmwpn/zb_knife/hammer_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); register_clcmd("say /knife","knife_menu",ADMIN_ALL,"knife_menu") register_clcmd("say_team /knife","knife_menu",ADMIN_ALL,"knife_menu") register_clcmd("combat", "give_combat") register_clcmd("strong", "give_strong") register_clcmd("axe", "give_axe") register_clcmd("katana", "give_katana") register_clcmd("hammer", "give_hammer") 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"); cvar_knife_combat_jump= register_cvar("zp_knife_combat_jump", "270.0"); cvar_knife_combat_dmg = register_cvar("zp_knife_combat_dmg" , "1.0"); cvar_knife_combat_knock = register_cvar("zp_knife_combat_knock" , "3.0"); cvar_knife_strong_jump= register_cvar("zp_knife_strong_jump", "265.0"); cvar_knife_strong_dmg = register_cvar("zp_knife_strong_dmg" , "1.0"); cvar_knife_strong_knock = register_cvar("zp_knife_strong_knock" , "3.0"); cvar_knife_axe_jump= register_cvar("zp_knife_axe_jump", "335.0"); cvar_knife_axe_dmg = register_cvar("zp_knife_axe_dmg" , "1.0"); cvar_knife_axe_knock = register_cvar("zp_knife_axe_knock" , "3.0"); cvar_knife_katana_jump= register_cvar("zp_knife_katana_jump", "275.0"); cvar_knife_katana_dmg = register_cvar("zp_knife_katana_dmg" , "1.0"); cvar_knife_katana_knock = register_cvar("zp_knife_katana_knock" , "3.0"); cvar_knife_hammer_jump= register_cvar("zp_knife_hammer_jump", "335.0"); cvar_knife_hammer_dmg = register_cvar("zp_knife_hammer_dmg" , "1.0"); cvar_knife_hammer_knock = register_cvar("zp_knife_hammer_knock" , "3.0"); register_event("HLTV", "event_round_start", "a", "1=0", "2=0")}public client_connect(id){ g_knife_combat[id] = false g_knife_strong[id] = false g_knife_axe[id] = false g_knife_katana[id] = false g_knife_hammer[id] = false g_hasSpeed[id] = false}public client_disconnect(id){ g_knife_combat[id] = false g_knife_strong[id] = false g_knife_axe[id] = false g_knife_katana[id] = false g_knife_hammer[id] = false g_hasSpeed[id] = false}public plugin_precache(){ precache_model(combat_v_model) precache_model(combat_p_model) precache_model(strong_v_model) precache_model(strong_p_model) precache_model(axe_v_model) precache_model(axe_p_model) precache_model(katana_v_model) precache_model(katana_p_model) precache_model(hammer_v_model) precache_model(hammer_p_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 strong_sounds; i++) precache_sound(strong_sounds[i]) for(new i = 0; i < sizeof axe_sounds; i++) precache_sound(axe_sounds[i]) for(new i = 0; i < sizeof katana_sounds; i++) precache_sound(katana_sounds[i]) for(new i = 0; i < sizeof hammer_sounds; i++) precache_sound(hammer_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]) { 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("\yYou can choose once per round!", "menu_handler"); menu_additem(menu, "\wCrowbar \y[Speed]", "1", 0); menu_additem(menu, "\wStrong \y[Damage]", "2", 0); menu_additem(menu, "\wCrowbar \y[Jump]", "3", 0); menu_additem(menu, "\wKatana \y[Knockback]", "4", 0); menu_additem(menu, "\wHammeR \r[Dead by Daylight]", "5", 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_combat(id) menu_destroy(menu); return PLUGIN_HANDLED } case 2: { give_strong(id) menu_destroy(menu); return PLUGIN_HANDLED } case 3: { give_axe(id) menu_destroy(menu); return PLUGIN_HANDLED } case 4: { give_katana(id) menu_destroy(menu); return PLUGIN_HANDLED } case 5: { give_hammer(id) menu_destroy(menu); return PLUGIN_HANDLED } } menu_destroy(menu); return PLUGIN_HANDLED}public give_combat(id){ g_knife_combat[id] = true g_knife_strong[id] = false g_knife_axe[id] = false g_knife_katana[id] = false g_knife_hammer[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_strong(id){ g_knife_combat[id] = false g_knife_strong[id] = true g_knife_axe[id] = false g_knife_katana[id] = false g_knife_hammer[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_axe(id){ g_knife_combat[id] = false g_knife_strong[id] = false g_knife_axe[id] = true g_knife_katana[id] = false g_knife_hammer[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_katana(id){ g_knife_combat[id] = false g_knife_strong[id] = false g_knife_axe[id] = false g_knife_katana[id] = true g_knife_hammer[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_hammer(id){ g_knife_combat[id] = false g_knife_strong[id] = false g_knife_axe[id] = false g_knife_katana[id] = false g_knife_hammer[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)}public checkWeapon(id){ new plrWeapId plrWeapId = get_user_weapon(id) if (plrWeapId == CSW_KNIFE && (g_knife_combat[id] || g_knife_strong[id] || g_knife_axe[id] || g_knife_katana[id] || g_knife_hammer[id])) { checkModel(id) }}public checkModel(id){ if (zp_get_user_zombie(id)) return PLUGIN_HANDLED if (g_knife_combat[id]) { set_pev(id, pev_viewmodel2, combat_v_model) set_pev(id, pev_weaponmodel2, combat_p_model) } if (g_knife_strong[id]) { set_pev(id, pev_viewmodel2, strong_v_model) set_pev(id, pev_weaponmodel2, strong_p_model) } if (g_knife_axe[id]) { set_pev(id, pev_viewmodel2, axe_v_model) set_pev(id, pev_weaponmodel2, axe_p_model) } if (g_knife_katana[id]) { set_pev(id, pev_viewmodel2, katana_v_model) set_pev(id, pev_weaponmodel2, katana_p_model) } if (g_knife_hammer[id]) { set_pev(id, pev_viewmodel2, hammer_v_model) set_pev(id, pev_weaponmodel2, hammer_p_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 combat_sounds; i++) for(new i = 0; i < sizeof strong_sounds; i++) for(new i = 0; i < sizeof axe_sounds; i++) for(new i = 0; i < sizeof katana_sounds; i++) for(new i = 0; i < sizeof hammer_sounds; i++) { if(equal(sound, oldknife_sounds[i])) { 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_strong[id]) { emit_sound(id, channel, strong_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM) return FMRES_SUPERCEDE } if (g_knife_axe[id]) { emit_sound(id, channel, axe_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM) return FMRES_SUPERCEDE } if (g_knife_katana[id]) { emit_sound(id, channel, katana_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM) return FMRES_SUPERCEDE } if (g_knife_hammer[id]) { emit_sound(id, channel, hammer_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM) return FMRES_SUPERCEDE } if (!g_knife_combat[id] || !g_knife_strong[id] || !g_knife_axe[id] || !g_knife_katana[id] || !g_knife_hammer[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_combat[iattacker]) set_msg_arg_string(4, "Combat knife") } if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE) { if(g_knife_strong[iattacker]) set_msg_arg_string(4, "Strong knife") } if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE) { if(g_knife_axe[iattacker]) set_msg_arg_string(4, "Axe knife") } if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE) { if(g_knife_katana[iattacker]) set_msg_arg_string(4, "Katana knife") } if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE) { if(g_knife_hammer[iattacker]) set_msg_arg_string(4, "Ice knife") } } return PLUGIN_CONTINUE}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_combat[id]) 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_strong[id]) { 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_strong_jump) set_pev(id, pev_velocity, fVelocity) set_pev(id, pev_gaitsequence, 6) } } if (weapon == CSW_KNIFE && g_knife_axe[id]) { 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_axe_jump) set_pev(id, pev_velocity, fVelocity) set_pev(id, pev_gaitsequence, 6) } } if (weapon == CSW_KNIFE && g_knife_katana[id]) { 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_katana_jump) set_pev(id, pev_velocity, fVelocity) set_pev(id, pev_gaitsequence, 6) } } if (weapon == CSW_KNIFE && g_knife_hammer[id]) { 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_hammer_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_combat[attacker]) { SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_combat_dmg)) } if (weapon == CSW_KNIFE && g_knife_strong[attacker]) { SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_strong_dmg)) } if (weapon == CSW_KNIFE && g_knife_axe[attacker]) { SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_axe_dmg)) } if (weapon == CSW_KNIFE && g_knife_katana[attacker]) { SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_katana_dmg)) } if (weapon == CSW_KNIFE && g_knife_hammer[attacker]) { SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_hammer_dmg)) } 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_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_strong[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_axe[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_katana[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_hammer[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_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_strong[attacker]) { velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_strong_knock) * 3000) ) / get_entity_distance(victim , attacker); velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_strong_knock) * 3000) ) / get_entity_distance(victim , attacker); } if (g_knife_axe[attacker]) { velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_axe_knock) * 3000) ) / get_entity_distance(victim , attacker); velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_axe_knock) * 3000) ) / get_entity_distance(victim , attacker); } if (g_knife_katana[attacker]) { velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_katana_knock) * 3000) ) / get_entity_distance(victim , attacker); velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_katana_knock) * 3000) ) / get_entity_distance(victim , attacker); } if (g_knife_hammer[attacker]) { velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_hammer_knock) * 3000) ) / get_entity_distance(victim , attacker); velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_hammer_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_combat[id] = true g_hasSpeed[id] = true } }}
Code:
knifemenu.amxx
Statistics: Posted by Rainq — Wed Jan 10, 2024 11:06 am
Statistics: Posted by Rainq — Tue Jan 09, 2024 10:30 pm
Code:
#include <amxmodx>#include <fakemeta>#include <zombieplague>#include <zombiexp>new const hclass_name[] = { "Beginner Soldier" }new const hclass_info[] = { "" } // descriptionnew const hclass_model[] = { "" } // modelnew const hclass_weapons[] = { "" } // weaponsconst hclass_health = 230 // healthconst hclass_speed = 240 // speedconst Float:hclass_gravity = 0.6 // gravityconst hclass_level = 1 // level required to usenew const hclass2_name[] = { "Terror Soldier" }new const hclass2_info[] = { "" } // descriptionnew const hclass2_model[] = { "" } // modelnew const hclass2_weapons[] = { "" } // weaponsconst hclass2_health = 220 // healthconst hclass2_speed = 240 // speedconst Float:hclass2_gravity = 1.0 // gravityconst hclass2_level = 5 // level required to usenew const hclass3_name[] = { "Arctic Soldier" }new const hclass3_info[] = { "" } // descriptionnew const hclass3_model[] = { "" } // modelnew const hclass3_weapons[] = { "" } // weaponsconst hclass3_health = 230 // healthconst hclass3_speed = 240 // speedconst Float:hclass3_gravity = 1.0 // gravityconst hclass3_level = 10 // level required to usenew const hclass4_name[] = { "Elite Soldier" }new const hclass4_info[] = { "" } // descriptionnew const hclass4_model[] = { "" } // modelnew const hclass4_weapons[] = { "" } // weaponsconst hclass4_health = 240 // healthconst hclass4_speed = 240 // speedconst Float:hclass4_gravity = 1.0 // gravityconst hclass4_level = 15 // level required to usenew const hclass5_name[] = { "GoldNova Soldier" }new const hclass5_info[] = { "" } // descriptionnew const hclass5_model[] = { "" } // modelnew const hclass5_weapons[] = { "" } // weaponsconst hclass5_health = 250 // healthconst hclass5_speed = 240 // speedconst Float:hclass5_gravity = 1.0 // gravityconst hclass5_level = 20 // level required to usenew const hclass6_name[] = { "Guardian Soldier" }new const hclass6_info[] = { "" } // descriptionnew const hclass6_model[] = { "" } // modelnew const hclass6_weapons[] = { "" } // weaponsconst hclass6_health = 260 // healthconst hclass6_speed = 240 // speedconst Float:hclass6_gravity = 1.0 // gravityconst hclass6_level = 25 // level required to usenew const hclass7_name[] = { "Destroyer Soldier" }new const hclass7_info[] = { "" } // descriptionnew const hclass7_model[] = { "" } // modelnew const hclass7_weapons[] = { "" } // weaponsconst hclass7_health = 270 // healthconst hclass7_speed = 240 // speedconst Float:hclass7_gravity = 1.0 // gravityconst hclass7_level = 30 // level required to usenew const hclass8_name[] = { "Champions Soldier" } new const hclass8_info[] = { "" } // descriptionnew const hclass8_model[] = { "" } // modelnew const hclass8_weapons[] = { "" } // weaponsconst hclass8_health = 280 // healthconst hclass8_speed = 240 // speedconst Float:hclass8_gravity = 1.0 // gravityconst hclass8_level = 35 // level required to usenew const hclass9_name[] = { "GlobalElite Soldier" }new const hclass9_info[] = { "" } // descriptionnew const hclass9_model[] = { "" } // modelnew const hclass9_weapons[] = { "" } // weaponsconst hclass9_health = 290 // healthconst hclass9_speed = 240 // speedconst Float:hclass9_gravity = 1.0 // gravityconst hclass9_level = 40 // level required to usenew const hclass10_name[] = { "Army Soldier" }new const hclass10_info[] = { "" } // descriptionnew const hclass10_model[] = { "" } // modelnew const hclass10_weapons[] = { "" } // weaponsconst hclass10_health = 300 // healthconst hclass10_speed = 240 // speedconst Float:hclass10_gravity = 1.0 // gravityconst hclass10_level = 45 // level required to usenew const hclass11_name[] = { "Lucifer Soldier" }new const hclass11_info[] = { "" } // descriptionnew const hclass11_model[] = { "" } // modelnew const hclass11_weapons[] = { "" } // weaponsconst hclass11_health = 300 // healthconst hclass11_speed = 240 // speedconst Float:hclass11_gravity = 1.0 // gravityconst hclass11_level = 50 // level required to usenew const hclass12_name[] = { "PoweR Soldier" }new const hclass12_info[] = { "" } // descriptionnew const hclass12_model[] = { "" } // modelnew const hclass12_weapons[] = { "" } // weaponsconst hclass12_health = 320 // healthconst hclass12_speed = 250 // speedconst Float:hclass12_gravity = 1.0 // gravityconst hclass12_level = 55 // level required to usenew const hclass13_name[] = { "Spawn Soldier" }new const hclass13_info[] = { "" } // descriptionnew const hclass13_model[] = { "" } // modelnew const hclass13_weapons[] = { "" } // weaponsconst hclass13_health = 330 // healthconst hclass13_speed = 250 // speedconst Float:hclass13_gravity = 1.0 // gravityconst hclass13_level = 60 // level required to usenew const hclass14_name[] = { "NightWolf Soldier" }new const hclass14_info[] = { "" } // descriptionnew const hclass14_model[] = { "" } // modelnew const hclass14_weapons[] = { "" } // weaponsconst hclass14_health = 340 // healthconst hclass14_speed = 250 // speedconst Float:hclass14_gravity = 1.0 // gravityconst hclass14_level = 65 // level required to usenew const hclass15_name[] = { "Myers Soldier" }new const hclass15_info[] = { "" } // descriptionnew const hclass15_model[] = { "" } // modelnew const hclass15_weapons[] = { "" } // weaponsconst hclass15_health = 350 // healthconst hclass15_speed = 250 // speedconst Float:hclass15_gravity = 1.0 // gravityconst hclass15_level = 70 // level required to usenew const hclass16_name[] = { "TheBest Soldier" }new const hclass16_info[] = { "" } // descriptionnew const hclass16_model[] = { "" } // modelnew const hclass16_weapons[] = { "" } // weaponsconst hclass16_health = 360 // healthconst hclass16_speed = 250 // speedconst Float:hclass16_gravity = 1.0 // gravityconst hclass16_level = 75 // level required to usenew const hclass17_name[] = { "Blade Soldier" }new const hclass17_info[] = { "" } // descriptionnew const hclass17_model[] = { "" } // modelnew const hclass17_weapons[] = { "" } // weaponsconst hclass17_health = 370 // healthconst hclass17_speed = 250 // speedconst Float:hclass17_gravity = 1.0 // gravityconst hclass17_level = 80 // level required to usenew const hclass18_name[] = { "Legendary Soldier" }new const hclass18_info[] = { "" } // descriptionnew const hclass18_model[] = { "" } // modelnew const hclass18_weapons[] = { "" } // weaponsconst hclass18_health = 380 // healthconst hclass18_speed = 250 // speedconst Float:hclass18_gravity = 1.0 // gravityconst hclass18_level = 85 // level required to usenew const hclass19_name[] = { "MeRcyLeZZ Soldier" }new const hclass19_info[] = { "" } // descriptionnew const hclass19_model[] = { "" } // modelnew const hclass19_weapons[] = { "" } // weaponsconst hclass19_health = 390 // healthconst hclass19_speed = 250 // speedconst Float:hclass19_gravity = 1.0 // gravityconst hclass19_level = 90 // level required to usenew const hclass20_name[] = { "eXtreme Soldier" }new const hclass20_info[] = { "" } // descriptionnew const hclass20_model[] = { "" } // modelnew const hclass20_weapons[] = { "" } // weaponsconst hclass20_health = 420 // healthconst hclass20_speed = 270 // speedconst Float:hclass20_gravity = 0.6 // gravityconst hclass20_level = 100 // level required to usenew g_hclassid , g_hclass2id , g_hclass3id, g_hclass4id , g_hclass5id , g_hclass6id , g_hclass7id , g_hclass8id , g_hclass9id, g_hclass10id, g_hclass11id , g_hclass12id , g_hclass13id , g_hclass14id, g_hclass15id , g_hclass16id, g_hclass17id, g_hclass18id, g_hclass19id , g_hclass20idpublic plugin_precache(){new registerText[32]formatex( registerText, sizeof registerText - 1, "[ZPXP] %s human", hclass_name)register_plugin(registerText, "1.0", "TheXForce")g_hclassid = zpxp_register_human_class(hclass_name, hclass_info, hclass_model, hclass_weapons, hclass_health, hclass_speed, hclass_gravity, hclass_level)g_hclass2id = zpxp_register_human_class(hclass2_name, hclass2_info, hclass2_model, hclass2_weapons, hclass2_health, hclass2_speed, hclass2_gravity, hclass2_level)g_hclass3id = zpxp_register_human_class(hclass3_name, hclass3_info, hclass3_model, hclass3_weapons, hclass3_health, hclass3_speed, hclass3_gravity, hclass3_level)g_hclass4id = zpxp_register_human_class(hclass4_name, hclass4_info, hclass4_model, hclass4_weapons, hclass4_health, hclass4_speed, hclass4_gravity, hclass4_level)g_hclass5id = zpxp_register_human_class(hclass5_name, hclass5_info, hclass5_model, hclass5_weapons, hclass5_health, hclass5_speed, hclass5_gravity, hclass5_level)g_hclass6id = zpxp_register_human_class(hclass6_name, hclass6_info, hclass6_model, hclass6_weapons, hclass6_health, hclass6_speed, hclass6_gravity, hclass6_level)g_hclass7id = zpxp_register_human_class(hclass7_name, hclass7_info, hclass7_model, hclass7_weapons, hclass7_health, hclass7_speed, hclass7_gravity, hclass7_level)g_hclass8id = zpxp_register_human_class(hclass8_name, hclass8_info, hclass8_model, hclass8_weapons, hclass8_health, hclass8_speed, hclass8_gravity, hclass8_level)g_hclass9id = zpxp_register_human_class(hclass9_name, hclass9_info, hclass9_model, hclass9_weapons, hclass9_health, hclass9_speed, hclass9_gravity, hclass9_level)g_hclass10id = zpxp_register_human_class(hclass10_name, hclass10_info, hclass10_model, hclass10_weapons, hclass10_health, hclass10_speed, hclass10_gravity, hclass10_level)g_hclass11id = zpxp_register_human_class(hclass11_name, hclass11_info, hclass11_model, hclass11_weapons, hclass11_health, hclass11_speed, hclass11_gravity, hclass11_level)g_hclass12id = zpxp_register_human_class(hclass12_name, hclass12_info, hclass12_model, hclass12_weapons, hclass12_health, hclass12_speed, hclass12_gravity, hclass12_level)g_hclass13id = zpxp_register_human_class(hclass13_name, hclass13_info, hclass13_model, hclass13_weapons, hclass13_health, hclass13_speed, hclass13_gravity, hclass13_level)g_hclass14id = zpxp_register_human_class(hclass14_name, hclass14_info, hclass14_model, hclass14_weapons, hclass14_health, hclass14_speed, hclass14_gravity, hclass14_level)g_hclass15id = zpxp_register_human_class(hclass15_name, hclass15_info, hclass15_model, hclass15_weapons, hclass15_health, hclass15_speed, hclass15_gravity, hclass15_level)g_hclass16id = zpxp_register_human_class(hclass16_name, hclass16_info, hclass16_model, hclass16_weapons, hclass16_health, hclass16_speed, hclass16_gravity, hclass16_level)g_hclass17id = zpxp_register_human_class(hclass17_name, hclass17_info, hclass17_model, hclass17_weapons, hclass17_health, hclass17_speed, hclass17_gravity, hclass17_level)g_hclass18id = zpxp_register_human_class(hclass18_name, hclass18_info, hclass18_model, hclass18_weapons, hclass18_health, hclass18_speed, hclass18_gravity, hclass18_level)g_hclass19id = zpxp_register_human_class(hclass19_name, hclass19_info, hclass19_model, hclass19_weapons, hclass19_health, hclass19_speed, hclass19_gravity, hclass19_level)g_hclass20id = zpxp_register_human_class(hclass20_name, hclass20_info, hclass20_model, hclass20_weapons, hclass20_health, hclass20_speed, hclass20_gravity, hclass20_level)if(g_hclassid == -1){server_print("[ZPXP] You have not properly setup your Zombie XP Mod.");}}public zp_user_infected_post(id, infector, nemesis){if (zp_get_user_human_class(id) != g_hclassid) return;if (zp_get_user_human_class(id) != g_hclass2id) return;if (zp_get_user_human_class(id) != g_hclass3id) return;if (zp_get_user_human_class(id) != g_hclass4id) return;if (zp_get_user_human_class(id) != g_hclass5id) return;if (zp_get_user_human_class(id) != g_hclass6id) return;if (zp_get_user_human_class(id) != g_hclass7id) return;if (zp_get_user_human_class(id) != g_hclass8id) return;if (zp_get_user_human_class(id) != g_hclass9id) return;if (zp_get_user_human_class(id) != g_hclass10id) return;if (zp_get_user_human_class(id) != g_hclass11id) return;if (zp_get_user_human_class(id) != g_hclass12id) return;if (zp_get_user_human_class(id) != g_hclass13id) return;if (zp_get_user_human_class(id) != g_hclass14id) return;if (zp_get_user_human_class(id) != g_hclass15id) return;if (zp_get_user_human_class(id) != g_hclass16id) return;if (zp_get_user_human_class(id) != g_hclass17id) return;if (zp_get_user_human_class(id) != g_hclass18id) return;if (zp_get_user_human_class(id) != g_hclass19id) return;if (zp_get_user_human_class(id) != g_hclass20id) return;}public zp_user_humanized_post(id){if (zp_get_user_human_class(id) != g_hclassid) return;if (zp_get_user_human_class(id) != g_hclass2id) return;if (zp_get_user_human_class(id) != g_hclass3id) return;if (zp_get_user_human_class(id) != g_hclass4id) return;if (zp_get_user_human_class(id) != g_hclass5id) return;if (zp_get_user_human_class(id) != g_hclass6id) return;if (zp_get_user_human_class(id) != g_hclass7id) return;if (zp_get_user_human_class(id) != g_hclass8id) return;if (zp_get_user_human_class(id) != g_hclass9id) return;if (zp_get_user_human_class(id) != g_hclass10id) return;if (zp_get_user_human_class(id) != g_hclass11id) return;if (zp_get_user_human_class(id) != g_hclass12id) return;if (zp_get_user_human_class(id) != g_hclass13id) return;if (zp_get_user_human_class(id) != g_hclass14id) return;if (zp_get_user_human_class(id) != g_hclass15id) return;if (zp_get_user_human_class(id) != g_hclass16id) return;if (zp_get_user_human_class(id) != g_hclass17id) return;if (zp_get_user_human_class(id) != g_hclass18id) return;if (zp_get_user_human_class(id) != g_hclass19id) return;if (zp_get_user_human_class(id) != g_hclass20id) return;if (zp_get_user_survivor(id) == 1){zp_user_infected_post(id, 0, 0)} else {zp_round_started_human(id)}}public zp_round_started_human(id){if (zp_get_user_human_class(id) != g_hclassid) return;if (zp_get_user_human_class(id) != g_hclass2id) return;if (zp_get_user_human_class(id) != g_hclass3id) return;if (zp_get_user_human_class(id) != g_hclass4id) return;if (zp_get_user_human_class(id) != g_hclass5id) return;if (zp_get_user_human_class(id) != g_hclass6id) return;if (zp_get_user_human_class(id) != g_hclass7id) return;if (zp_get_user_human_class(id) != g_hclass8id) return;if (zp_get_user_human_class(id) != g_hclass9id) return;if (zp_get_user_human_class(id) != g_hclass10id) return;if (zp_get_user_human_class(id) != g_hclass11id) return;if (zp_get_user_human_class(id) != g_hclass12id) return;if (zp_get_user_human_class(id) != g_hclass13id) return;if (zp_get_user_human_class(id) != g_hclass14id) return;if (zp_get_user_human_class(id) != g_hclass15id) return;if (zp_get_user_human_class(id) != g_hclass16id) return;if (zp_get_user_human_class(id) != g_hclass17id) return;if (zp_get_user_human_class(id) != g_hclass18id) return;if (zp_get_user_human_class(id) != g_hclass19id) return;if (zp_get_user_human_class(id) != g_hclass20id) return;}
Code:
zp_classxp_human.amxx
Statistics: Posted by Rainq — Mon Jan 08, 2024 10:04 pm
Code:
#include <amxmodx>#include <amxmisc>#include <cstrike>#include <fakemeta>#include <xs>#include <hamsandwich>#include <colorchat>#include <zombieplague>native zp_is_sniper_round();native zp_is_assassin_round();native zp_is_lnj_round();//#define ACCESSLEVEL ADMIN_LEVEL_H#define RemoveEntity(%1) engfunc(EngFunc_RemoveEntity,%1)#define TASK_PLANT 15100#define TASK_RESET 15500#define TASK_RELEASE 15900#define LASERMINE_TEAM pev_iuser1//EV_INT_iuser1#define LASERMINE_OWNER pev_iuser2 //EV_INT_iuser3#define LASERMINE_STEP pev_iuser3#define LASERMINE_HITING pev_iuser4#define LASERMINE_COUNT pev_fuser1#define LASERMINE_POWERUP pev_fuser2#define LASERMINE_BEAMTHINK pev_fuser3#define LASERMINE_BEAMENDPOINT pev_vuser1#define MAX_MINES 10#define MODE_LASERMINE 0#define OFFSET_TEAM 114#define OFFSET_DEATH 444#define cs_get_user_team(%1) CsTeams:get_offset_value(%1,OFFSET_TEAM)#define cs_get_user_deaths(%1) get_offset_value(%1,OFFSET_DEATH)enum tripmine_e {TRIPMINE_IDLE1 = 0,TRIPMINE_IDLE2,TRIPMINE_ARM1,TRIPMINE_ARM2,TRIPMINE_FIDGET,TRIPMINE_HOLSTER,TRIPMINE_DRAW,TRIPMINE_WORLD,TRIPMINE_GROUND,};enum{POWERUP_THINK,BEAMBREAK_THINK,EXPLOSE_THINK};enum{POWERUP_SOUND,ACTIVATE_SOUND,STOP_SOUND};new constENT_MODELS[] = "models/v_laser_mine.mdl",ENT_SOUND1[] = "weapons/mine_deploy.wav",ENT_SOUND2[] = "weapons/mine_charge.wav",ENT_SOUND3[] = "weapons/mine_activate.wav",ENT_SOUND4[] = "weapons/electro5.wav",ENT_SOUND5[] = "items/gunpickup2.wav",ENT_SOUND6[] = "debris/bustglass1.wav",ENT_SOUND7[] = "debris/bustglass2.wav",ENT_SPRITE1[] = "sprites/laserbeam.spr",ENT_SPRITE2[] = "sprites/zerogxplode.spr";new constENT_CLASS_NAME[] = "lasermine",//ENT_CLASS_NAME2[] = "info_target",ENT_CLASS_NAME3[] = "func_breakable";new constCHATTAG[] = "[LaserMine]",STR_DONTHAVEMINE[] = "You don't have lasermines.",//STR_CANTDEPLOY[] = "Your team can't plant lasermines!",STR_MAXDEPLOY[] = "You've planted the maximum number of lasermines.",STR_MANYPPL[] = "Prea multe lasere in echipa ta...",STR_PLANTWALL[] = "You need to plant the lasermine on the wall.",STR_DELAY[] = "You can buy and plant lasermines in",STR_SECONDS[] = "seconds.",STR_STATE[] = "LaserMines Ammo:",STR_NOACCESS[] = "You have no acces to this command.",STR_CANTDEPLOY[] = "You can't plant lasermines this round.";new g_EntMinenew beam, boomnew g_msgid_bartime, g_LENABLE, g_LAMMO, g_LDMG, g_LTMAX, g_LHEALTH, g_LMODE, g_LRADIUS, g_LRDMG, g_LFF, g_LCBT;new g_LDELAY, g_LVISIBLE, g_LSTAMMO, g_LACCESS, g_LGLOW, g_LDMGMODE, g_LCLMODE, g_LCBRIGHT, g_LDSEC, g_LCMDMODE;new g_dcount[33], g_nowtime, g_MaxPLnew bool:g_settinglaser[33]new g_msgDeathMsg, g_msgScoreInfo, g_msgDamage, g_msgStatusTextnew Float:plspeed[33]new plsetting[33]new g_havemine[33]new g_deployed[33]public plugin_init(){register_plugin("LaserMine","3.0", "SandStriker & Rainq")RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")RegisterHam(Ham_TakeDamage, "func_breakable", "Lasermine_TakeDamagePre")register_clcmd("+setlaser","CreateLaserMine_Progress_b")register_clcmd("-setlaser","StopCreateLaserMine")register_clcmd("+dellaser","ReturnLaserMine_Progress")register_clcmd("-dellaser","StopReturnLaserMine")register_clcmd("say","say_lasermine")register_clcmd("buy_lasermine","BuyLasermine")register_clcmd("say /takelm","TL")register_clcmd("say_team /takelm","TL")register_clcmd("amx_removelaser", "cmdLmRemove", ADMIN_BAN, "<name>")register_logevent("logevent_round_end", 2, "1=Round_End")//register_logevent("logevent_round_start", 2, "1=Round_Start")g_LENABLE = register_cvar("amx_ltm","1")g_LACCESS = register_cvar("amx_ltm_acs","0"); //0 all, 1 adming_LMODE = register_cvar("amx_ltm_mode","0"); //0 lasermine, 1 tripmineg_LAMMO = register_cvar("amx_ltm_ammo","1");g_LDMG = register_cvar("amx_ltm_dmg","60"); //laser hit dmgg_LHEALTH = register_cvar("amx_ltm_health","1000");g_LTMAX = register_cvar("amx_ltm_teammax","200");g_LRADIUS = register_cvar("amx_ltm_radius","320.0");g_LRDMG = register_cvar("amx_ltm_rdmg","100"); //radius damageg_LFF = register_cvar("amx_ltm_ff","0");g_LCBT = register_cvar("amx_ltm_cbt","ALL");g_LDELAY = register_cvar("amx_ltm_delay","42");g_LVISIBLE = register_cvar("amx_ltm_line","1");g_LGLOW = register_cvar("amx_ltm_glow","1");g_LCBRIGHT = register_cvar("amx_ltm_bright","255"); //laser line brightness.g_LCLMODE = register_cvar("amx_ltm_color","0"); //0 is team color,1 is greeng_LDMGMODE = register_cvar("amx_ltm_ldmgmode","0"); //0 - frame dmg, 1 - once dmg, 2 - 1 second dmgg_LDSEC = register_cvar("amx_ltm_ldmgseconds","1"); //mode 2 only, damage / seconds. default 1 (sec)g_LSTAMMO = register_cvar("amx_ltm_startammo","1");g_LCMDMODE = register_cvar("amx_ltm_cmdmode","1"); //0 is +USE key, 1 is bind, 2 is each.register_event("DeathMsg", "DeathEvent", "a");register_event("CurWeapon", "standing", "be", "1=1");register_event("ResetHUD", "delaycount", "a");register_event("ResetHUD", "newround", "b");register_event("Damage","CutDeploy_onDamage","b");g_msgDeathMsg = get_user_msgid("DeathMsg");g_msgScoreInfo = get_user_msgid("ScoreInfo");g_msgDamage = get_user_msgid("Damage");g_msgStatusText = get_user_msgid("StatusText")g_msgid_bartime = get_user_msgid("BarTime")register_forward(FM_Think, "ltm_Think" );register_forward(FM_PlayerPostThink, "ltm_PostThink" )register_forward(FM_PlayerPreThink, "ltm_PreThink")register_forward( FM_TraceLine , "fw_TraceLine" )}public plugin_precache(){precache_sound(ENT_SOUND1)precache_sound(ENT_SOUND2)precache_sound(ENT_SOUND3)precache_sound(ENT_SOUND4)precache_sound(ENT_SOUND5)precache_sound(ENT_SOUND6)precache_sound(ENT_SOUND7)precache_model(ENT_MODELS);beam = precache_model(ENT_SPRITE1);boom = precache_model(ENT_SPRITE2);precache_sound("buttons/button2.wav")return PLUGIN_CONTINUE}public plugin_natives(){register_native("zp_remove_all_id_lm","_remove_all_id_lm")}public _remove_all_id_lm(iPlugin,iParams){if(iParams!=1)return 1new id=get_param(1)if(!is_user_connected(id))return -1TL(id)return 0}public TL(id){DeleteTask(id)RemoveAllTripmines(id)//delaycount(id)SetStartAmmo(id)ShowAmmo(id)}public cmdLmRemove(id, level, cid){if(!cmd_access(id, level, cid, 2))return PLUGIN_HANDLED;new target[32];read_argv(1, target, charsmax(target));new player = cmd_target(id, target, 2);if(!player){console_print(id, "Player not connected.");return PLUGIN_HANDLED;}if(!g_deployed[player]){console_print(id, "Player has no planted lasermines.");return PLUGIN_HANDLED}DeleteTask(id)RemoveAllTripmines(id)SetStartAmmo(id)ShowAmmo(id)new name[32], pname[32];get_user_name(id, name, charsmax(name))get_user_name(player, pname, charsmax(pname));ColorChat(0, GREEN, "[LM]^1 Admin^4 %s^1 removed^4 %s^1's lasermines.", name, pname);return PLUGIN_HANDLED}public fw_PlayerKilled(id){RemoveAllTripmines(id)DeleteTask(id)}public plugin_cfg(){g_EntMine = engfunc(EngFunc_AllocString,ENT_CLASS_NAME3)arrayset(g_havemine,0,sizeof(g_havemine))arrayset(g_deployed,0,sizeof(g_deployed))g_MaxPL = get_maxplayers()}public delaycount(id){g_dcount[id] = floatround(get_gametime());}bool:CheckTime(id){g_nowtime = floatround(get_gametime()) - g_dcount[id];if(g_nowtime >= get_pcvar_num(g_LDELAY))return true;return false;}public event_infect(id, att){DeleteTask(id);RemoveAllTripmines(id);//delaycount(id);SetStartAmmo(id);ShowAmmo(id);}public logevent_round_end(){new players[32], inum;get_players(players, inum, "a");for(new i = 0; i < inum; i++){RemoveAllTripmines(players[i])}}public logevent_round_start(){server_cmd("amx_cvar amx_ltm 1")}public CreateLaserMine_Progress_b(id){if(get_pcvar_num(g_LCMDMODE) != 0)CreateLaserMine_Progress(id)return PLUGIN_HANDLED}public CreateLaserMine_Progress(id){if (!CreateCheck(id))return PLUGIN_HANDLEDg_settinglaser[id] = truemessage_begin( MSG_ONE_UNRELIABLE, g_msgid_bartime, {0,0,0}, id )write_short(1)message_end()set_task(1.2, "Spawn", (TASK_PLANT + id))client_cmd(id, "spk buttons/button3.wav")return PLUGIN_HANDLED}public ReturnLaserMine_Progress(id){if (!ReturnCheck(id))return PLUGIN_HANDLEDg_settinglaser[id] = true;message_begin( MSG_ONE_UNRELIABLE, g_msgid_bartime, {0,0,0}, id );write_short(1);message_end();set_task(1.2, "ReturnMine", (TASK_RELEASE + id));client_cmd(id, "spk buttons/button3.wav");return PLUGIN_HANDLED;}public StopCreateLaserMine(id){DeleteTask(id);message_begin( MSG_ONE_UNRELIABLE, g_msgid_bartime, {0,0,0}, id );write_short(0);message_end();return PLUGIN_HANDLED;}public StopReturnLaserMine(id){DeleteTask(id);message_begin( MSG_ONE_UNRELIABLE, g_msgid_bartime, {0,0,0}, id );write_short(0);message_end();return PLUGIN_HANDLED;}public ReturnMine(id){id -= TASK_RELEASE;new tgt,body,Float:vo[3],Float:to[3];get_user_aiming(id,tgt,body);if(!pev_valid(tgt)) return;pev(id,pev_origin,vo);pev(tgt,pev_origin,to);if(get_distance_f(vo,to) > 90.0) return;new EntityName[32];pev(tgt, pev_classname, EntityName, 31);if(!equal(EntityName, ENT_CLASS_NAME)) return;if(pev(tgt,LASERMINE_OWNER) != id) return;RemoveEntity(tgt);g_havemine[id] ++;g_deployed[id] --;emit_sound(id, CHAN_ITEM, ENT_SOUND5, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)ShowAmmo(id)return;}public Spawn( id ){id -= TASK_PLANTnew i_Ent = engfunc(EngFunc_CreateNamedEntity,g_EntMine);if(!i_Ent){client_print(id,print_chat,"[Lasermine Debug] Can't Create Entity");return PLUGIN_HANDLED_MAIN;}set_pev(i_Ent,pev_classname,ENT_CLASS_NAME);engfunc(EngFunc_SetModel,i_Ent,ENT_MODELS);set_pev(i_Ent,pev_solid,SOLID_NOT);set_pev(i_Ent,pev_movetype,MOVETYPE_FLY);set_pev(i_Ent,pev_frame,0);set_pev(i_Ent,pev_body,3);set_pev(i_Ent,pev_sequence,TRIPMINE_WORLD);set_pev(i_Ent,pev_framerate,0);set_pev(i_Ent,pev_takedamage,DAMAGE_YES);set_pev(i_Ent,pev_dmg,100.0);set_user_health(i_Ent,get_pcvar_num(g_LHEALTH));new Float:vOrigin[3];new Float:vNewOrigin[3], Float:vNormal[3], Float:vTraceDirection[3], Float:vTraceEnd[3],Float:vEntAngles[3];pev( id, pev_origin, vOrigin );velocity_by_aim( id, 128, vTraceDirection );xs_vec_add( vTraceDirection, vOrigin, vTraceEnd );engfunc( EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0 );new Float:fFraction;get_tr2( 0, TR_flFraction, fFraction );if ( fFraction < 1.0 ){get_tr2( 0, TR_vecEndPos, vTraceEnd );get_tr2( 0, TR_vecPlaneNormal, vNormal );}xs_vec_mul_scalar( vNormal, 8.0, vNormal );xs_vec_add( vTraceEnd, vNormal, vNewOrigin );engfunc(EngFunc_SetSize, i_Ent, Float:{ -4.0, -4.0, -4.0 }, Float:{ 4.0, 4.0, 4.0 } );engfunc(EngFunc_SetOrigin, i_Ent, vNewOrigin );vector_to_angle(vNormal,vEntAngles );set_pev(i_Ent,pev_angles,vEntAngles );new Float:vBeamEnd[3], Float:vTracedBeamEnd[3];xs_vec_mul_scalar(vNormal, 8192.0, vNormal );xs_vec_add( vNewOrigin, vNormal, vBeamEnd );engfunc( EngFunc_TraceLine, vNewOrigin, vBeamEnd, IGNORE_MONSTERS, -1, 0 );get_tr2( 0, TR_vecPlaneNormal, vNormal );get_tr2( 0, TR_vecEndPos, vTracedBeamEnd );set_pev(i_Ent, LASERMINE_OWNER, id );set_pev(i_Ent,LASERMINE_BEAMENDPOINT,vTracedBeamEnd);set_pev(i_Ent,LASERMINE_TEAM,int:cs_get_user_team(id));new Float:fCurrTime = get_gametime();set_pev(i_Ent,LASERMINE_POWERUP, fCurrTime + 2.5 );set_pev(i_Ent,LASERMINE_STEP,POWERUP_THINK);set_pev(i_Ent,pev_nextthink, fCurrTime + 0.2 );PlaySound(i_Ent,POWERUP_SOUND );g_deployed[id]++;g_havemine[id]--;DeleteTask(id);ShowAmmo(id);return 1;}stock TeamDeployedCount(id){//new tid[32];static i;static CsTeams:t;t = cs_get_user_team(id);static cnt;cnt=0;for(i = 1;i <= g_MaxPL;i++){if(is_user_connected(i))if(t == cs_get_user_team(i))cnt += g_deployed[i];}return cnt;}bool:CheckCanTeam(id){new arg[5],CsTeam:num;get_pcvar_string(g_LCBT,arg,3);if(equali(arg,"T")){num = CsTeam:CS_TEAM_T;}else if(equali(arg,"CT")){num = CsTeam:CS_TEAM_CT;}else if(equali(arg,"ALL")){num = CsTeam:CS_TEAM_UNASSIGNED;}else{num = CsTeam:CS_TEAM_UNASSIGNED;}if(num != CsTeam:CS_TEAM_UNASSIGNED && num != CsTeam:cs_get_user_team(id))return false;return true;}bool:CanCheck(id,mode){if(zp_is_nemesis_round() || zp_is_sniper_round() || zp_is_survivor_round() || zp_is_plague_round() || zp_is_lnj_round() || zp_is_assassin_round()){ColorChat(id,GREEN, "^4%s ^3%s",CHATTAG,STR_CANTDEPLOY);client_cmd(id, "spk buttons/button2.wav");return false;}if( get_pcvar_num(g_LACCESS) != 0)if(!(get_user_flags(id) & ADMIN_IMMUNITY)){//client_print(id, print_chat, "%s %s",CHATTAG,STR_NOACCESS);ColorChat(id,GREEN, "^4%s ^3%s",CHATTAG,STR_NOACCESS);return false;}if(!pev_user_alive(id)) return false;if (!CheckCanTeam(id)){//client_print(id, print_chat, "%s %s",CHATTAG,STR_CBT);ColorChat(id,GREEN, "^4%s ^3Error.",CHATTAG);return false;}if( mode == 0){if(g_havemine[id] <= 0){//client_print(id, print_chat, "%s %s",CHATTAG,STR_DONTHAVEMINE);ColorChat(id,GREEN, "^4%s ^3%s",CHATTAG,STR_DONTHAVEMINE);client_cmd(id, "spk buttons/button2.wav");return false;}}if (mode == 1){if (g_havemine[id] >= 1) // cate lasere poate cumparareturn false;}if(!CheckTime(id)){//client_print(id,print_chat, "%s %s %d %s",CHATTAG,STR_DELAY,get_pcvar_num(g_LDELAY)-g_nowtime,STR_SECONDS);ColorChat(id,GREEN, "^4%s ^3%s ^1%d ^3%s",CHATTAG,STR_DELAY,get_pcvar_num(g_LDELAY)-g_nowtime,STR_SECONDS);client_cmd(id, "spk buttons/button2.wav");return false;}return true;}bool:ReturnCheck( id ){if(!CanCheck(id,-1)) return false;if(g_havemine[id] + 1 > get_pcvar_num(g_LAMMO)) return false;new tgt,body,Float:vo[3],Float:to[3];get_user_aiming(id,tgt,body);if(!pev_valid(tgt)) return false;pev(id,pev_origin,vo);pev(tgt,pev_origin,to);if(get_distance_f(vo,to) > 90.0) return false;new EntityName[32];pev(tgt, pev_classname, EntityName, 31);if(!equal(EntityName, ENT_CLASS_NAME)) return false;if(pev(tgt,LASERMINE_OWNER) != id) return false;return true;}bool:CreateCheck( id ){if (!CanCheck(id,0)) return false;if (g_deployed[id] >= get_pcvar_num(g_LAMMO)){//client_print(id, print_chat, "%s %s",CHATTAG,STR_MAXDEPLOY);ColorChat(id,GREEN, "^4%s ^3%s",CHATTAG,STR_MAXDEPLOY);return false;}//client_print(id,print_chat,"[Lasermine] your team deployed %d",TeamDeployedCount(id))if(TeamDeployedCount(id) >= get_pcvar_num(g_LTMAX)){//client_print(id, print_chat, "%s %s",CHATTAG,STR_MANYPPL);ColorChat(id,GREEN, "^4%s ^3%s",CHATTAG,STR_MANYPPL);return false;}new Float:vTraceDirection[3], Float:vTraceEnd[3],Float:vOrigin[3];pev( id, pev_origin, vOrigin );velocity_by_aim( id, 128, vTraceDirection );xs_vec_add( vTraceDirection, vOrigin, vTraceEnd );engfunc( EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0 );new Float:fFraction,Float:vTraceNormal[3];get_tr2( 0, TR_flFraction, fFraction );if ( fFraction < 1.0 ){get_tr2( 0, TR_vecEndPos, vTraceEnd );get_tr2( 0, TR_vecPlaneNormal, vTraceNormal );//get_tr2( 0, TR_pHit );return true;}//client_print(id, print_chat, "%s %s",CHATTAG,STR_PLANTWALL)ColorChat(id,GREEN, "^4%s ^3%s",CHATTAG,STR_PLANTWALL)client_cmd(id, "spk buttons/button2.wav");DeleteTask(id);return false;}public ltm_Think( i_Ent ){if ( !pev_valid( i_Ent ) )return FMRES_IGNORED;new EntityName[32];pev( i_Ent, pev_classname, EntityName, 31);if(!get_pcvar_num(g_LENABLE)) return FMRES_IGNORED;if ( !equal( EntityName, ENT_CLASS_NAME ) )return FMRES_IGNORED;static Float:fCurrTime;fCurrTime = get_gametime();switch( pev( i_Ent, LASERMINE_STEP ) ){case POWERUP_THINK :{new Float:fPowerupTime;pev( i_Ent, LASERMINE_POWERUP, fPowerupTime );if( fCurrTime > fPowerupTime ){set_pev( i_Ent, pev_solid, SOLID_BBOX );set_pev( i_Ent, LASERMINE_STEP, BEAMBREAK_THINK );PlaySound( i_Ent, ACTIVATE_SOUND );}if(get_pcvar_num(g_LGLOW)!=0){if(get_pcvar_num(g_LCLMODE)==0){switch (pev(i_Ent,LASERMINE_TEAM)){case CS_TEAM_T: set_rendering(i_Ent,kRenderFxGlowShell,255,0,0,kRenderNormal,5);case CS_TEAM_CT:set_rendering(i_Ent,kRenderFxGlowShell,0,0,255,kRenderNormal,5);}}else{set_rendering(i_Ent,kRenderFxGlowShell,0,255,0,kRenderNormal,5);}}set_pev( i_Ent, pev_nextthink, fCurrTime + 0.1 );}case BEAMBREAK_THINK :{static Float:vEnd[3],Float:vOrigin[3];pev( i_Ent, pev_origin, vOrigin );pev( i_Ent, LASERMINE_BEAMENDPOINT, vEnd );static iHit, Float:fFraction;engfunc( EngFunc_TraceLine, vOrigin, vEnd, DONT_IGNORE_MONSTERS, i_Ent, 0 );get_tr2( 0, TR_flFraction, fFraction );iHit = get_tr2( 0, TR_pHit );if ( fFraction < 1.0 ){if(pev_valid(iHit)){pev( iHit, pev_classname, EntityName, 31 );if( !equal( EntityName, ENT_CLASS_NAME ) && pev_valid(i_Ent)) { set_pev( i_Ent, pev_enemy, iHit ); if(get_pcvar_num(g_LMODE) == MODE_LASERMINE) CreateLaserDamage(i_Ent,iHit); else if(get_pcvar_num(g_LFF) || CsTeams:pev(i_Ent,LASERMINE_TEAM) != cs_get_user_team(iHit)) set_pev( i_Ent, LASERMINE_STEP, EXPLOSE_THINK ); if (pev_valid(i_Ent)) set_pev( i_Ent, pev_nextthink, fCurrTime + random_float( 0.1, 0.3 ) ); }}}if(get_pcvar_num(g_LDMGMODE)!=0)if(pev(i_Ent,LASERMINE_HITING) != iHit)set_pev(i_Ent,LASERMINE_HITING,iHit);if ( pev_valid( i_Ent )){static Float:fHealth;pev( i_Ent, pev_health, fHealth );if( fHealth <= 0.0 || (pev(i_Ent,pev_flags) & FL_KILLME)){set_pev( i_Ent, LASERMINE_STEP, EXPLOSE_THINK );set_pev( i_Ent, pev_nextthink, fCurrTime + random_float( 0.1, 0.3 ) );}static Float:fBeamthink;pev( i_Ent, LASERMINE_BEAMTHINK, fBeamthink );if( fBeamthink < fCurrTime && get_pcvar_num(g_LVISIBLE)){DrawLaser(i_Ent, vOrigin, vEnd );set_pev( i_Ent, LASERMINE_BEAMTHINK, fCurrTime + 0.1 );}set_pev( i_Ent, pev_nextthink, fCurrTime + 0.01 );}}case EXPLOSE_THINK :{set_pev( i_Ent, pev_nextthink, 0.0 );PlaySound( i_Ent, STOP_SOUND );g_deployed[pev(i_Ent,LASERMINE_OWNER)]--;CreateExplosion( i_Ent );CreateDamage(i_Ent,get_pcvar_float(g_LRDMG),get_pcvar_float(g_LRADIUS))RemoveEntity ( i_Ent );}}return FMRES_IGNORED;}PlaySound( i_Ent, i_SoundType ){switch ( i_SoundType ){case POWERUP_SOUND :{emit_sound( i_Ent, CHAN_VOICE, ENT_SOUND1, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );emit_sound( i_Ent, CHAN_BODY , ENT_SOUND2, 0.2, ATTN_NORM, 0, PITCH_NORM );}case ACTIVATE_SOUND :{emit_sound( i_Ent, CHAN_VOICE, ENT_SOUND3, 0.5, ATTN_NORM, 1, 75 );}case STOP_SOUND :{emit_sound( i_Ent, CHAN_BODY , ENT_SOUND2, 0.2, ATTN_NORM, SND_STOP, PITCH_NORM );emit_sound( i_Ent, CHAN_VOICE, ENT_SOUND3, 0.5, ATTN_NORM, SND_STOP, 75 );}}}DrawLaser(i_Ent, const Float:v_Origin[3], const Float:v_EndOrigin[3] ){new tcolor[3];new teamid = pev(i_Ent, LASERMINE_TEAM);if(get_pcvar_num(g_LCLMODE) == 0){switch(teamid){case 1:{tcolor[0] = 255;tcolor[1] = 20;tcolor[2] = 0;}case 2:{tcolor[0] = 0;tcolor[1] = 0;tcolor[2] = 255;}}}else{tcolor[0] = 200;tcolor[1] = 50;tcolor[2] = 100;}message_begin(MSG_BROADCAST,SVC_TEMPENTITY);write_byte(TE_BEAMPOINTS);engfunc(EngFunc_WriteCoord,v_Origin[0]);engfunc(EngFunc_WriteCoord,v_Origin[1]);engfunc(EngFunc_WriteCoord,v_Origin[2]);engfunc(EngFunc_WriteCoord,v_EndOrigin[0]); //Randomengfunc(EngFunc_WriteCoord,v_EndOrigin[1]); //Randomengfunc(EngFunc_WriteCoord,v_EndOrigin[2]); //Randomwrite_short(beam);write_byte(0);write_byte(0);write_byte(1); //Lifewrite_byte(5); //Widthwrite_byte(0); //wavewrite_byte(tcolor[0]); // rwrite_byte(tcolor[1]); // gwrite_byte(tcolor[2]); // bwrite_byte(get_pcvar_num(g_LCBRIGHT));write_byte(255);message_end();}CreateDamage(iCurrent,Float:DmgMAX,Float:Radius){new Float:vecSrc[3];pev(iCurrent, pev_origin, vecSrc);new AtkID =pev(iCurrent,LASERMINE_OWNER);new TeamID=pev(iCurrent,LASERMINE_TEAM);new ent = -1;new Float:tmpdmg = DmgMAX;new Float:kickback = 0.0;new Float:Tabsmin[3], Float:Tabsmax[3];new Float:vecSpot[3];new Float:Aabsmin[3], Float:Aabsmax[3];new Float:vecSee[3];new trRes;new Float:flFraction;new Float:vecEndPos[3];new Float:distance;new Float:origin[3], Float:vecPush[3];new Float:invlen;new Float:velocity[3];new iHitHP,iHitTeam;new Float:falloff;if (Radius > 0.0){falloff = DmgMAX / Radius;} else {falloff = 1.0;}while((ent = engfunc(EngFunc_FindEntityInSphere, ent, vecSrc, Radius)) != 0){if(!pev_valid(ent)) continue;if(!(pev(ent, pev_flags) & (FL_CLIENT | FL_FAKECLIENT))){continue;}if(!pev_user_alive(ent)) continue;kickback = 1.0;tmpdmg = DmgMAX;pev(ent, pev_absmin, Tabsmin);pev(ent, pev_absmax, Tabsmax);xs_vec_add(Tabsmin,Tabsmax,Tabsmin);xs_vec_mul_scalar(Tabsmin,0.5,vecSpot);pev(iCurrent, pev_absmin, Aabsmin);pev(iCurrent, pev_absmax, Aabsmax);xs_vec_add(Aabsmin,Aabsmax,Aabsmin);xs_vec_mul_scalar(Aabsmin,0.5,vecSee);engfunc(EngFunc_TraceLine, vecSee, vecSpot, 0, iCurrent, trRes);get_tr2(trRes, TR_flFraction, flFraction);if (flFraction >= 0.9 || get_tr2(trRes, TR_pHit) == ent){get_tr2(trRes, TR_vecEndPos, vecEndPos);distance = get_distance_f(vecSrc, vecEndPos) * falloff;tmpdmg -= distance;if(tmpdmg < 0.0)tmpdmg = 0.0;if(kickback != 0.0){xs_vec_sub(vecSpot,vecSee,origin);invlen = 1.0/get_distance_f(vecSpot, vecSee);xs_vec_mul_scalar(origin,invlen,vecPush);pev(ent, pev_velocity, velocity)xs_vec_mul_scalar(vecPush,tmpdmg,vecPush);xs_vec_mul_scalar(vecPush,kickback,vecPush);xs_vec_add(velocity,vecPush,velocity);if(tmpdmg < 60.0){xs_vec_mul_scalar(velocity,12.0,velocity);} else {xs_vec_mul_scalar(velocity,4.0,velocity);}if(velocity[0] != 0.0 || velocity[1] != 0.0 || velocity[2] != 0.0){set_pev(ent, pev_velocity, velocity)}}iHitHP = pev_user_health(ent) - floatround(tmpdmg)iHitTeam = int:cs_get_user_team(ent)if(iHitHP <= 0){if(iHitTeam != TeamID){set_score(AtkID,ent,1,iHitHP)}else{if(get_pcvar_num(g_LFF)){set_score(AtkID,ent,-1,iHitHP)}}}else{if(iHitTeam != TeamID || get_pcvar_num(g_LFF)){//set_pev(Player,pev_health,iHitHP)set_user_health(ent, iHitHP)engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,g_msgDamage,{0.0,0.0,0.0},ent);write_byte(floatround(tmpdmg))write_byte(floatround(tmpdmg))write_long(DMG_BULLET)engfunc(EngFunc_WriteCoord,vecSrc[0])engfunc(EngFunc_WriteCoord,vecSrc[1])engfunc(EngFunc_WriteCoord,vecSrc[2])message_end()}}}}return}bool:pev_user_alive(ent){new deadflag = pev(ent,pev_deadflag);if(deadflag != DEAD_NO)return false;return true;}CreateExplosion(iCurrent){new Float:vOrigin[3];pev(iCurrent,pev_origin,vOrigin);message_begin(MSG_BROADCAST, SVC_TEMPENTITY);write_byte(99); //99 = KillBeamwrite_short(iCurrent);message_end();engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vOrigin, 0);write_byte(TE_EXPLOSION);engfunc(EngFunc_WriteCoord,vOrigin[0]);engfunc(EngFunc_WriteCoord,vOrigin[1]);engfunc(EngFunc_WriteCoord,vOrigin[2]);write_short(boom);write_byte(30);write_byte(15);write_byte(0);message_end();}CreateLaserDamage(iCurrent,isHit){if(isHit < 0 ) return PLUGIN_CONTINUEswitch(get_pcvar_num(g_LDMGMODE)){case 1:{if(pev(iCurrent,LASERMINE_HITING) == isHit)return PLUGIN_CONTINUE}case 2:{if(pev(iCurrent,LASERMINE_HITING) == isHit){static Float:cntstatic now,htime;now = floatround(get_gametime())pev(iCurrent,LASERMINE_COUNT,cnt)htime = floatround(cnt)if(now - htime < get_pcvar_num(g_LDSEC)){return PLUGIN_CONTINUE;}else{set_pev(iCurrent,LASERMINE_COUNT,get_gametime())}}else{set_pev(iCurrent,LASERMINE_COUNT,get_gametime())}}}new Float:vOrigin[3],Float:vEnd[3]pev(iCurrent,pev_origin,vOrigin)pev(iCurrent,pev_vuser1,vEnd)new teamid = pev(iCurrent, LASERMINE_TEAM)new szClassName[32]new Alive,Godnew iHitTeam,iHitHP,idnew hitscoreszClassName[0] = '^0'pev(isHit,pev_classname,szClassName,32)if((pev(isHit, pev_flags) & (FL_CLIENT | FL_FAKECLIENT)) && !equal(szClassName, ENT_CLASS_NAME)){Alive = pev_user_alive(isHit)God = get_user_godmode(isHit)if(!Alive || God) return PLUGIN_CONTINUEiHitTeam = int:cs_get_user_team(isHit)iHitHP = pev_user_health(isHit) - get_pcvar_num(g_LDMG)id = pev(iCurrent,LASERMINE_OWNER)//, szNetName[32]if(iHitHP <= 0){if(iHitTeam != teamid){client_cmd(isHit, "spk %s", ENT_SOUND4)hitscore = 1set_score(id,isHit,hitscore,iHitHP)}else{if(get_pcvar_num(g_LFF)){client_cmd(isHit, "spk %s", ENT_SOUND4)hitscore = -1set_score(id,isHit,hitscore,iHitHP)}}}else if(iHitTeam != teamid || get_pcvar_num(g_LFF)){client_cmd(isHit, "spk %s", ENT_SOUND4)set_user_health(isHit,iHitHP)set_pev(iCurrent,LASERMINE_HITING,isHit);engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,g_msgDamage,{0.0,0.0,0.0},isHit);write_byte(get_pcvar_num(g_LDMG))write_byte(get_pcvar_num(g_LDMG))write_long(DMG_BULLET)engfunc(EngFunc_WriteCoord,vOrigin[0])engfunc(EngFunc_WriteCoord,vOrigin[1])engfunc(EngFunc_WriteCoord,vOrigin[2])message_end()}}else if(equal(szClassName, ENT_CLASS_NAME3)){new hl;hl = pev_user_health(isHit);set_user_health(isHit,hl-get_pcvar_num(g_LDMG));}return PLUGIN_CONTINUE}stock pev_user_health(id){new Float:healthpev(id,pev_health,health)return floatround(health)}stock set_user_health(id,health){health > 0 ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);}stock get_user_godmode(index){new Float:valpev(index, pev_takedamage, val)return (val == DAMAGE_NO)}stock set_user_frags(index, frags){set_pev(index, pev_frags, float(frags))return 1}stock pev_user_frags(index){new Float:frags;pev(index,pev_frags,frags);return floatround(frags);}set_score(id,target,hitscore,HP){new idfrags = pev_user_frags(id) + hitscore// get_user_frags(id) + hitscoreset_user_frags(id,idfrags)//set_user_frags(id, idfrags)//entity_set_float(id, EV_FL_frags, float(idfrags))new tarfrags = pev_user_frags(target) + 1 //get_user_frags(target) + 1set_user_frags(target,tarfrags)//set_user_frags(target,tarfrags)//entity_set_float(target, EV_FL_frags, float(tarfrags))new idteam = int:cs_get_user_team(id)new iddeaths = cs_get_user_deaths(id)message_begin(MSG_BROADCAST, g_msgDeathMsg, {0, 0, 0} ,0)write_byte(id)write_byte(target)write_byte(0)write_string(ENT_CLASS_NAME)message_end()message_begin(MSG_BROADCAST, g_msgScoreInfo)write_byte(id)write_short(idfrags)write_short(iddeaths)write_short(0)write_short(idteam)message_end()set_msg_block(g_msgDeathMsg, BLOCK_ONCE)//entity_set_float(target, EV_FL_health,float(HP))set_user_health(target, HP)//set_pev(target,pev_health,HP)}public BuyLasermine(id){if( !CanCheck(id,1) ) return PLUGIN_CONTINUEg_havemine[id]++;emit_sound(id, CHAN_ITEM, ENT_SOUND5, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)ShowAmmo(id)return PLUGIN_HANDLED}ShowAmmo(id){new ammo[51]formatex(ammo, 50, "%s %i/%i",STR_STATE, g_havemine[id],get_pcvar_num(g_LAMMO))message_begin(MSG_ONE_UNRELIABLE, g_msgStatusText, {0,0,0}, id)write_byte(0)write_string(ammo)message_end()}public say_lasermine(id){new said[32]read_argv(1,said,31);if(!get_pcvar_num( g_LENABLE ))return PLUGIN_CONTINUEif (equali(said,"/buy lasermine")||equali(said,"/lm")){BuyLasermine(id)}else{(equali(said, "lasermine") || equali(said, "/lasermine"))}return PLUGIN_CONTINUE}public standing(id){if (!g_settinglaser[id])return PLUGIN_CONTINUEset_pev(id, pev_maxspeed, 1.0)// ShowAmmo(id)return PLUGIN_CONTINUE}public ltm_PostThink(id){if (!g_settinglaser[id] && plsetting[id]){resetspeed(id)}else if (g_settinglaser[id] && !plsetting[id]) {pev(id, pev_maxspeed,plspeed[id])set_pev(id, pev_maxspeed, 1.0)}plsetting[id] = g_settinglaser[id]return FMRES_IGNORED}public ltm_PreThink(id){if (!pev_user_alive(id) || g_settinglaser[id] == true || is_user_bot(id) || get_pcvar_num(g_LCMDMODE) == 1)return FMRES_IGNORED;if(pev(id, pev_button ) & IN_USE && !(pev(id, pev_oldbuttons ) & IN_USE ))//client_print(id,print_chat,"test");CreateLaserMine_Progress(id)return FMRES_IGNORED;}resetspeed(id){set_pev(id, pev_maxspeed, plspeed[id])}public client_putinserver(id){g_deployed[id] = 0;g_havemine[id] = 0;DeleteTask(id);return PLUGIN_CONTINUE}public client_disconnected(id){if(!get_pcvar_num( g_LENABLE ))return PLUGIN_CONTINUEDeleteTask(id);RemoveAllTripmines(id);return PLUGIN_CONTINUE}public newround(id){if(!get_pcvar_num( g_LENABLE ))return PLUGIN_CONTINUEpev(id, pev_maxspeed,plspeed[id])DeleteTask(id);RemoveAllTripmines(id);delaycount(id);SetStartAmmo(id);return PLUGIN_CONTINUE}public DeathEvent(){if(!get_pcvar_num( g_LENABLE ))return PLUGIN_CONTINUEnew id = read_data(2)if(is_user_connected(id)) DeleteTask(id);return PLUGIN_CONTINUE}public RemoveAllTripmines( i_Owner ){new iEnt = g_MaxPL + 1;new clsname[32];while( ( iEnt = engfunc( EngFunc_FindEntityByString, iEnt, "classname", ENT_CLASS_NAME ) ) ){if ( i_Owner ){if( pev( iEnt, LASERMINE_OWNER ) != i_Owner )continue;clsname[0] = '^0'pev( iEnt, pev_classname, clsname, sizeof(clsname)-1 );if ( equali( clsname, ENT_CLASS_NAME ) ){PlaySound( iEnt, STOP_SOUND );RemoveEntity( iEnt );}}elseset_pev( iEnt, pev_flags, FL_KILLME );}g_deployed[i_Owner]=0;}SetStartAmmo(id){new stammo = get_pcvar_num(g_LSTAMMO);if(stammo <= 0) return PLUGIN_CONTINUE;g_havemine[id] = (g_havemine[id] <= stammo) ? stammo : g_havemine[id];return PLUGIN_CONTINUE;}public CutDeploy_onDamage(id){if(get_user_health(id) < 1)DeleteTask(id);}DeleteTask(id){if (task_exists((TASK_PLANT + id))){remove_task((TASK_PLANT + id))}if (task_exists((TASK_RELEASE + id))){remove_task((TASK_RELEASE + id))}g_settinglaser[id] = falsereturn PLUGIN_CONTINUE;}stock set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16){static Float:RenderColor[3];RenderColor[0] = float(r);RenderColor[1] = float(g);RenderColor[2] = float(b);set_pev(entity, pev_renderfx, fx);set_pev(entity, pev_rendercolor, RenderColor);set_pev(entity, pev_rendermode, render);set_pev(entity, pev_renderamt, float(amount));return 1}get_offset_value(id, type){new key = -1;switch(type){case OFFSET_TEAM: key = OFFSET_TEAM;case OFFSET_DEATH: key = OFFSET_DEATH;}if(key != -1){return get_pdata_int(id, key);}return -1;}public fw_TraceLine( Float:fStart[3] , Float:fEnd[3] , Conditions , id , iTrace ){static entif( pev_valid( ( ent = get_tr2( iTrace , TR_pHit ) ) ) ){static szClassName[35], Float: fHealthpev(ent, pev_classname, szClassName, szClassName,charsmax(szClassName))pev(ent, pev_health, fHealth )if(equali(szClassName, ENT_CLASS_NAME)){static szPlayerName[32], playeridplayerid = pev(ent, LASERMINE_OWNER)get_user_name(playerid, szPlayerName, charsmax(szPlayerName))if(cs_get_user_team(playerid) == CS_TEAM_T) {set_hudmessage(255, 0, 0, -1.0, 0.55, 0, 0.1, 0.1, 0.1, 0.1)show_hudmessage(id, "Owner: %s^n Health: %0.1f%%", szPlayerName, fHealth * 100 / get_pcvar_num(g_LHEALTH))}if(cs_get_user_team(playerid) == CS_TEAM_CT) {set_hudmessage(0, 0, 255, -1.0, 0.55, 0, 0.1, 0.1, 0.1, 0.1)show_hudmessage(id, "Owner: %s^n Health: %0.1f%%", szPlayerName, fHealth * 100 / get_pcvar_num(g_LHEALTH))}}}}public Lasermine_TakeDamagePre(victim, inflictor, attacker, Float:f_Damage, bit_Damage){if(!pev_valid(victim))return HAM_IGNORED;static EntityName[32], Owner;pev(victim, pev_classname, EntityName, 31);if(!equal(EntityName, ENT_CLASS_NAME))return HAM_IGNORED;Owner = pev(victim, LASERMINE_OWNER)if(Owner != attacker && (!zp_get_user_zombie(attacker) && !zp_get_user_zombie(Owner) || zp_get_user_zombie(attacker) && zp_get_user_zombie(Owner)))return HAM_SUPERCEDE;return HAM_IGNORED}
Code:
zp_lasermine_3.0.amxx
Statistics: Posted by Rainq — Sat Jan 06, 2024 10:08 pm
Code:
admin.amxxadmin_sql.amxxadmincmd.amxx; basic admin console commandsmultilingual.amxx; Multi-Lingual managementplmenu.amxx; players menu (kick, ban, client cmds.)mapsmenu.amxx; maps menu (vote, changelevel9099adminchat.amxx; console chat commandsadminvote.amxx; vote commandsnextmap.amxx; displays next map in mapcyclemapchooser.amxx; allows to vote for next maptimeleft.amxx; displays time left on mapstatscfg.amxx; Pentru top15statsx.amxx; Top15; PLUGINUL DE BAZAzombie_plague.amxx ; Pluginul de bazazombie_experince.amxx ; XPunstuck.amxx; /unstuckzm_vip_remake.amxx ; VIPzp_bank_save_levelXP.amxx ; Salveaza level; Classe de ZMlvl2_zombie_creature_boomer_update.amxx; Classe de Humansoldier_class_healer.amxx
Statistics: Posted by Rainq — Fri Jan 05, 2024 8:13 pm
Code:
zm_AI_walking_death_nightmarezm_darkcity_betazm_srise_horrorstrikezm_villagezm_deko2zp_town_csozm_towningzm_dust_villagezm_hell_brzm_city_horrorzm_dust2_UBCSzm_city_newzm_street_newzm_dacha_newzm_death_housezm_dust-cfbcs_beta1zm_ahousezm_lab_horror_betazm_chinazm_canabyszm_chuvy_arenazm_jampadracis2zm_redyxftwzp_sanderzp_alphacode_csode_scud_2k1-zpzp_winter_townzm_lighthouse_betazm_dust_winterzm_chatoyantzm_vendettazm_street_escapezm_ice_attack_renovationZm_perdidos_sczm_racoon_city_2zm_mix2zm_deadcity_play4everzm_racoon_city_2Lxzm_dust2_cityzm_ded_street3zm_nvolazm_2060zm_deadzm_dust2_new_v2zm_isolationzm_china_v2blahhhhzm_base_old_schoolzm_dust_world_hellzm_dead_modzm_crosszm_ice_attack3zm_ice_attackzm_dust1_silentzm_csprima_f1n4lzm_747_small_b3_zgzm_assaultzm_aztec_minizm_coastzm_covidzm_crazyhousezm_creepy_housezm_dead_cityzm_desert_2011zm_desert_invasionzm_districtzm_dust_army_winter_ezm_dust_kamp_xmaszm_dust_world_rezm_dust1_campzm_dust2_2x2_winterzm_dust2x2_fearzm_dust2x2_horrorzm_energyzm_epic_zonezm_estate_remakezm_fdust_developedzm_fear_campzm_fear_streetzm_fodazm_forbiddenzm_frosty_pctzm_gradeyardzm_Hellzm_hospital_v1zm_humanszm_ice_attack2zm_ice_attack2009zm_levels_finalzm_morozilkazm_murder_housezm_nebulae_surfacezm_neriszm_new_snowbasezm_saw_v2zm_snowzm_snow2012zm_umbrella_officezm_xenzm_zombie_office_zgzp_boss_constructionzp_bunker_betazp_gorod_newzp_town_beta
Statistics: Posted by Rainq — Thu Jan 04, 2024 5:33 pm
Code:
BoomerHuskSirenPyramid HeadChainsawDogExecutionerPredatorJumperSneakyCrowleyCrowSpiderThe Dead BabyHunterLeapZM anti frog/fire si clasic
Code:
zombie_creature_update.amxx
Statistics: Posted by Rainq — Wed Jan 03, 2024 5:56 pm
Code:
#include <amxmodx>#include <fakemeta>#include <hamsandwich>#include <zombieplague>#define MAX_CLIENTS 32#define TASKID_SCREAMER 1550#define TASKID_REMOVE_SCREAMER 1650 // daca sunt in conflict, schimbati (diferenta cu sarcina de mai sus +33)// Linux extra offsets#define PDATA_SAFE 2#define linux_diff_weapon 4#define linux_diff_player 5// CBaseMonster#define m_flNextAttack 83// CBasePlayer#define m_pActiveItem 373#define SCREAMER_RESET_TIME random_float(120.0, 160.0) // delay intre modele#define SCREAMER_MODEL_TIME 2.0 // cat timp tine modelul pe ecran#define SCREAMER_RADIUS_HUMANS 350.0 // radius#define SCREAMER_MIN_PLAYERS 1 // numarul minim de jucatori pentru a rula pluginul//#define SCREAMER_ENABLE_SURVIVOR // daca merge pe survivor#define SCREAMER_ENABLE_DLIGHT // lumina#define SCREAMER_BLOCK_SWITCH_WEAPON // blocarea schimbarilor de arme#define SCREAMER_BLOCK_SHOOTING // blocheaza arma#define SCREAMER_VOLUME 1.0 // cat de tare sa se auda new Float: gl_flUserScreamed[MAX_CLIENTS + 1];new const SCREAMER_MODELS[][] = {"models/x/screamer1.mdl","models/x/screamer2.mdl","models/x/screamer3.mdl"};new const SCREAMER_SOUNDS[][] ={"scream/1.wav","scream/2.wav","scream/3.wav","scream/4.wav"};public plugin_init(){register_plugin("[ZP] Addon: Screamer", "1.0", "xUnicorn (t3rkecorejz)");#if defined SCREAMER_BLOCK_SWITCH_WEAPONregister_forward(FM_ClientCommand, "FM_Hook_ClientCommand_Pre", false);#endifRegisterHam(Ham_Spawn, "player", "CBasePlayer__Spawn_Post", true);}public plugin_precache(){new i;for(i = 0; i < sizeof SCREAMER_MODELS; i++)engfunc(EngFunc_PrecacheModel, SCREAMER_MODELS[i]);for(i = 0; i < sizeof SCREAMER_SOUNDS; i++)engfunc(EngFunc_PrecacheSound, SCREAMER_SOUNDS[i]);}public client_putinserver(iPlayer) Reset_Value(iPlayer);//public client_disconnect(iPlayer) Reset_Value(iPlayer);#if defined SCREAMER_BLOCK_SWITCH_WEAPONpublic FM_Hook_ClientCommand_Pre(iPlayer){new szCommand[32]; read_argv(0, szCommand, charsmax(szCommand));new szBlockCommands[][] = { "drop", "lastinv", "weapon_", "slot" };if(gl_flUserScreamed[iPlayer] > get_gametime()){for(new i = 0; i < sizeof szBlockCommands; i++){if(equali(szCommand, szBlockCommands[i], strlen(szBlockCommands[i]))) return FMRES_SUPERCEDE;}}return FMRES_IGNORED}#endifpublic CBasePlayer__Spawn_Post(iPlayer){if(!is_user_alive(iPlayer)) return HAM_IGNORED;if(get_playersnum() >= SCREAMER_MIN_PLAYERS && !zp_get_user_zombie(iPlayer))set_task(SCREAMER_RESET_TIME, "CTask__StartScreamer", iPlayer + TASKID_SCREAMER, _, _, .flags = "b");return HAM_IGNORED;}public zp_user_infected_post(iPlayer) Reset_Value(iPlayer);public zp_user_humanized_post(iPlayer){Reset_Value(iPlayer);if(get_playersnum() >= SCREAMER_MIN_PLAYERS)set_task(SCREAMER_RESET_TIME, "CTask__StartScreamer", iPlayer + TASKID_SCREAMER, _, _, .flags = "b");}public CTask__StartScreamer(iTask){new iPlayer = iTask - TASKID_SCREAMER;if(!zp_has_round_started()) return;if(gl_flUserScreamed[iPlayer] > get_gametime()) return;if(!is_user_alive(iPlayer) || zp_get_user_zombie(iPlayer)){remove_task(iPlayer + TASKID_SCREAMER);return;}#if !defined SCREAMER_ENABLE_SURVIVORif(zp_get_user_survivor(iPlayer)){remove_task(iPlayer + TASKID_SCREAMER);return;}#endifstatic iHuman;static Float: vecOrigin[3]; pev(iPlayer, pev_origin, vecOrigin);while((iHuman = engfunc(EngFunc_FindEntityInSphere, iHuman, vecOrigin, SCREAMER_RADIUS_HUMANS)) > 0){if(iPlayer == iHuman || !is_user_alive(iHuman) || zp_get_user_zombie(iHuman)) continue;return;}set_pev(iPlayer, pev_viewmodel2, SCREAMER_MODELS[random_num(0, sizeof SCREAMER_MODELS - 1)]);emit_sound(iPlayer, CHAN_WEAPON, SCREAMER_SOUNDS[random_num(0, sizeof SCREAMER_SOUNDS - 1)], SCREAMER_VOLUME, ATTN_NORM, 0, PITCH_NORM);gl_flUserScreamed[iPlayer] = get_gametime() + SCREAMER_MODEL_TIME;#if defined SCREAMER_ENABLE_DLIGHTengfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vecOrigin, 0);write_byte(TE_DLIGHT); // TE indexengfunc(EngFunc_WriteCoord, vecOrigin[0]); // Xengfunc(EngFunc_WriteCoord, vecOrigin[1]); // Yengfunc(EngFunc_WriteCoord, vecOrigin[2]); // Zwrite_byte(25); // Radius write_byte(255); // Redwrite_byte(0); // Greenwrite_byte(0); // Bluewrite_byte(floatround(SCREAMER_MODEL_TIME * 10)); // Life write_byte(15); // Decay rate message_end();#endif#if defined SCREAMER_BLOCK_SHOOTINGset_pdata_float(iPlayer, m_flNextAttack, SCREAMER_MODEL_TIME, linux_diff_player);#endifset_task(SCREAMER_MODEL_TIME, "CTask__RemoveScreamer", iPlayer + TASKID_REMOVE_SCREAMER);}public CTask__RemoveScreamer(iTask){new iPlayer = iTask - TASKID_REMOVE_SCREAMER;Remove_Screamer(iPlayer);}public Remove_Screamer(iPlayer){if(!is_user_alive(iPlayer)) return;emit_sound(iPlayer, CHAN_WEAPON, "common/null.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);new iItem = get_pdata_cbase(iPlayer, m_pActiveItem, linux_diff_player);if(pev_valid(iItem) == PDATA_SAFE)ExecuteHamB(Ham_Item_Deploy, iItem);}Reset_Value(iPlayer){if(is_user_bot(iPlayer)) return;gl_flUserScreamed[iPlayer] = 0.0;//Remove_Screamer(iPlayer); // singurul lucru la functia asta e ca atunci cand primeste scary o sa ramana pe arma respectiva ,daca spre exemplu//set_pdata_float(iPlayer, m_flNextAttack, 0.0, linux_diff_player); // a aruncat grenada si primeste scary in acelasi timp ramane pe grenada dar fara item, nu afecteaza serverulif(!task_exists(iPlayer + TASKID_SCREAMER))remove_task(iPlayer + TASKID_SCREAMER);if(!task_exists(iPlayer + TASKID_REMOVE_SCREAMER))remove_task(iPlayer + TASKID_REMOVE_SCREAMER);}
Code:
zp_addon_screamer.amxx
Statistics: Posted by Rainq — Wed Jan 03, 2024 5:00 pm
Code:
#include <amxmodx>#include <cstrike>#include <fakemeta>#include <hamsandwich>#include <zombieplague>#define MAX_PLAYERS32#define XTRA_OFS_WEAPON4#define m_pPlayer41#define m_fInReload54#define XTRA_OFS_PLAYER5#define m_flNextAttack83new weapons[][]={ "weapon_p228", "weapon_scout", "weapon_xm1014", "weapon_mac10", "weapon_aug", "weapon_elite", "weapon_fiveseven", "weapon_ump45","weapon_sg550", "weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp","weapon_mp5navy", "weapon_m249","weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_deagle", "weapon_sg552", "weapon_ak47", "weapon_p90"}new g_iSendAudioconst NOCLIP_WPN_BS = ((1<<2)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))const SHOTGUNS_BS = ((1<<CSW_M3)|(1<<CSW_XM1014))new g_pCvarRadioDelay,audio_cvarnew Float:g_flNextRadioGameTime[MAX_PLAYERS+1]new g_szLocation[MAX_PLAYERS+1][32]static sprite[33][16]new users_character[33]new male_sounds[][] ={"zombie_plague/zpcspower/reload.wav","zombie_plague/zpcspower/reload1.wav","zombie_plague/zpcspower/reload2.wav","zombie_plague/zpcspower/reload3.wav","zombie_plague/zpcspower/reload4.wav","zombie_plague/zpcspower/reload5.wav","zombie_plague/zpcspower/reload6.wav","zombie_plague/zpcspower/reload7.wav","zombie_plague/zpcspower/reload8.wav","zombie_plague/zpcspower/reload9.wav","zombie_plague/zpcspower/reload11.wav","zombie_plague/zpcspower/reload12.wav", "zombie_plague/zpcspower/reload13.wav", "zombie_plague/zpcspower/reload14.wav", "zombie_plague/zpcspower/reload15.wav"}public plugin_init(){register_plugin("L4D Reloading Sounds", "2.9", "One/Connor")/* Delay between reloads*/g_pCvarRadioDelay = register_cvar("reload_radio_delay", "5")/* Reload Hook event*/for(new i = 0 ; i< sizeof weapons; i++){RegisterHam(Ham_Weapon_Reload, weapons[i], "Weapon_Reload", 1)}register_event("CurWeapon", "ev_CheckWeapon", "be", "1=1")register_event("ResetHUD","resethud","be")new szModName[7]get_modname(szModName, charsmax(szModName))if(equal(szModName, "czero")){register_event("Location", "Event_Location", "be")}audio_cvar = register_cvar("amx_reload_sound","1")//Enables Reloadsoundsg_iSendAudio = get_user_msgid("SendAudio")}public ev_CheckWeapon(id){if(zp_get_user_zombie(id))return PLUGIN_HANDLEDnew clip, ammostatic iwpniwpn = get_user_weapon(id, clip, ammo)switch(iwpn) {case CSW_P228: sprite[id]="d_p228"case CSW_SCOUT: sprite[id]="d_scout"case CSW_HEGRENADE: sprite[id]="d_grenade"case CSW_XM1014: sprite[id]="d_xm1014"case CSW_MAC10: sprite[id]="d_mac10"case CSW_AUG: sprite[id]="d_aug"case CSW_SMOKEGRENADE: sprite[id]="d_flashbang"case CSW_ELITE: sprite[id]="d_elite"case CSW_FIVESEVEN: sprite[id]="d_fiveseven"case CSW_UMP45: sprite[id]="d_ump45"case CSW_SG550: sprite[id]="d_sg550"case CSW_GALIL: sprite[id]="d_galil"case CSW_FAMAS: sprite[id]="d_famas"case CSW_USP: sprite[id]="d_usp"case CSW_MP5NAVY: sprite[id]="d_mp5navy"case CSW_M249: sprite[id]="d_m249"case CSW_M3: sprite[id]="d_m3"case CSW_M4A1: sprite[id]="d_m4a1"case CSW_TMP: sprite[id]="d_tmp"case CSW_G3SG1: sprite[id]="d_g3sg1"case CSW_FLASHBANG: sprite[id]="d_flashbang"case CSW_DEAGLE: sprite[id]="d_deagle"case CSW_SG552: sprite[id]="d_sg552"case CSW_AK47: sprite[id]="d_ak47"case CSW_KNIFE: sprite[id]="d_knife"case CSW_P90: sprite[id]="d_p90"case CSW_GLOCK18: sprite[id]="d_glock18"case CSW_AWP: sprite[id]="d_awp"}return PLUGIN_HANDLED}public resethud(id){if(zp_get_user_zombie(id))return PLUGIN_HANDLEDusers_character[id] = 1//malereturn PLUGIN_HANDLED}public plugin_precache(){for( new i; i < sizeof male_sounds; i++ ){precache_sound(male_sounds[i])}}public Event_Location( id ){if(zp_get_user_zombie(id))return PLUGIN_HANDLEDif( read_data(1) == id ){read_data(2, g_szLocation[id], charsmax(g_szLocation[]))}return PLUGIN_HANDLED}Reload_Inform( id ){if(zp_get_user_zombie(id))return PLUGIN_HANDLEDnew Float:flGameTime = get_gametime()if( flGameTime > g_flNextRadioGameTime[id] ){g_flNextRadioGameTime[id] + get_pcvar_float(g_pCvarRadioDelay)new iPlayers[MAX_PLAYERS], iNum, iPlayernew CsTeams:iTeam = cs_get_user_team(id)new male = random_num( 0, sizeof male_sounds-1 )new szId[4]num_to_str(id, szId, charsmax(szId))new szName[32]get_user_name(id, szName, charsmax(szName))new szLocation[32]szLocation = g_szLocation[id]get_players(iPlayers, iNum, "ch")for(new i; i<iNum; i++){iPlayer = iPlayers[i]if( iPlayer == id || cs_get_user_team(iPlayer) == iTeam ){if(get_pcvar_num(audio_cvar)){if(users_character[id] == 1){Send_SendAudio(id, iPlayer, male_sounds[male])}}}}}return PLUGIN_HANDLED}public Weapon_Reload( iEnt ){if( get_pdata_int(iEnt, m_fInReload, XTRA_OFS_WEAPON) ){new id = get_pdata_cbase(iEnt, m_pPlayer, XTRA_OFS_WEAPON)Reload_Inform(id)}}Send_SendAudio(const iSender, const iReceiver, const szSound[], const iPitch = 100){message_begin(MSG_ONE_UNRELIABLE, g_iSendAudio, .player=iReceiver)write_byte(iSender)write_string(szSound)write_short(iPitch)message_end()}
Code:
Reload_Sounds_ZP.amxx
Code:
reload_radio_delay
Statistics: Posted by Rainq — Wed Jan 03, 2024 4:43 pm
Code:
case 3(sau la ce numar aveti voi unstuck): client_cmd(id, "say /unstuck"); // unstuck
Code:
#include < amxmodx >#include < fakemeta >#include < zombieplague >#define MAX_CLIENTS 32#define START_DISTANCE 32#define MAX_ATTEMPTS 128#define GetPlayerHullSize(%1) ( ( pev ( %1, pev_flags ) & FL_DUCKING ) ? HULL_HEAD : HULL_HUMAN )new Float:gf_LastCmdTime [ MAX_CLIENTS + 1 ];enum Coord_e{Float:x,Float:y,Float:z};public plugin_init ( ){register_plugin ( "AMXX Unstuck", "1.7.2", "AMXX Dev Builder" );register_clcmd ( "say /unstuck", "FunC_CheckStuck", -1 );register_clcmd ( "say /stuck", "FunC_CheckStuck", -1 );register_clcmd ( "say /unblock", "FunC_CheckStuck", -1 );}public FunC_CheckStuck ( const iPlayer){gf_LastCmdTime [ iPlayer ] = get_gametime ( );UnstuckPlayer ( iPlayer, START_DISTANCE, MAX_ATTEMPTS ) != 1;return 1;}public UnstuckPlayer ( const id, const i_StartDistance, const i_MaxAttempts ){if ( is_user_alive ( id ) || zp_get_user_zombie ( id ) ){static Float:vf_OriginalOrigin [ Coord_e ], Float:vf_NewOrigin [ Coord_e ];static i_Attempts, i_Distance;pev ( id, pev_origin, vf_OriginalOrigin );i_Distance = i_StartDistance;while ( i_Distance < 1000 ){i_Attempts = i_MaxAttempts;while ( i_Attempts-- ){vf_NewOrigin [ x ] = random_float ( vf_OriginalOrigin [ x ] - i_Distance, vf_OriginalOrigin [ x ] + i_Distance );vf_NewOrigin [ y ] = random_float ( vf_OriginalOrigin [ y ] - i_Distance, vf_OriginalOrigin [ y ] + i_Distance );vf_NewOrigin [ z ] = random_float ( vf_OriginalOrigin [ z ] - i_Distance, vf_OriginalOrigin [ z ] + i_Distance );engfunc ( EngFunc_TraceHull, vf_NewOrigin, vf_NewOrigin, DONT_IGNORE_MONSTERS, GetPlayerHullSize ( id ), id, 0 );if ( get_tr2 ( 0, TR_InOpen ) && !get_tr2 ( 0, TR_AllSolid ) && !get_tr2 ( 0, TR_StartSolid ) ){engfunc ( EngFunc_SetOrigin, id, vf_NewOrigin );client_cmd ( id, "spk fvox/blip.wav" );return 1;}}i_Distance += i_StartDistance;}} return 0;}
Code:
unstuck.amxx
Statistics: Posted by Rainq — Tue Jan 02, 2024 8:58 pm
Code:
zombiemodels.amxx
Statistics: Posted by Rainq — Tue Jan 02, 2024 8:17 pm
Code:
#include <amxmodx>#include <engine>#include <fakemeta>#include <hamsandwich>#include <zombieplague>#include <zombiexp>#include <xs>enum _:Coord_t { Float:x, Float:y,Float:z }#define VectorMA(%0,%1,%2,%3) ( %3[ x ] = %0[ x ] + %1 * %2[ x ], %3[ y ] = %0[ y ] + %1 * %2[ y ], %3[ z ] = %0[ z ] + %1 * %2[ z ] )#define PLUGIN "[ZP] Constructor Human"#define VERSION "1.0"#define AUTHOR "Shadows Adi edited Rainq"/* NU LE MODIFICA */#define BAR_MINS Float:{ -6.430000, -53.943878, -0.527283 }#define BAR_MAXS Float:{ 1.900000, 50.996113, 122.572678 }/* NU LE MODIFICA */#define ENT_DISTANCE 100.0#define TASK_CONSTRUCT 28372#define TASK_SOLID 23928enum _:Cvars{Float:BARRICADE_HEALTH}// Human Attributesnew const hclass_name[] = { "Constructor Soldier" } // name new const hclass_info[] = { "[E] \w- \r[FREE]" } // descriptionnew const hclass_model[] = { "" } // modelnew const hclass_weapons[] = { "" } // weaponsconst hclass_health = 230 // healthconst hclass_speed = 240 // speedconst Float:hclass_gravity = 1.00 // gravityconst hclass_level = 0 // level required to usenew const g_szModel[] = "models/zp/f3barricade.mdl"new const g_szClassName[] = "barricade"new g_iConstructorClassnew g_iConstructorEnt[MAX_PLAYERS + 1]new g_iMsgBarTimenew bool:g_bIsConstructing[MAX_PLAYERS + 1]new g_iCvars[Cvars]new g_iBarricades[MAX_PLAYERS + 1]public plugin_init(){register_plugin(PLUGIN, VERSION, AUTHOR)g_iConstructorClass = zpxp_register_human_class(hclass_name, hclass_info, hclass_model, hclass_weapons, hclass_health, hclass_speed, hclass_gravity, hclass_level)g_iMsgBarTime = get_user_msgid("BarTime");new pcvar = register_cvar("construct_hp", "300")g_iCvars[BARRICADE_HEALTH] = get_pcvar_float(pcvar)register_event("HLTV", "ev_NewRound", "a", "1=0", "2=0");register_forward(FM_Touch, "FM_TouchPre")RegisterHam(Ham_Think, "info_target", "barricade_ThinkPre")RegisterHam(Ham_TakeDamage, "info_target", "barricade_TakeDamage_Pre", 0)RegisterHam(Ham_TakeDamage, "info_target", "barricade_TakeDamage_Post", 1)RegisterHam(Ham_Killed, "player", "Ham_PlayerKilled_Post", 1)}public plugin_precache(){precache_model(g_szModel)}public client_PostThink(id){if(CheckConditions(id)){static buttonbutton = get_user_button(id)if(button & IN_USE){ConstructPre(id)}else {if(g_bIsConstructing[id]){StopConstruct(id)}}}}public ConstructPre(id){if(CheckConditions(id) && !g_bIsConstructing[id]){if(g_iBarricades[id] == 3) // rainq{//client_print(id, print_chat, "Max Barricades")return PLUGIN_HANDLED}new iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))set_pev(iEnt, pev_classname, g_szClassName)engfunc(EngFunc_SetModel, iEnt, g_szModel)static Float:flOrigin[3], iOrigin[3]if(engfunc(EngFunc_PointContents, flOrigin) == CONTENTS_SKY){return PLUGIN_HANDLED}g_bIsConstructing[id] = trueget_user_origin(id, iOrigin, 0)IVecFVec(iOrigin, flOrigin)engfunc(EngFunc_SetSize, iEnt, BAR_MINS, BAR_MAXS)get_user_viewpoint(id, iEnt, flOrigin)new Float:flAngles[3]entity_get_vector(id, EV_VEC_angles, flAngles)flAngles[0] = 0.0//flAngles[1] -= 90.0flAngles[2] = 0.0SetEntityAngles(iEnt, flAngles)set_pev(iEnt, pev_mins, BAR_MINS)set_pev(iEnt, pev_maxs, BAR_MAXS )set_pev(iEnt, pev_absmin, BAR_MINS)set_pev(iEnt, pev_absmax, BAR_MAXS )set_pev(iEnt, pev_movetype, MOVETYPE_PUSHSTEP)set_pev(iEnt, pev_solid, SOLID_NOT)set_pev(iEnt, pev_health, g_iCvars[BARRICADE_HEALTH])set_pev(iEnt, pev_takedamage, DAMAGE_YES)set_pev(iEnt, pev_rendermode, kRenderTransAdd)set_pev(iEnt, pev_renderfx, kRenderFxHologram)set_pev(iEnt, pev_renderamt, 255.0)set_pev(iEnt, pev_rendercolor, {255.0,255.0,255.0})set_pev(iEnt, pev_nextthink, get_gametime() + 0.01)set_pev(iEnt, pev_owner, id)engfunc(EngFunc_DropToFloor, iEnt)ShowBarricadeBar(id, floatround(3.0)) // rainqg_iConstructorEnt[id] = iEntset_task(3.0, "task_construct_post", id + TASK_CONSTRUCT)}return PLUGIN_HANDLED}public task_construct_post(id){id -= TASK_CONSTRUCTnew iEnt = g_iConstructorEnt[id]if(!pev_valid(iEnt)){return}set_pev(iEnt, pev_nextthink, 0)set_pev(iEnt, pev_movetype, MOVETYPE_TOSS)set_pev(iEnt, pev_solid, SOLID_BBOX)set_pev(iEnt, pev_rendermode, kRenderNormal);set_pev(iEnt, pev_renderfx,kRenderFxNone);engfunc(EngFunc_SetSize, iEnt, BAR_MINS, BAR_MAXS)engfunc(EngFunc_DropToFloor, iEnt)g_bIsConstructing[id] = falseg_iBarricades[id] += 1client_print(id, print_center, "You have %d barricades left!", 3 - g_iBarricades[id]) // rainq}public StopConstruct(id){if(task_exists(id + TASK_CONSTRUCT)){remove_task(id + TASK_CONSTRUCT)}if(g_bIsConstructing[id]){new iEnt = g_iConstructorEnt[id]HideBarricadeBar(id)if(pev_valid(iEnt)){new flagspev(iEnt, pev_flags, flags);set_pev(iEnt, pev_flags, flags | FL_KILLME);}g_bIsConstructing[id] = false}}public ev_NewRound(){remove_entity_name(g_szClassName)arrayset(g_iBarricades, 0, charsmax(g_iBarricades))}public FM_TouchPre(iToucher, iEnt){if(is_user_alive(iToucher) && pev_valid(iEnt)){static szClass[32]pev(iEnt, pev_classname, szClass, charsmax(szClass))if (!equal(szClass, g_szClassName))return FMRES_IGNOREDif(!zp_get_user_zombie(iToucher)){set_pev(iEnt, pev_solid, SOLID_NOT)set_pev(iEnt, pev_rendermode, kRenderTransAdd)set_pev(iEnt, pev_rendercolor, {255.0,255.0,255.0})set_task(0.3, "task_make_solid", iEnt + TASK_SOLID)}}return FMRES_IGNORED}public task_make_solid(iEnt){iEnt -= TASK_SOLIDif(!pev_valid(iEnt))return FMRES_IGNOREDstatic szClassName[32];pev(iEnt, pev_classname, szClassName, charsmax(szClassName)) if(!equal(szClassName, g_szClassName)) return FMRES_IGNORED;set_pev(iEnt, pev_solid, SOLID_BBOX)set_pev(iEnt, pev_rendermode, kRenderNormal)return FMRES_IGNORED}public barricade_ThinkPre(iEnt){if(!pev_valid(iEnt))returnstatic className[32]pev(iEnt, pev_classname, className, charsmax(className))if(!equali(className, g_szClassName)) {return}new id = pev(iEnt, pev_owner)if(is_user_alive(id)){new button = get_user_button(id)new Float:fStartPos[3], Float:fvOFS[3], Float:fAngles[3]pev(id, pev_origin, fStartPos)pev(id, pev_view_ofs, fvOFS)pev(id, pev_angles, fAngles)fAngles[0] = 0.0/*if(!(pev(id, pev_flags) & FL_DUCKING)){fStartPos[2] -= fvOFS[2]}*/set_pev(iEnt, pev_origin, fStartPos)set_pev(iEnt, pev_angles, fAngles)if(button & IN_FORWARD){entity_set_aim(iEnt, id, true);}else{entity_set_aim(iEnt, id);}shift_entity_position(iEnt, 100.0, 0.0, -(fvOFS[2] + 4.0))engfunc(EngFunc_DropToFloor, iEnt)set_pev(iEnt, pev_nextthink, get_gametime() + 0.01)}}public barricade_TakeDamage_Pre(iEnt, iInflictor, iAttacker, Float:flDamage, damagebits){ if(!pev_valid(iEnt)) return HAM_IGNORED static className[32] pev(iEnt, pev_classname, className, charsmax(className)) if(!equali(className, g_szClassName) || !is_user_connected(iAttacker)) { return HAM_IGNORED } if(!zp_get_user_zombie(iAttacker)) { return HAM_SUPERCEDE } return HAM_IGNORED}public barricade_TakeDamage_Post(iEnt, iInflictor, iAttacker, Float:flDamage, damagebits){if(!pev_valid(iEnt))returnstatic className[32]pev(iEnt, pev_classname, className, charsmax(className))if(!equali(className, g_szClassName)) returnnew Float:health;pev(iEnt, pev_health, health);if(is_user_connected(iAttacker) && health > 0){client_print(iAttacker, print_center, "Barricade HP: %1.f", health)}}public Ham_PlayerKilled_Post(id){if(!pev_valid(id))return HAM_IGNOREDnew iEntwhile((iEnt = find_ent_by_owner(-1, g_szClassName, id)) > 0 && is_valid_ent(iEnt)){remove_entity(iEnt)g_iBarricades[id] -= 1}return HAM_IGNORED}public zp_user_infected_post(id, infector, nemesis){new iEntwhile((iEnt = find_ent_by_owner(-1, g_szClassName, id)) > 0 && is_valid_ent(iEnt)){remove_entity(iEnt)}}stock get_user_viewpoint(player, iEnt, Float:flOrigin[3]){const Float:LENGTH = ENT_DISTANCE;new Float:dirForward[ 3 ];new Float:viewAngles[ 3 ];pev( player, pev_v_angle, viewAngles ); engfunc( EngFunc_MakeVectors, viewAngles );global_get( glb_v_forward, dirForward ); VectorMA( flOrigin, LENGTH, dirForward, flOrigin );engfunc(EngFunc_SetOrigin, iEnt, flOrigin)}stock entity_set_aim(ent, player, bool:bBackWards = false) { static Float:origin[3], Float:ent_origin[3], Float:angles[3] pev(player, pev_origin, origin)pev(ent, pev_origin, ent_origin) xs_vec_sub(origin, ent_origin, origin) xs_vec_normalize(origin, origin) vector_to_angle(origin, angles) angles[0] = 0.0 if(entity_range(ent, player) > ENT_DISTANCE){set_velocity(ent, angles, bBackWards)//angles[1] -= 90.0set_pev(ent, pev_angles, angles)}} stock set_velocity(ent, Float:angles[3], bool:bBackWards = false){new Float: Direction[3] angle_vector(angles, ANGLEVECTOR_FORWARD, Direction) xs_vec_mul_scalar(Direction, bBackWards ? float(-hclass_speed) : float(hclass_speed), Direction)set_pev(ent, pev_velocity, Direction)}stock shift_entity_position(ent, Float:forw, Float:right, Float:up){ static Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vEnd[3]; pev(ent, pev_origin, vOrigin); pev(ent, pev_angles, vAngle); angle_vector(vAngle,ANGLEVECTOR_FORWARD, vForward); angle_vector(vAngle,ANGLEVECTOR_RIGHT, vRight); vEnd[0] = vOrigin[0] + (vForward[0] * forw) + (vRight[0] * right); vEnd[1] = vOrigin[1] + (vForward[1] * forw) + (vRight[1] * right); vEnd[2] = vOrigin[2] + up; static iTr2; iTr2 = create_tr2(); engfunc(EngFunc_TraceLine, vOrigin, vEnd, DONT_IGNORE_MONSTERS, ent, iTr2); get_tr2(iTr2, TR_vecEndPos, vEnd); free_tr2(iTr2); set_pev(ent, pev_origin, vEnd);}stock SetEntityAngles(ent, const Float:angles[3]) { new Float:origin[3]; origin = GetEntityOrigin(ent); set_pev(ent, pev_angles, angles); set_pev(ent, pev_origin, Float:{0.0, 0.0, 0.0}); new Float:newOrigin[3]; newOrigin = GetEntityOrigin(ent); origin[0] -= newOrigin[0]; origin[1] -= newOrigin[1]; origin[2] -= newOrigin[2]; engfunc(EngFunc_SetOrigin, ent, origin);}stock Float:GetEntityOrigin(ent) { new Float:origin[3]; pev(ent, pev_origin, origin); new Float:center[3]; { new Float:mins[3], Float:maxs[3]; pev(ent, pev_mins, mins); pev(ent, pev_maxs, maxs); center[0] = (mins[0] + maxs[0])/2; center[1] = (mins[1] + maxs[1])/2; center[2] = (mins[2] + maxs[2])/2; } new Float:rotatedCenter[3]; { new Float:angles[3]; pev(ent, pev_angles, angles); engfunc(EngFunc_MakeVectors, angles); new Float:fwd[3], Float:left[3], Float:up[3]; global_get(glb_v_forward, fwd); { new Float:right[3]; global_get(glb_v_right, right); left[0] = -right[0]; left[1] = -right[1]; left[2] = -right[2]; } global_get(glb_v_up, up); rotatedCenter[0] = fwd[0]*center[0] + left[0]*center[1] + up[0]*center[2]; rotatedCenter[1] = fwd[1]*center[0] + left[1]*center[1] + up[1]*center[2]; rotatedCenter[2] = fwd[2]*center[0] + left[2]*center[1] + up[2]*center[2]; } origin[0] += rotatedCenter[0]; origin[1] += rotatedCenter[1]; origin[2] += rotatedCenter[2]; return origin;}stock ShowBarricadeBar(id, iTime){if (pev_valid(id)){message_begin(MSG_ONE_UNRELIABLE, g_iMsgBarTime, .player=id);write_short(iTime);message_end();}}stock HideBarricadeBar(id){if (pev_valid(id)){message_begin(MSG_ONE_UNRELIABLE, g_iMsgBarTime, .player=id);write_short(0);message_end();}}stock CheckConditions(iPlayer){if(zp_is_survivor_round() || is_user_alive(iPlayer) && zp_get_user_human_class(iPlayer) == g_iConstructorClass && !zp_get_user_zombie(iPlayer)){return true}return false}
Code:
soldier_class_constructor.amxx
Code:
construct_hp - viata la baricada
Statistics: Posted by Rainq — Sat Dec 30, 2023 11:38 am
Code:
#include < amxmodx >#define MAX_SOUNDS2 // numarul maxim de sunete#define TIME_AFTER_COUNTDOWN 6.0 // timpul inainte sa porneasca sunetul in secunde 2.0 = 2 secunde etc..#define TASK_AMBIENCE1232new const szRandomSounds[ MAX_SOUNDS ][ ] = {"zombimod/zp_roind_start.wav", "zombimod/zp_round_start2.wav"};public plugin_init( ) {register_plugin( "Biohazard Ambience","1.4", "YONTU" );register_event( "HLTV", "hltv_NewRound", "a", "1=0", "2=0" );register_logevent( "logevent_RoundEnd", 2, "1=Round_End" );}public plugin_precache( ) {for( new i = 0; i < sizeof szRandomSounds; i++ )precache_sound( szRandomSounds[ i ] );}public client_putinserver( id ) {remove_task( id );}public client_disconnected(id){remove_task(id);}public hltv_NewRound( ) {new szPlayers[ 32 ], iNum;get_players( szPlayers, iNum, "ch" );for( new i = 0; i < iNum; i++) {new id = szPlayers[ i ];if( is_user_alive( id ) && is_user_connected( id ) ) {set_task( TIME_AFTER_COUNTDOWN, "task_AmbiencesEffect", TASK_AMBIENCE );}}}public logevent_RoundEnd( ) {remove_task( TASK_AMBIENCE );}public task_AmbiencesEffect( taskid ) {PlaySoundToClients( szRandomSounds[ random_num( 0, sizeof szRandomSounds - 1 ) ] );}PlaySoundToClients( const szSound[ ] ) {if( equal( szSound[ strlen( szSound ) - 4 ], ".mp3" ) )client_cmd( 0, "mp3 play ^"sound/%s^"", szSound );elseclient_cmd( 0, "spk ^"%s^"", szSound );}
Code:
zp_countdown.amxx
Statistics: Posted by Rainq — Sat Dec 30, 2023 11:07 am