I know that i posted this plugin before,
but wasn't working,
now i'am sure my plugin working i changed the codes fully,
i hope you will give a try for it,
Special Thanks To:
@Raheem
@Jack Gameplay
@Lizoumapper
Commands:
______________
Code: Select all
"ze_nemesis_chance" "20"
"ze_nemesis_gravity" "650"
"ze_nemesis_health" "30000"
"ze_nemesis_speed" "330"
"ze_nemesis_glow" "1"
"ze_nemesis_leap" "1"
_____________
1- Nemesis Round
Code: Select all
#include <zombie_escape>
#include <fun>
new g_nemesis_round, g_cvar_nemesis_chance, g_cvar_nemesis_gravity, g_cvar_nemesis_health, g_cvar_nemesis_speed, g_cvar_nemesis_glow, g_cvar_nemesis_leap
new g_MaxPlayers
native give_longjump(id)
public plugin_init()
{
register_plugin("[ZE] Nemsis round", "1.0", "Kaya Gaming")
register_event("HLTV", "event_newround", "a", "1=0", "2=0")
register_event("Damage", "Damage", "b", "2!=0")
g_cvar_nemesis_chance = register_cvar("ze_nemesis_chance","20")
g_cvar_nemesis_gravity = register_cvar("ze_nemesis_gravity","650")
g_cvar_nemesis_health = register_cvar("ze_nemesis_health","30000")
g_cvar_nemesis_speed = register_cvar("ze_nemesis_speed","330")
g_cvar_nemesis_glow = register_cvar("ze_nemesis_glow","1")
g_cvar_nemesis_leap = register_cvar("ze_nemesis_leap","1")
g_MaxPlayers = get_maxplayers();
}
public plugin_natives()
{
register_native("ze_is_nemesis_round","native_nemesis_round",1)
}
public native_nemesis_round(id)
{
return g_nemesis_round
}
public Damage(id)
{
new g_attacker = read_data(1)
new g_victim = read_data(2)
if(g_attacker != g_victim && ze_is_user_zombie(g_attacker) && g_nemesis_round)
{
user_silentkill(g_victim)
}
return PLUGIN_CONTINUE
}
public event_newround(id)
{
if(random_num(1, get_pcvar_num(g_cvar_nemesis_chance)) == 1)
{
g_nemesis_round = true
}
}
public ze_zombie_appear()
{
if(g_nemesis_round)
{
for(new id = 0; id < g_MaxPlayers; id++)
{
client_cmd(id,"spk zombie_escape/Nemesis_scream.wav")
set_hudmessage(255, 0, 0, -1.0, 0.30, 0, 6.0, 6.0)
show_hudmessage(id, "=== Nemesis Round ===")
if(ze_is_user_zombie(id))
{
nemesis_features(id)
}
}
}
}
public nemesis_features(id)
{
// User Zombie ? Nemesis Round ?
if(!ze_is_user_zombie(id) && !g_nemesis_round)
return
// Nemesis Glow
if(get_pcvar_num(g_cvar_nemesis_glow) == 1)
Set_Rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 25)
// Nemesis Leap Jump
if(get_pcvar_num(g_cvar_nemesis_leap) == 1)
give_longjump(id)
// Nemesis Gravity
set_user_gravity(id,get_pcvar_float(g_cvar_nemesis_gravity))
// Nemesis Health
set_user_health(id,get_pcvar_num(g_cvar_nemesis_health))
// Nemesis Speed
fm_set_user_speed(id,get_pcvar_float(g_cvar_nemesis_speed))
}
public ze_roundend(id)
{
Set_Rendering(id, kRenderFxNone, 255, 255, 255, kRenderNormal, 16)
g_nemesis_round = false
}
stock fm_set_user_speed(id, Float:Speed)
{
set_pev(id, pev_maxspeed, Speed)
}
Code: Select all
#include <zombie_escape>
// Setting File
new const ZE_SETTING_RESOURCES[] = "nemesis_models.ini"
// Defines
#define MODEL_MAX_LENGTH 64
#define PLAYERMODEL_MAX_LENGTH 32
#define ACCESS_MAX_LENGTH 32
// Default Models
new const szNemesisZombieModel[][] =
{
"ze_nemesis_host"
}
new const v_szNemesisZombieKnifeModel[][] =
{
"models/zombie_escape/v_knife_nemesis.mdl"
}
// Dynamic Arrays: Models
new Array:g_szNemesisZombieModel, Array:g_v_szNemesisZombieKnifeModel
native ze_is_nemesis_round(id)
public plugin_init()
{
register_plugin("[ZE] Nemesis Model & Claw", "1.0", "Kaya Gaming")
}
public plugin_precache()
{
// Initialize Arrays
g_szNemesisZombieModel = ArrayCreate(PLAYERMODEL_MAX_LENGTH, 1)
g_v_szNemesisZombieKnifeModel = ArrayCreate(MODEL_MAX_LENGTH, 1)
// Load From External File
amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "NEMESIS_ZOMBIE_MODEL", g_szNemesisZombieModel)
amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "NEMESIS_ZOMBIE_CLAW", g_v_szNemesisZombieKnifeModel)
// Load our Default Values
new iIndex
if(ArraySize(g_szNemesisZombieModel) == 0)
{
for(iIndex = 0; iIndex < sizeof szNemesisZombieModel; iIndex++)
ArrayPushString(g_szNemesisZombieModel, szNemesisZombieModel[iIndex])
// Save to external file
amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "NEMESIS_ZOMBIE_MODEL", g_szNemesisZombieModel)
}
if(ArraySize(g_v_szNemesisZombieKnifeModel) == 0)
{
for(iIndex = 0; iIndex < sizeof v_szNemesisZombieKnifeModel; iIndex++)
ArrayPushString(g_v_szNemesisZombieKnifeModel, v_szNemesisZombieKnifeModel[iIndex])
// Save to external file
amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "NEMESIS_ZOMBIE_CLAW", g_v_szNemesisZombieKnifeModel)
}
// Precache
new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH], szModelPath[128]
for (iIndex = 0; iIndex < ArraySize(g_szNemesisZombieModel); iIndex++)
{
ArrayGetString(g_szNemesisZombieModel, iIndex, szPlayerModel, charsmax(szPlayerModel))
formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
precache_model(szModelPath)
}
for (iIndex = 0; iIndex < ArraySize(g_szNemesisZombieModel); iIndex++)
{
ArrayGetString(g_szNemesisZombieModel, iIndex, szPlayerModel, charsmax(szPlayerModel))
formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
precache_model(szModelPath)
}
for (iIndex = 0; iIndex < ArraySize(g_v_szNemesisZombieKnifeModel); iIndex++)
{
ArrayGetString(g_v_szNemesisZombieKnifeModel, iIndex, szModel, charsmax(szModel))
precache_model(szModel)
}
}
public ze_user_infected(iVictim, iInfector)
{
if(!is_user_alive(iVictim))
return
// Set Zombie Models
new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH]
// Nemesis Round?
if(ze_is_nemesis_round(iVictim))
{
// Set Zombie Nemesis Model
ArrayGetString(g_szNemesisZombieModel, random_num(0, ArraySize(g_szNemesisZombieModel) - 1), szPlayerModel, charsmax(szPlayerModel))
rg_set_user_model(iVictim, szPlayerModel)
// Set Nemesis Zombie Knife Model
ArrayGetString(g_v_szNemesisZombieKnifeModel, random_num(0, ArraySize(g_v_szNemesisZombieKnifeModel) - 1), szModel, charsmax(szModel))
cs_set_player_view_model(iVictim, CSW_KNIFE, szModel)
cs_set_player_weap_model(iVictim, CSW_KNIFE, "") // Leave Blank so knife not appear with zombies
}
}
Code: Select all
#include <zombie_escape>
#define PLUGIN "[ZE] Extra Item:Leap"
#define VERSION "1.5.7"
#define AUTHOR "Fry!"
/*================================================================================
[Plugin Customization]
=================================================================================*/
new bool:g_hasLongJump[33],g_SayText
new Float:g_last_LongJump_time[33]
new g_LongJump_force, g_LongJump_height, g_LongJump_cooldown
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("ze_leap",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
g_LongJump_force = register_cvar("ze_longjump_force", "580")
g_LongJump_height = register_cvar("ze_longjump_height", "320")
g_LongJump_cooldown = register_cvar("ze_longjump_cooldown", "5.0")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
register_event("DeathMsg", "death", "a")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
g_SayText = get_user_msgid("SayText")
}
public plugin_natives()
{
register_native("give_longjump","native_give_longjump",1)
}
public native_give_longjump(id)
{
if(ze_is_user_zombie(id))
{
g_hasLongJump[id] = true
}
else
{
g_hasLongJump[id] = false
}
}
stock Color(const id, const input[], any:...)
{
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
message_begin(MSG_ONE_UNRELIABLE, g_SayText, _, id)
write_byte(id)
write_string(msg)
message_end()
}
// Reset on disconnection
public client_disconnected(id)
{
g_hasLongJump[id] = false
}
// Reset on death
public death()
{
g_hasLongJump[read_data(2)] = false
}
// Reset if turned into human
public ze_user_humanized(id)
{
g_hasLongJump[id] = false
}
// Reset at round start (for everyone)
public event_round_start()
{
for (new i = 1; i <= 32; i++)
g_hasLongJump[i] = false
}
public fw_PlayerPreThink(id)
{
if (!is_user_alive(id))
return FMRES_IGNORED
if (allow_LongJump(id))
{
static Float:velocity[3]
velocity_by_aim(id, get_pcvar_num(g_LongJump_force), velocity)
velocity[2] = get_pcvar_float(g_LongJump_height)
set_pev(id, pev_velocity, velocity)
g_last_LongJump_time[id] = get_gametime()
}
return FMRES_IGNORED
}
// Check if the player can longjump
allow_LongJump(id)
{
if (!g_hasLongJump[id])
return false
if (!(pev(id, pev_flags) & FL_ONGROUND) || fm_get_speed(id) < 80)
return false
static buttons
buttons = pev(id, pev_button)
if (!is_user_bot(id) && (!(buttons & IN_JUMP) || !(buttons & IN_DUCK)))
return false
if (get_gametime() - g_last_LongJump_time[id] < get_pcvar_float(g_LongJump_cooldown))
return false
if(g_last_LongJump_time[id] == get_pcvar_float(g_LongJump_cooldown))
{
client_print(id,print_chat,"[ZE] You can use the Leap Jump now.")
return true
}
return true
}
// Get entity's speed (from fakemeta_util)
stock fm_get_speed(entity)
{
static Float:velocity[3]
pev(entity, pev_velocity, velocity)
return floatround(vector_length(velocity))
}
__________________ [Note]
What i added for this plugin ?
I Make It In A Random Round