Senior Member
|
11-03-2014
, 15:22
[Errors] ON Zp 5.0.8
|
#1
|
Code:
L 11/03/2014 - 21:56:12: Start of error session.
L 11/03/2014 - 21:56:12: Info (map "zm_foda") (file "addons/amxmodx/logs/error_20141103.log")
L 11/03/2014 - 21:56:12: [ZP] Invalid Player (4)
L 11/03/2014 - 21:56:12: [AMXX] Displaying debug trace (plugin "zp_gamemodes.amxx")
L 11/03/2014 - 21:56:12: [AMXX] Run time error 10: native error (native "zp_core_is_zombie")
L 11/03/2014 - 21:56:12: [AMXX] [0] zp_gamemodes.sma::fw_TakeDamage (line 505)
L 11/03/2014 - 21:56:12: [ZP] Invalid Player (4)
L 11/03/2014 - 21:56:12: [AMXX] Displaying debug trace (plugin "zp_zombie_damage.amxx")
L 11/03/2014 - 21:56:12: [AMXX] Run time error 10: native error (native "zp_core_is_zombie")
L 11/03/2014 - 21:56:12: [AMXX] [0] zp_zombie_damage.sma::fw_TakeDamage (line 87)
L 11/03/2014 - 21:56:12: [ZP] Invalid Player (4)
L 11/03/2014 - 21:56:12: [AMXX] Displaying debug trace (plugin "zp_zlight.amxx")
L 11/03/2014 - 21:56:12: [AMXX] Run time error 10: native error (native "zp_get_user_zombie_class")
L 11/03/2014 - 21:56:12: [AMXX] [0] zp_zlight.sma::CPlayer__TakeDamage (line 230)
L 11/03/2014 - 21:56:12: [RZ] Invalid Player (4)
L 11/03/2014 - 21:56:12: [AMXX] Displaying debug trace (plugin "rz_vip_fall.amxx")
L 11/03/2014 - 21:56:12: [AMXX] Run time error 10: native error (native "rz_is_user_vip")
L 11/03/2014 - 21:56:12: [AMXX] [0] rz_vip_fall.sma::FW__TakeDamage (line 29)
L 11/03/2014 - 21:56:12: [ZP] Invalid Player (4)
L 11/03/2014 - 21:56:12: [AMXX] Displaying debug trace (plugin "zp_rewards_ammopacks.amxx")
L 11/03/2014 - 21:56:12: [AMXX] Run time error 10: native error (native "zp_core_is_zombie")
L 11/03/2014 - 21:56:12: [AMXX] [0] zp_rewards_ammopacks.sma::fw_TakeDamage_Post (line 147)
L 11/03/2014 - 21:56:12: [ZP] Invalid Player (4)
L 11/03/2014 - 21:56:12: [AMXX] Displaying debug trace (plugin "zp_painshockfree.amxx")
L 11/03/2014 - 21:56:12: [AMXX] Run time error 10: native error (native "zp_core_is_zombie")
L 11/03/2014 - 21:56:12: [AMXX] [0] zp_painshockfree.sma::fw_TakeDamage_Post (line 83)
Source Code of plugins with problems:
Code:
/*================================================================================
-------------------------------
-*- [ZP] Game Modes Manager -*-
-------------------------------
This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
-TODO: cvar prevent consecutive modes (should work for all except default)
================================================================================*/
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <cs_teams_api>
#include <cs_ham_bots_api>
#include <zp50_core>
#include <zp50_gamemodes_const>
#define LIBRARY_NEMESIS "zp50_class_nemesis"
#include <zp50_class_nemesis>
#define LIBRARY_ASSASSIN "zp50_class_assassin"
#include <zp50_class_assassin>
#define LIBRARY_SURVIVOR "zp50_class_survivor"
#include <zp50_class_survivor>
#define LIBRARY_SNIPER "zp50_class_sniper"
#include <zp50_class_sniper>
#define TASK_GAMEMODE 100
// HUD messages
const Float:HUD_EVENT_X = -1.0
const Float:HUD_EVENT_Y = 0.12
// Some constants
const DMG_HEGRENADE = (1<<24)
enum _:TOTAL_FORWARDS
{
FW_GAME_MODE_CHOOSE_PRE = 0,
FW_GAME_MODE_CHOOSE_POST,
FW_GAME_MODE_START,
FW_GAME_MODE_END,
}
new g_Forwards[TOTAL_FORWARDS]
new g_ForwardResult
new g_MaxPlayers
new g_HudSync
new cvar_gamemode_delay, cvar_round_start_show_hud, cvar_prevent_consecutive
// Game Modes data
new Array:g_GameModeName
new Array:g_GameModeFileName
new g_GameModeCount
new g_DefaultGameMode = 0 // first game mode is used as default if none specified
new g_ChosenGameMode = ZP_NO_GAME_MODE
new g_CurrentGameMode = ZP_NO_GAME_MODE
new g_LastGameMode = ZP_NO_GAME_MODE
new g_AllowInfection
public plugin_init()
{
register_plugin("[ZP] Game Modes Manager", ZP_VERSION_STRING, "ZP Dev Team")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_logevent("logevent_round_end", 2, "1=Round_End")
register_event("TextMsg", "event_game_restart", "a", "2=#Game_will_restart_in")
register_forward(FM_ClientDisconnect, "fw_ClientDisconnect_Post", 1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled_Post", 1)
RegisterHamBots(Ham_Killed, "fw_PlayerKilled_Post", 1)
RegisterHam(Ham_TraceAttack, "player", "fw_TraceAttack")
RegisterHamBots(Ham_TraceAttack, "fw_TraceAttack")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
RegisterHamBots(Ham_TakeDamage, "fw_TakeDamage")
cvar_gamemode_delay = register_cvar("zp_gamemode_delay", "10")
cvar_round_start_show_hud = register_cvar("zp_round_start_show_hud", "1")
cvar_prevent_consecutive = register_cvar("zp_prevent_consecutive_modes", "1")
g_Forwards[FW_GAME_MODE_CHOOSE_PRE] = CreateMultiForward("zp_fw_gamemodes_choose_pre", ET_CONTINUE, FP_CELL, FP_CELL)
g_Forwards[FW_GAME_MODE_CHOOSE_POST] = CreateMultiForward("zp_fw_gamemodes_choose_post", ET_IGNORE, FP_CELL, FP_CELL)
g_Forwards[FW_GAME_MODE_START] = CreateMultiForward("zp_fw_gamemodes_start", ET_IGNORE, FP_CELL)
g_Forwards[FW_GAME_MODE_END] = CreateMultiForward("zp_fw_gamemodes_end", ET_IGNORE, FP_CELL)
g_MaxPlayers = get_maxplayers()
g_HudSync = CreateHudSyncObj()
}
public plugin_natives()
{
register_library("zp50_gamemodes")
register_native("zp_gamemodes_register", "native_gamemodes_register")
register_native("zp_gamemodes_set_default", "native_gamemodes_set_default")
register_native("zp_gamemodes_get_default", "native_gamemodes_get_default")
register_native("zp_gamemodes_get_chosen", "native_gamemodes_get_chosen")
register_native("zp_gamemodes_get_current", "native_gamemodes_get_current")
register_native("zp_gamemodes_get_id", "native_gamemodes_get_id")
register_native("zp_gamemodes_get_name", "native_gamemodes_get_name")
register_native("zp_gamemodes_start", "native_gamemodes_start")
register_native("zp_gamemodes_get_count", "native_gamemodes_get_count")
register_native("zp_gamemodes_set_allow_infect", "_gamemodes_set_allow_infect")
register_native("zp_gamemodes_get_allow_infect", "_gamemodes_get_allow_infect")
// Initialize dynamic arrays
g_GameModeName = ArrayCreate(32, 1)
g_GameModeFileName = ArrayCreate(64, 1)
set_module_filter("module_filter")
set_native_filter("native_filter")
}
public module_filter(const module[])
{
if (equal(module, LIBRARY_NEMESIS) || equal(module, LIBRARY_ASSASSIN) || equal(module, LIBRARY_SURVIVOR) || equal(module, LIBRARY_SNIPER))
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
public native_filter(const name[], index, trap)
{
if (!trap)
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
public native_gamemodes_register(plugin_id, num_params)
{
new name[32], filename[64]
get_string(1, name, charsmax(name))
get_plugin(plugin_id, filename, charsmax(filename))
if (strlen(name) < 1)
{
log_error(AMX_ERR_NATIVE, "[ZP] Can't register game mode with an empty name")
return ZP_INVALID_GAME_MODE;
}
new index, gamemode_name[32]
for (index = 0; index < g_GameModeCount; index++)
{
ArrayGetString(g_GameModeName, index, gamemode_name, charsmax(gamemode_name))
if (equali(name, gamemode_name))
{
log_error(AMX_ERR_NATIVE, "[ZP] Game mode already registered (%s)", name)
return ZP_INVALID_GAME_MODE;
}
}
ArrayPushString(g_GameModeName, name)
ArrayPushString(g_GameModeFileName, filename)
// Pause Game Mode plugin after registering
pause("ac", filename)
g_GameModeCount++
return g_GameModeCount - 1;
}
public native_gamemodes_set_default(plugin_id, num_params)
{
new game_mode_id = get_param(1)
if (game_mode_id < 0 || game_mode_id >= g_GameModeCount)
{
log_error(AMX_ERR_NATIVE, "[ZP] Invalid game mode id (%d)", game_mode_id)
return false;
}
g_DefaultGameMode = game_mode_id
return true;
}
public native_gamemodes_get_default(plugin_id, num_params)
{
return g_DefaultGameMode;
}
public native_gamemodes_get_chosen(plugin_id, num_params)
{
return g_ChosenGameMode;
}
public native_gamemodes_get_current(plugin_id, num_params)
{
return g_CurrentGameMode;
}
public native_gamemodes_get_id(plugin_id, num_params)
{
new name[32]
get_string(1, name, charsmax(name))
// Loop through every game mode
new index, gamemode_name[32]
for (index = 0; index < g_GameModeCount; index++)
{
ArrayGetString(g_GameModeName, index, gamemode_name, charsmax(gamemode_name))
if (equali(name, gamemode_name))
return index;
}
return ZP_INVALID_GAME_MODE;
}
public native_gamemodes_get_name(plugin_id, num_params)
{
new game_mode_id = get_param(1)
if (game_mode_id < 0 || game_mode_id >= g_GameModeCount)
{
log_error(AMX_ERR_NATIVE, "[ZP] Invalid game mode id (%d)", game_mode_id)
return false;
}
new name[32]
ArrayGetString(g_GameModeName, game_mode_id, name, charsmax(name))
new len = get_param(3)
set_string(2, name, len)
return true;
}
public native_gamemodes_start(plugin_id, num_params)
{
new game_mode_id = get_param(1)
if (game_mode_id < 0 || game_mode_id >= g_GameModeCount)
{
log_error(AMX_ERR_NATIVE, "[ZP] Invalid game mode id (%d)", game_mode_id)
return false;
}
new target_player = get_param(2)
if (target_player != RANDOM_TARGET_PLAYER && !is_user_alive(target_player))
{
log_error(AMX_ERR_NATIVE, "[ZP] Invalid player (%d)", target_player)
return false;
}
// Game modes can only be started at roundstart
if (!task_exists(TASK_GAMEMODE))
return false;
new previous_mode, filename_previous[64]
// Game mode already chosen?
if (g_ChosenGameMode != ZP_NO_GAME_MODE)
{
// Pause previous game mode before picking a new one
ArrayGetString(g_GameModeFileName, g_ChosenGameMode, filename_previous, charsmax(filename_previous))
pause("ac", filename_previous)
previous_mode = true
}
// Set chosen game mode id
g_ChosenGameMode = game_mode_id
// Unpause game mode once it's chosen
new filename[64]
ArrayGetString(g_GameModeFileName, g_ChosenGameMode, filename, charsmax(filename))
unpause("ac", filename)
// Execute game mode choose attempt forward (skip checks = true)
ExecuteForward(g_Forwards[FW_GAME_MODE_CHOOSE_PRE], g_ForwardResult, g_ChosenGameMode, true)
// Game mode can't be started
if (g_ForwardResult >= PLUGIN_HANDLED)
{
// Pause the game mode we were trying to start
pause("ac", filename)
// Unpause previously chosen game mode
if (previous_mode) unpause("ac", filename_previous)
return false;
}
// Execute game mode chosen forward
ExecuteForward(g_Forwards[FW_GAME_MODE_CHOOSE_POST], g_ForwardResult, g_ChosenGameMode, target_player)
// Override task and start game mode manually
remove_task(TASK_GAMEMODE)
start_game_mode_task()
return true;
}
public native_gamemodes_get_count(plugin_id, num_params)
{
return g_GameModeCount;
}
public _gamemodes_set_allow_infect(plugin_id, num_params)
{
g_AllowInfection = get_param(1)
}
public _gamemodes_get_allow_infect(plugin_id, num_params)
{
return g_AllowInfection;
}
public event_game_restart()
{
logevent_round_end()
}
public logevent_round_end()
{
ExecuteForward(g_Forwards[FW_GAME_MODE_END], g_ForwardResult, g_CurrentGameMode)
if (g_ChosenGameMode != ZP_NO_GAME_MODE)
{
// pause game mode after its round ends
new filename[64]
ArrayGetString(g_GameModeFileName, g_ChosenGameMode, filename, charsmax(filename))
pause("ac", filename)
}
g_CurrentGameMode = ZP_NO_GAME_MODE
g_ChosenGameMode = ZP_NO_GAME_MODE
g_AllowInfection = false
// Stop game mode task
remove_task(TASK_GAMEMODE)
// Balance the teams
balance_teams()
}
public event_round_start()
{
// Players respawn as humans when a new round begins
new id
for (id = 1; id <= g_MaxPlayers; id++)
{
if (!is_user_connected(id))
continue;
zp_core_respawn_as_zombie(id, false)
}
// No game modes registered?
if (g_GameModeCount < 1)
{
set_fail_state("[ZP] No game modes registered!")
return;
}
// Remove previous tasks
remove_task(TASK_GAMEMODE)
// Pick game mode for the current round (delay needed because not all players are alive at this point)
set_task(0.1, "choose_game_mode", TASK_GAMEMODE)
// Start game mode task (delay should be greater than choose_game_mode task)
set_task(0.2 + get_pcvar_float(cvar_gamemode_delay), "start_game_mode_task", TASK_GAMEMODE)
if (get_pcvar_num(cvar_round_start_show_hud))
{
// Show T-virus HUD notice
set_hudmessage(0, 125, 200, HUD_EVENT_X, HUD_EVENT_Y, 0, 0.0, 3.0, 2.0, 1.0, -1)
ShowSyncHudMsg(0, g_HudSync, "%L", LANG_PLAYER, "NOTICE_VIRUS_FREE")
}
}
public choose_game_mode()
{
// No players joined yet
if (GetAliveCount() <= 0)
return;
new index, filename[64]
// Try choosing a game mode
for (index = g_DefaultGameMode + 1; /*no condition*/; index++)
{
// Start over when we reach the end
if (index >= g_GameModeCount)
index = 0
// Game mode already chosen?
if (g_ChosenGameMode != ZP_NO_GAME_MODE)
{
// Pause previous game mode before picking a new one
ArrayGetString(g_GameModeFileName, g_ChosenGameMode, filename, charsmax(filename))
pause("ac", filename)
}
// Set chosen game mode index
g_ChosenGameMode = index
// Unpause game mode once it's chosen
ArrayGetString(g_GameModeFileName, g_ChosenGameMode, filename, charsmax(filename))
unpause("ac", filename)
// Starting non-default game mode?
if (index != g_DefaultGameMode)
{
// Execute game mode choose attempt forward (skip checks = false)
ExecuteForward(g_Forwards[FW_GAME_MODE_CHOOSE_PRE], g_ForwardResult, g_ChosenGameMode, false)
// Custom game mode can start?
if (g_ForwardResult < PLUGIN_HANDLED && (!get_pcvar_num(cvar_prevent_consecutive) || g_LastGameMode != index))
{
// Execute game mode chosen forward
ExecuteForward(g_Forwards[FW_GAME_MODE_CHOOSE_POST], g_ForwardResult, g_ChosenGameMode, RANDOM_TARGET_PLAYER)
g_LastGameMode = g_ChosenGameMode
break;
}
}
else
{
// Execute game mode choose attempt forward (skip checks = true)
ExecuteForward(g_Forwards[FW_GAME_MODE_CHOOSE_PRE], g_ForwardResult, g_ChosenGameMode, true)
// Default game mode can start?
if (g_ForwardResult < PLUGIN_HANDLED)
{
// Execute game mode chosen forward
ExecuteForward(g_Forwards[FW_GAME_MODE_CHOOSE_POST], g_ForwardResult, g_ChosenGameMode, RANDOM_TARGET_PLAYER)
g_LastGameMode = g_ChosenGameMode
break;
}
else
{
remove_task(TASK_GAMEMODE)
abort(AMX_ERR_GENERAL, "[ZP] Default game mode can't be started. Check server settings.")
break;
}
}
}
}
public start_game_mode_task()
{
// No game mode was chosen (not enough players)
if (g_ChosenGameMode == ZP_NO_GAME_MODE)
return;
// Set current game mode
g_CurrentGameMode = g_ChosenGameMode
// Execute game mode started forward
ExecuteForward(g_Forwards[FW_GAME_MODE_START], g_ForwardResult, g_CurrentGameMode)
}
// Client Disconnected Post Forward
public fw_ClientDisconnect_Post(id)
{
// Are there any other players? (if not, round end is automatically triggered after last player leaves)
if (task_exists(TASK_GAMEMODE))
{
// Choose game mode again (to check game mode conditions such as min players)
choose_game_mode()
}
}
// Player Killed Post Forward
public fw_PlayerKilled_Post(victim, attacker, shouldgib)
{
// Are there any other players? (if not, round end is automatically triggered after last player dies)
if (task_exists(TASK_GAMEMODE))
{
// Choose game mode again (to check game mode conditions such as min players)
choose_game_mode()
}
}
// Ham Trace Attack Forward
public fw_TraceAttack(victim, attacker)
{
// Non-player damage or self damage
if (victim == attacker || !is_user_alive(attacker))
return HAM_IGNORED;
// Prevent attacks when no game mode is active
if (g_CurrentGameMode == ZP_NO_GAME_MODE)
return HAM_SUPERCEDE;
// Prevent friendly fire
if (zp_core_is_zombie(attacker) == zp_core_is_zombie(victim))
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
// Ham Take Damage Forward (needed to block explosion damage too)
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
// Non-player damage or self damage
if (victim == attacker || !is_user_alive(attacker))
return HAM_IGNORED;
// Prevent attacks when no game mode is active
if (g_CurrentGameMode == ZP_NO_GAME_MODE)
return HAM_SUPERCEDE;
// Prevent friendly fire
if (zp_core_is_zombie(attacker) == zp_core_is_zombie(victim))
return HAM_SUPERCEDE;
// Mode allows infection and zombie attacking human...
if (g_AllowInfection && zp_core_is_zombie(attacker) && !zp_core_is_zombie(victim))
{
// Nemesis shouldn't be infecting
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library) && zp_class_nemesis_get(attacker))
return HAM_IGNORED;
// Assassin shouldn't be infecting
if (LibraryExists(LIBRARY_ASSASSIN, LibType_Library) && zp_class_assassin_get(attacker))
return HAM_IGNORED;
// Survivor shouldn't be infected
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library) && zp_class_survivor_get(victim))
return HAM_IGNORED;
// Sniper shouldn't be infected
if (LibraryExists(LIBRARY_SNIPER, LibType_Library) && zp_class_sniper_get(victim))
return HAM_IGNORED;
// Prevent infection/damage by HE grenade (bugfix)
if (damage_type & DMG_HEGRENADE)
return HAM_SUPERCEDE;
// Last human is killed to trigger round end
if (zp_core_get_human_count() == 1)
return HAM_IGNORED;
// Infect only if damage is done to victim
if (damage > 0.0 && GetHamReturnStatus() != HAM_SUPERCEDE)
{
// Infect victim!
zp_core_infect(victim, attacker)
return HAM_SUPERCEDE;
}
}
return HAM_IGNORED;
}
public zp_fw_core_infect_post(id, attacker)
{
if (g_CurrentGameMode != ZP_NO_GAME_MODE)
{
// Zombies are switched to Terrorist team
cs_set_player_team(id, CS_TEAM_T)
}
}
public zp_fw_core_cure_post(id, attacker)
{
if (g_CurrentGameMode != ZP_NO_GAME_MODE)
{
// Humans are switched to CT team
cs_set_player_team(id, CS_TEAM_CT)
}
}
// Balance Teams
balance_teams()
{
// Get amount of users playing
new players_count = GetPlayingCount()
// No players, don't bother
if (players_count < 1) return;
// Split players evenly
new iTerrors
new iMaxTerrors = players_count / 2
new id, CsTeams:team
// First, set everyone to CT
for (id = 1; id <= g_MaxPlayers; id++)
{
// Skip if not connected
if (!is_user_connected(id))
continue;
team = cs_get_user_team(id)
// Skip if not playing
if (team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
continue;
// Set team
cs_set_player_team(id, CS_TEAM_CT, 0)
}
// Then randomly move half of the players to Terrorists
while (iTerrors < iMaxTerrors)
{
// Keep looping through all players
if (++id > g_MaxPlayers) id = 1
// Skip if not connected
if (!is_user_connected(id))
continue;
team = cs_get_user_team(id)
// Skip if not playing or already a Terrorist
if (team != CS_TEAM_CT)
continue;
// Random chance
if (random_num(0, 1))
{
cs_set_player_team(id, CS_TEAM_T, 0)
iTerrors++
}
}
}
// Get Alive Count -returns alive players number-
GetAliveCount()
{
new iAlive, id
for (id = 1; id <= g_MaxPlayers; id++)
{
if (is_user_alive(id))
iAlive++
}
return iAlive;
}
// Get Playing Count -returns number of users playing-
GetPlayingCount()
{
new iPlaying, id, CsTeams:team
for (id = 1; id <= g_MaxPlayers; id++)
{
if (!is_user_connected(id))
continue;
team = cs_get_user_team(id)
if (team != CS_TEAM_SPECTATOR && team != CS_TEAM_UNASSIGNED)
iPlaying++
}
return iPlaying;
}
Code:
/*================================================================================
--------------------------
-*- [ZP] Zombie Damage -*-
--------------------------
This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
================================================================================*/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cs_ham_bots_api>
#include <zp50_core>
#define LIBRARY_NEMESIS "zp50_class_nemesis"
#include <zp50_class_nemesis>
#define LIBRARY_ASSASSIN "zp50_class_assassin"
#include <zp50_class_assassin>
new cvar_zombie_defense, cvar_zombie_hitzones
public plugin_init()
{
register_plugin("[ZP] Zombie Damage", ZP_VERSION_STRING, "ZP Dev Team")
cvar_zombie_defense = register_cvar("zp_zombie_defense", "0.75")
cvar_zombie_hitzones = register_cvar("zp_zombie_hitzones", "0")
RegisterHam(Ham_TraceAttack, "player", "fw_TraceAttack")
RegisterHamBots(Ham_TraceAttack, "fw_TraceAttack")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
RegisterHamBots(Ham_TakeDamage, "fw_TakeDamage")
}
public plugin_natives()
{
set_module_filter("module_filter")
set_native_filter("native_filter")
}
public module_filter(const module[])
{
if (equal(module, LIBRARY_NEMESIS) || equal(module, LIBRARY_ASSASSIN))
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
public native_filter(const name[], index, trap)
{
if (!trap)
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
// Ham Trace Attack Forward
public fw_TraceAttack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type)
{
// Zombie custom hitzones disabled
if (!get_pcvar_num(cvar_zombie_hitzones))
return HAM_IGNORED;
// Non-player damage or self damage
if (victim == attacker || !is_user_alive(attacker))
return HAM_IGNORED;
// Not bullet damage or victim isn't a zombie
if (!(damage_type & DMG_BULLET) || !zp_core_is_zombie(victim))
return HAM_IGNORED;
// Check whether we hit an allowed one
if (!(get_pcvar_num(cvar_zombie_hitzones) & (1<<get_tr2(tracehandle, TR_iHitgroup))))
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
// Ham Take Damage Forward
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
// Non-player damage or self damage
if (victim == attacker || !is_user_alive(attacker))
return HAM_IGNORED;
// Human attacking zombie...
if (!zp_core_is_zombie(attacker) && zp_core_is_zombie(victim))
{
// Ignore for Nemesis
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library) && zp_class_nemesis_get(attacker))
return HAM_IGNORED;
// Ignore for Nemesis
else if (LibraryExists(LIBRARY_ASSASSIN, LibType_Library) && zp_class_assassin_get(attacker))
return HAM_IGNORED;
// Armor multiplier for the final damage
SetHamParamFloat(4, damage * get_pcvar_float(cvar_zombie_defense))
return HAM_HANDLED;
}
return HAM_IGNORED;
}
Code:
#include <amxmodx>
#include <fun>
#include <fakemeta_util>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <engine>
#include <dhudmessage>
#define PLUGIN "[CSO:Ghost Zombie]"
#define VERSION "1.4"
#define AUTHOR "HoRRoR, Fry!,tERoR Edit/"
new g_zclass_ghost
new const zclass_name[] = "Light Zombie" // name
new const zclass_info[] = "\yInvizibilitate \w-> \r[G]" // description
new const zclass_model[] = "ghost" // model
new const zclass_clawmodel[] = "v_knife_ghost.mdl" // claw model
new KNOCKBOMB_GHOST[] = "models/zombie_plague/zm_hands/v_bomb_ghost.mdl"
const zclass_health = 5800 // health
const zclass_speed = 250 // speed
const Float:zclass_gravity = 0.6// gravity
const Float:zclass_knockback = 2.8// knockback
new i_stealth_time_hud[33]
new g_cooldown[33]
new g_infections[33]
new Float:g_stealth_time[33]
new i_cooldown_time[33]
new g_maxplayers
new Float:g_stealth_time_standart = 7.0 //first stealth time
new Float:g_stealth_cooldown_standart = 30.0 //cooldown time
new const sound_ghost_stealth[] = "zombie_plague/ghost/invisup.wav" //stealth sound
new const sound_ghost_stealth_end[] = "zombie_plague/ghost/invisdown.wav" //end stealth sound
new const infect_ghost_sound[] = "zombie_plague/ghost/infect_01.wav"
new const pain_ghost_sound[] = "zombie_plague/ghost/pain_01.wav"
new const pain_ghost_sound2[] = "zombie_plague/ghost/pain_01.wav"
new const death_ghost_sound[] = "zombie_plague/ghost/die_01.wav"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("zp_zclass_ghost_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
register_clcmd("drop", "use_ability_one")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
register_event("CurWeapon","handle_gun","be","1=1")
RegisterHam(Ham_TakeDamage, "player", "CPlayer__TakeDamage");
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_forward(FM_EmitSound, "fw_EmitSound")
register_logevent("roundStart", 2, "1=Round_Start")
g_maxplayers = get_maxplayers()
}
public plugin_precache()
{
g_zclass_ghost = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
precache_sound(sound_ghost_stealth)
precache_sound(sound_ghost_stealth_end)
precache_sound(pain_ghost_sound[0])
precache_sound(pain_ghost_sound2[0])
precache_sound(infect_ghost_sound[0])
precache_sound(death_ghost_sound[0])
precache_model(KNOCKBOMB_GHOST)
}
public zp_user_infected_post(id, infector)
{
if ((zp_get_user_zombie_class(id) == g_zclass_ghost) && !zp_get_user_nemesis(id))
{
new text[100]
new note_cooldown = floatround(g_stealth_cooldown_standart)
new note_stealthtime = floatround(g_stealth_time_standart)
format(text,99,"^x04[Ghost]^x01 Puterea ^x04[Invizibilitate]^x01. | Timp:^x04 %d ^x01secunde.",note_cooldown,note_stealthtime)
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
i_cooldown_time[id] = floatround(g_stealth_cooldown_standart)
remove_task(id)
g_stealth_time[id] = g_stealth_time_standart
g_cooldown[id] = 0
g_infections[id] = 0
emit_sound(id, CHAN_WEAPON, infect_ghost_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
if((zp_get_user_zombie_class(id) == g_zclass_ghost) && !zp_get_user_nemesis(id))
{
g_stealth_time[infector] = g_stealth_time[infector] + 1;
infections_hud(infector)
}
}
public zp_user_humanized_post(id)
{
remove_task(id)
fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255)
}
public zp_user_unfrozen(id)
{
if(is_valid_ent(id) && is_user_alive(id) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie_class(id) == g_zclass_ghost)
{
fm_set_user_rendering(id)
}
}
public roundStart()
{
for (new i = 1; i <= g_maxplayers; i++)
{
i_cooldown_time[i] = floatround(g_stealth_cooldown_standart)
g_cooldown[i] = 0
remove_task(i)
}
}
public use_ability_one(id)
{
if(is_valid_ent(id) && is_user_alive(id) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie_class(id) == g_zclass_ghost)
{
if(g_cooldown[id] == 0)
{
fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0)
emit_sound(id, CHAN_STREAM, sound_ghost_stealth, 1.0, ATTN_NORM, 0, PITCH_NORM)
set_task(g_stealth_time[id],"ghost_make_visible",id)
set_task(g_stealth_cooldown_standart,"reset_cooldown",id)
g_cooldown[id] = 1
i_cooldown_time[id] = floatround(g_stealth_cooldown_standart)
i_stealth_time_hud[id] = floatround(g_stealth_time[id])
set_task(1.0, "ShowHUD", id, _, _, "a",i_cooldown_time[id])
set_task(1.0, "ShowHUDstealthes", id, _, _, "a",i_stealth_time_hud[id])
}
}
}
public ShowHUD(id)
{
if(is_valid_ent(id) && is_user_alive(id))
{
i_cooldown_time[id] = i_cooldown_time[id] - 1;
set_hudmessage(0, 255, 0, 0.75, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(id, "Timp ramas: %d",i_cooldown_time[id])
}else{
remove_task(id)
}
}
public ShowHUDstealthes(id)
{
if(is_valid_ent(id) && is_user_alive(id))
{
i_stealth_time_hud[id] = i_stealth_time_hud[id] - 1;
set_hudmessage(255, 0, 0, -1.0, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(id, "Timp ramas: %d",i_stealth_time_hud[id])
}else{
remove_task(id)
}
}
public ghost_make_visible(id)
{
if(is_valid_ent(id) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie_class(id) == g_zclass_ghost)
{
fm_set_user_rendering(id)
emit_sound(id, CHAN_STREAM, sound_ghost_stealth_end, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}
public reset_cooldown(id)
{
if(is_valid_ent(id) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie_class(id) == g_zclass_ghost)
{
g_cooldown[id] = 0
new text[100]
format(text,99,"^x04[Ghost]^x01 Capacitatea ^x04[Invizibilitate]^x01 este gata.")
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
}
}
public infections_hud(id)
{
if(is_valid_ent(id) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie_class(id) == g_zclass_ghost)
{
new i_stealth_time = floatround(g_stealth_time[id])
new text[100]
format(text,99,"^x04[Ghost]^x01 Invizibilitatea a ajuns la ^x04[ %d ]^x01secunde.",i_stealth_time)
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
}
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if (!(damage_type & DMG_FALL) || !zp_get_user_zombie(victim) || zp_get_user_zombie_class(victim) != g_zclass_ghost)
return HAM_IGNORED
SetHamParamFloat(4, 0.0)
return HAM_HANDLED
}
public fw_PlayerPreThink(player)
{
if(!is_user_alive(player))
return FMRES_IGNORED
if(zp_get_user_zombie(player) && zp_get_user_zombie_class(player) == g_zclass_ghost)
set_pev(player, pev_flTimeStepSound, 999)
return FMRES_IGNORED
}
public CPlayer__TakeDamage(id, iVictim, iInflictor, iAttacker, Float:flDamage, bitsDamage)
{
if (zp_get_user_zombie_class(id) == g_zclass_ghost && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && !zp_get_user_survivor(id))
{
new rand = random_num(1,2)
switch(rand)
{
case 1: emit_sound(id, CHAN_WEAPON, pain_ghost_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
case 2: emit_sound(id, CHAN_WEAPON, pain_ghost_sound2[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
}
public handle_gun(id)
{
new weap = get_user_weapon(id)
if(weap == CSW_FLASHBANG && zp_get_user_zombie_class(id) == g_zclass_ghost && zp_get_user_zombie(id))
{
entity_set_string(id, EV_SZ_viewmodel, KNOCKBOMB_GHOST)
}
else if(weap == CSW_SMOKEGRENADE && zp_get_user_zombie_class(id) == g_zclass_ghost && zp_get_user_zombie(id))
{
entity_set_string(id, EV_SZ_viewmodel, KNOCKBOMB_GHOST)
}
return PLUGIN_HANDLED
}
public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)
{
if(!is_user_connected(id))
return FMRES_HANDLED;
if (sample[0] == 'h' && sample[1] == 'o' && sample[2] == 's' && sample[3] == 't' && sample[4] == 'a' && sample[5] == 'g' && sample[6] == 'e')
return FMRES_SUPERCEDE;
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_ghost && !zp_get_user_nemesis(id))
{
if (sample[7] == 'd' && ((sample[8] == 'i' && sample[9] == 'e') || (sample[8] == 'e' && sample[9] == 'a')))
{
emit_sound(id, CHAN_WEAPON, death_ghost_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
return FMRES_IGNORED;
}
Code:
/*================================================================================
--------------------------------
-*- [ZP] Rewards: Ammo Packs -*-
--------------------------------
This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
================================================================================*/
#include <amxmodx>
#include <hamsandwich>
#include <cs_ham_bots_api>
#include <zp50_gamemodes>
#define LIBRARY_NEMESIS "zp50_class_nemesis"
#include <zp50_class_nemesis>
#define LIBRARY_ASSASSIN "zp50_class_assassin"
#include <zp50_class_assassin>
#define LIBRARY_SURVIVOR "zp50_class_survivor"
#include <zp50_class_survivor>
#define LIBRARY_SNIPER "zp50_class_sniper"
#include <zp50_class_sniper>
#include <zp50_ammopacks>
#define MAXPLAYERS 32
new g_MaxPlayers
new Float:g_DamageDealtToZombies[MAXPLAYERS+1]
new Float:g_DamageDealtToHumans[MAXPLAYERS+1]
new cvar_ammop_winner, cvar_ammop_loser
new cvar_ammop_damage, cvar_ammop_zombie_damaged_hp, cvar_ammop_human_damaged_hp
new cvar_ammop_zombie_killed, cvar_ammop_human_killed
new cvar_ammop_human_infected
new cvar_ammop_nemesis_ignore, cvar_ammop_survivor_ignore
new cvar_ammop_assassin_ignore, cvar_ammop_sniper_ignore
public plugin_init()
{
register_plugin("[ZP] Rewards: Ammo Packs", ZP_VERSION_STRING, "ZP Dev Team")
cvar_ammop_winner = register_cvar("zp_ammop_winner", "3")
cvar_ammop_loser = register_cvar("zp_ammop_loser", "1")
cvar_ammop_damage = register_cvar("zp_ammop_damage", "1")
cvar_ammop_zombie_damaged_hp = register_cvar("zp_ammop_zombie_damaged_hp", "500")
cvar_ammop_human_damaged_hp = register_cvar("zp_ammop_human_damaged_hp", "250")
cvar_ammop_zombie_killed = register_cvar("zp_ammop_zombie_killed", "1")
cvar_ammop_human_killed = register_cvar("zp_ammop_human_killed", "1")
cvar_ammop_human_infected = register_cvar("zp_ammop_human_infected", "1")
// Nemesis Class loaded?
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library))
cvar_ammop_nemesis_ignore = register_cvar("zp_ammop_nemesis_ignore", "0")
// Assassin Class loaded?
if (LibraryExists(LIBRARY_ASSASSIN, LibType_Library))
cvar_ammop_assassin_ignore = register_cvar("zp_ammop_assassin_ignore", "0")
// Survivor Class loaded?
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library))
cvar_ammop_survivor_ignore = register_cvar("zp_ammop_survivor_ignore", "0")
// Sniper Class loaded?
if (LibraryExists(LIBRARY_SNIPER, LibType_Library))
cvar_ammop_sniper_ignore = register_cvar("zp_ammop_sniper_ignore", "0")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage_Post", 1)
RegisterHamBots(Ham_TakeDamage, "fw_TakeDamage_Post", 1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled_Post", 1)
RegisterHamBots(Ham_Killed, "fw_PlayerKilled_Post", 1)
g_MaxPlayers = get_maxplayers()
}
public plugin_natives()
{
set_module_filter("module_filter")
set_native_filter("native_filter")
}
public module_filter(const module[])
{
if (equal(module, LIBRARY_NEMESIS) || equal(module, LIBRARY_ASSASSIN) || equal(module, LIBRARY_SURVIVOR) || equal(module, LIBRARY_SNIPER))
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
public native_filter(const name[], index, trap)
{
if (!trap)
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
public zp_fw_core_infect_post(id, attacker)
{
// Reward ammo packs to zombies infecting humans?
if (is_user_connected(attacker) && attacker != id && get_pcvar_num(cvar_ammop_human_infected) > 0)
zp_ammopacks_set(attacker, zp_ammopacks_get(attacker) + get_pcvar_num(cvar_ammop_human_infected))
}
// Ham Take Damage Post Forward
public fw_TakeDamage_Post(victim, inflictor, attacker, Float:damage, damage_type)
{
// Non-player damage or self damage
if (victim == attacker || !is_user_alive(attacker))
return;
// Ignore ammo pack rewards for Nemesis?
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library) && zp_class_nemesis_get(attacker) && get_pcvar_num(cvar_ammop_nemesis_ignore))
return;
// Ignore ammo pack rewards for Assassin?
if (LibraryExists(LIBRARY_ASSASSIN, LibType_Library) && zp_class_assassin_get(attacker) && get_pcvar_num(cvar_ammop_assassin_ignore))
return;
// Ignore ammo pack rewards for Survivor?
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library) && zp_class_survivor_get(attacker) && get_pcvar_num(cvar_ammop_survivor_ignore))
return;
// Ignore ammo pack rewards for Sniper?
if (LibraryExists(LIBRARY_SNIPER, LibType_Library) && zp_class_sniper_get(attacker) && get_pcvar_num(cvar_ammop_sniper_ignore))
return;
// Zombie attacking human...
if (zp_core_is_zombie(attacker) && !zp_core_is_zombie(victim))
{
// Reward ammo packs to zombies for damaging humans?
if (get_pcvar_num(cvar_ammop_damage) > 0)
{
// Store damage dealt
g_DamageDealtToHumans[attacker] += damage
// Give rewards according to damage dealt
new how_many_rewards = floatround(g_DamageDealtToHumans[attacker] / get_pcvar_float(cvar_ammop_human_damaged_hp), floatround_floor)
if (how_many_rewards > 0)
{
zp_ammopacks_set(attacker, zp_ammopacks_get(attacker) + (get_pcvar_num(cvar_ammop_damage) * how_many_rewards))
g_DamageDealtToHumans[attacker] -= get_pcvar_float(cvar_ammop_human_damaged_hp) * how_many_rewards
}
}
}
// Human attacking zombie...
else if (!zp_core_is_zombie(attacker) && zp_core_is_zombie(victim))
{
// Reward ammo packs to humans for damaging zombies?
if (get_pcvar_num(cvar_ammop_damage) > 0)
{
// Store damage dealt
g_DamageDealtToZombies[attacker] += damage
// Give rewards according to damage dealt
new how_many_rewards = floatround(g_DamageDealtToZombies[attacker] / get_pcvar_float(cvar_ammop_zombie_damaged_hp), floatround_floor)
if (how_many_rewards > 0)
{
zp_ammopacks_set(attacker, zp_ammopacks_get(attacker) + (get_pcvar_num(cvar_ammop_damage) * how_many_rewards))
g_DamageDealtToZombies[attacker] -= get_pcvar_float(cvar_ammop_zombie_damaged_hp) * how_many_rewards
}
}
}
}
// Ham Player Killed Post Forward
public fw_PlayerKilled_Post(victim, attacker, shouldgib)
{
// Non-player kill or self kill
if (victim == attacker || !is_user_connected(attacker))
return;
// Ignore ammo pack rewards for Nemesis?
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library) && zp_class_nemesis_get(attacker) && get_pcvar_num(cvar_ammop_nemesis_ignore))
return;
// Ignore ammo pack rewards for Assassin?
if (LibraryExists(LIBRARY_ASSASSIN, LibType_Library) && zp_class_assassin_get(attacker) && get_pcvar_num(cvar_ammop_assassin_ignore))
return;
// Ignore ammo pack rewards for Survivor?
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library) && zp_class_survivor_get(attacker) && get_pcvar_num(cvar_ammop_survivor_ignore))
return;
// Ignore ammo pack rewards for Sniper?
if (LibraryExists(LIBRARY_SNIPER, LibType_Library) && zp_class_sniper_get(attacker) && get_pcvar_num(cvar_ammop_sniper_ignore))
return;
// Reward ammo packs to attacker for the kill
if (zp_core_is_zombie(victim))
zp_ammopacks_set(attacker, zp_ammopacks_get(attacker) + get_pcvar_num(cvar_ammop_zombie_killed))
else
zp_ammopacks_set(attacker, zp_ammopacks_get(attacker) + get_pcvar_num(cvar_ammop_human_killed))
}
public zp_fw_gamemodes_end()
{
// Determine round winner and money rewards
if (!zp_core_get_zombie_count())
{
// Human team wins
new id
for (id = 1; id <= g_MaxPlayers; id++)
{
if (!is_user_connected(id))
continue;
if (zp_core_is_zombie(id))
zp_ammopacks_set(id, zp_ammopacks_get(id) + get_pcvar_num(cvar_ammop_loser))
else
zp_ammopacks_set(id, zp_ammopacks_get(id) + get_pcvar_num(cvar_ammop_winner))
}
}
else if (!zp_core_get_human_count())
{
// Zombie team wins
new id
for (id = 1; id <= g_MaxPlayers; id++)
{
if (!is_user_connected(id))
continue;
if (zp_core_is_zombie(id))
zp_ammopacks_set(id, zp_ammopacks_get(id) + get_pcvar_num(cvar_ammop_winner))
else
zp_ammopacks_set(id, zp_ammopacks_get(id) + get_pcvar_num(cvar_ammop_loser))
}
}
else
{
// No one wins
new id
for (id = 1; id <= g_MaxPlayers; id++)
{
if (!is_user_connected(id))
continue;
zp_ammopacks_set(id, zp_ammopacks_get(id) + get_pcvar_num(cvar_ammop_loser))
}
}
}
public client_disconnect(id)
{
// Clear damage after disconnecting
g_DamageDealtToZombies[id] = 0.0
g_DamageDealtToHumans[id] = 0.0
}
Code:
/*================================================================================
----------------------------
-*- [ZP] Pain Shock Free -*-
----------------------------
This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
================================================================================*/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cs_ham_bots_api>
#include <zp50_core>
#define LIBRARY_NEMESIS "zp50_class_nemesis"
#include <zp50_class_nemesis>
#define LIBRARY_ASSASSIN "zp50_class_assassin"
#include <zp50_class_assassin>
#define LIBRARY_SURVIVOR "zp50_class_survivor"
#include <zp50_class_survivor>
#define LIBRARY_SNIPER "zp50_class_sniper"
#include <zp50_class_sniper>
// CS Player PData Offsets (win32)
const OFFSET_PAINSHOCK = 108 // ConnorMcLeod
new cvar_painshockfree_zombie, cvar_painshockfree_human, cvar_painshockfree_nemesis, cvar_painshockfree_survivor,
cvar_painshockfree_assassin, cvar_painshockfree_sniper
public plugin_init()
{
register_plugin("[ZP] Pain Shock Free", ZP_VERSION_STRING, "ZP Dev Team")
cvar_painshockfree_zombie = register_cvar("zp_painshockfree_zombie", "1") // 1-all // 2-first only // 3-last only
cvar_painshockfree_human = register_cvar("zp_painshockfree_human", "0") // 1-all // 2-last only
// Nemesis Class loaded?
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library))
cvar_painshockfree_nemesis = register_cvar("zp_painshockfree_nemesis", "0")
// Assassin Class loaded?
if (LibraryExists(LIBRARY_ASSASSIN, LibType_Library))
cvar_painshockfree_assassin = register_cvar("zp_painshockfree_assassin", "0")
// Survivor Class loaded?
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library))
cvar_painshockfree_survivor = register_cvar("zp_painshockfree_survivor", "1")
// Sniper Class loaded?
if (LibraryExists(LIBRARY_SNIPER, LibType_Library))
cvar_painshockfree_sniper = register_cvar("zp_painshockfree_sniper", "1")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage_Post", 1)
RegisterHamBots(Ham_TakeDamage, "fw_TakeDamage_Post", 1)
}
public plugin_natives()
{
set_module_filter("module_filter")
set_native_filter("native_filter")
}
public module_filter(const module[])
{
if (equal(module, LIBRARY_NEMESIS) || equal(module, LIBRARY_ASSASSIN) || equal(module, LIBRARY_SURVIVOR) || equal(module, LIBRARY_SNIPER))
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
public native_filter(const name[], index, trap)
{
if (!trap)
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
// Ham Take Damage Post Forward
public fw_TakeDamage_Post(victim)
{
// Is zombie?
if (zp_core_is_zombie(victim))
{
// Nemesis Class loaded?
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library) && zp_class_nemesis_get(victim))
{
if (!get_pcvar_num(cvar_painshockfree_nemesis)) return;
}
// Assassin Class loaded?
else if (LibraryExists(LIBRARY_ASSASSIN, LibType_Library) && zp_class_assassin_get(victim))
{
if (!get_pcvar_num(cvar_painshockfree_assassin)) return;
}
else
{
// Check if zombie should be pain shock free
switch (get_pcvar_num(cvar_painshockfree_zombie))
{
case 0: return;
case 2: if (!zp_core_is_first_zombie(victim)) return;
case 3: if (!zp_core_is_last_zombie(victim)) return;
}
}
}
else
{
// Survivor Class loaded?
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library) && zp_class_survivor_get(victim))
{
if (!get_pcvar_num(cvar_painshockfree_survivor)) return;
}
// Sniper Class loaded?
else if (LibraryExists(LIBRARY_SNIPER, LibType_Library) && zp_class_sniper_get(victim))
{
if (!get_pcvar_num(cvar_painshockfree_sniper)) return;
}
else
{
// Check if human should be pain shock free
switch (get_pcvar_num(cvar_painshockfree_human))
{
case 0: return;
case 2: if (!zp_core_is_last_human(victim)) return;
}
}
}
// Set pain shock free offset
set_pdata_float(victim, OFFSET_PAINSHOCK, 1.0)
}
:-? Can fix errors ?
Oh, my plugin list is :
Code:
; ZP 5.0 / Module Version
; -----------------------
; Engine
zp_core.amxx debug
; APIs
amx_settings_api.amxx
cs_player_models_api.amxx
cs_teams_api.amxx
cs_maxspeed_api.amxx
cs_weap_models_api.amxx
cs_weap_restrict_api.amxx
cs_ham_bots_api.amxx
; Classes
zp_class_zombie.amxx debug
zp_class_human.amxx debug
zp_class_nemesis.amxx debug
zp_class_assassin.amxx debug
zp_class_survivor.amxx debug
zp_class_sniper.amxx debug
; This must come before game modes for armor protection to work properly
; Game Modes Manager
zp_addon_health_show.amxx debug
zp_gamemodes.amxx debug
zp_ap_store.amxx debug
zp_addon_time_presents.amxx debug
zp_human_armor.amxx debug
; Game Modes
zp_gamemode_infection.amxx debug
zp_gamemode_multi.amxx debug
zp_gamemode_swarm.amxx debug
zp_gamemode_nemesis.amxx debug
zp_gamemode_assassin.amxx debug
zp_gamemode_survivor.amxx debug
zp_gamemode_sniper.amxx debug
zp_gamemode_plague.amxx debug
zp_gamemode_armageddon.amxx debug
; Items Manager
zp_items.amxx debug
zp_items_ammopacks.amxx debug
; Extra Items
zp_item_weapons.amxx debug
zp_item_nightvision.amxx debug
zp_item_antidote.amxx debug
zp_item_zombie_madness.amxx debug
zp_item_infection_bomb.amxx debug
; Admin
zp_admin_commands.amxx debug
zp_admin_menu.amxx debug
zp_admin_models.amxx debug
; Buying
zp_buy_zones.amxx debug
; Rewards
zp_rewards_ammopacks.amxx debug
zp_rewards_frags_hp.amxx debug
; Deathmatch
zp_deathmatch.amxx debug
zp_random_spawn.amxx debug
zp_spawn_protection.amxx debug
; Zombie/Human Features
zp_zombie_features.amxx debug
zp_zombie_sounds.amxx debug
zp_zombie_damage.amxx debug
zp_human_ammo.amxx debug
; Custom Features
zp_flashlight.amxx debug
zp_nightvision.amxx debug
zp_leap.amxx debug
zp_painshockfree.amxx debug
zp_knockback.amxx debug
zp_weapon_drop_strip.amxx debug
; Effects
zp_effects_infect.amxx debug
zp_effects_cure.amxx debug
zp_effects_lighting.amxx debug
zp_ambience_effects.amxx debug
zp_ambience_sounds.amxx debug
; Gameplay / Other
zp_main_menu.amxx debug
zp_objective_remover.amxx debug
zp_gameplay_fixes.amxx debug
zp_team_scoring.amxx debug
zp_hud_info.amxx debug
zp_serverbrowser_info.amxx debug
zp_ammopacks.amxx debug
; Custom grenades
zp_grenade_fire.amxx debug
zp_grenade_frost.amxx debug
zp_grenade_flare.amxx debug
; ZP 4.3 Subplugin Compatibility
zp_zp43_compat.amxx debug
shoppuncte.amxx debug
custom_level.amxx debug debug
;CSO GUN MENU
arme.amxx debug
balrog3.amxx debug
bow.amxx debug
Fm_Balrog11.amxx debug
Fm_DualInfinity.amxx debug
Fm_Gatling.amxx debug
WaterPistol.amxx debug
wpn_ethereal.amxx debug
thunderbolt.amxx debug
; Zombie Classes
zp_zclass_bhnormal.amxx debug
zp_zclimb.amxx debug
zp_zboomer.amxx debug
zp_zspitter.amxx debug
zp_ztank.amxx debug
zp_zblink.amxx debug
zp_zhunter.amxx debug
zp_zsiren.amxx debug
zp_zhalf_blood_zombie.amxx debug
zp_zcrow.amxx debug
zp_zclass_zombie_executioner.amxx debug
zp_zlight.amxx debug
; Human Classes debug
zp_class_human_classic.amxx debug
;Extra
lasermine.amxx debug
zp_human_armor.amxx debug
zp_class_limiter.amxx debug
zp50_gas_mask.amxx debug
zp_extra_armour.amxx debug
;zp50_bazooka_jetpack.amxx debug
zp50_bazooka.amxx debug debug
zp_extra_confused-bomb-v1.5.amxx debug
zp_extra_knife_blink.amxx debug
zp_extra_multijump.amxx debug
zp_extra_unlimited_clip.amxx debug
zp_extra_drag_ability.amxx debug
Cyclone.amxx debug
zp_item_knock.amxx
Meybe the problem is from list, so how i can arrange list to be good ?
If is not from list, can you fix problems ? ..
|
|