Vô passa umas smas das classes ja conhecida.
Healer:
Código:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#define heal_sound "heal.wav"
new const zclass_name[] = "Zumbi Healer"
new const zclass_info[] = "\r[Aperta [G] para curar a vida]"
new const zclass_model[] = "heal_zombi_origin"
new const zclass_clawmodel[] = "v_knife_heal_zombi.mdl"
const zclass_health = 2000
const zclass_speed = 240
const Float:zclass_gravity = 0.9
const Float:zclass_knockback = 0.0
new g_zclass_heal;
new Float:last_use[33];
public plugin_init()
{
register_plugin("[ZP] Zombie Class: Heal Zombie", "0.1", "WPMG Team")
register_clcmd("drop", "use_skill")
}
public plugin_precache()
{
g_zclass_heal = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
precache_sound(heal_sound)
}
public zp_user_infected_post(id, infector)
{
if(zp_get_user_zombie_class(id) == g_zclass_heal)
{
client_printcolor(id, "^4[ZP] ^1Pressione ^4^"G^" ^1Para curar a Vida.")
last_use[id] = 0.0
}
}
public use_skill(id)
{
if(is_user_alive(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_zclass_heal))
{
if((pev(id, pev_health) < float(zp_get_zombie_maxhealth(id))) && (last_use[id] + 30.0 <= get_gametime()))
{
last_use[id] = get_gametime();
set_pev(id, pev_health, float(zp_get_zombie_maxhealth(id)))
emit_sound(id, CHAN_ITEM, heal_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), { 0, 0, 0 }, id)
write_short(1<<10)
write_short(1<<12)
write_short(0x0000)
write_byte(50)
write_byte(150)
write_byte(50)
write_byte(200)
message_end()
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
stock client_printcolor(const id, const input[], any:...)
{
new iCount = 1, iPlayers[32]
static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)
replace_all(szMsg, 190, "/g", "^4")
replace_all(szMsg, 190, "/y", "^1")
replace_all(szMsg, 190, "/t", "^3")
replace_all(szMsg, 190, "/w", "^0")
if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")
for(new i = 0; i < iCount; i++)
{
if(is_user_connected(iPlayers[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i])
write_byte(iPlayers[i])
write_string(szMsg)
message_end()
}
}
}
Swarm (Para plague advance)(Não buga o Assassino):
Código:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <zombie_plague_advance>
/*================================================================================
[Customizations]
=================================================================================*/
// Zombie Attributes
new const zclass_name[] = "Zumbi Swarm" // name
new const zclass_info[] = "\r[Mata e nao infecta]" // description
new const zclass_model[] = "perfect_zombie_swarm" // model
new const zclass_clawmodel[] = "v_swarm_perfect.mdl" // claw model
const zclass_health = 2000 // health
const zclass_speed = 300 // speed
const Float:zclass_gravity = 0.85 // gravity
const Float:zclass_knockback = 0.0 // knockback
/*================================================================================
Customization ends here! Yes, that's it. Editing anything beyond
here is not officially supported. Proceed at your own risk...
=================================================================================*/
// Variables
new g_iSwarmZID, g_iMaxPlayers, g_msgSayText
// Cvar pointers
new cvar_dmgmult, cvar_surv_dmgmult, cvar_blockinfbomb_infect
// Cached cvars
new bool:g_bCvar_Infbomb_Infect, Float:g_flCvar_DmgMult, Float:g_flCvar_SurvDmgMult
// Bools
new bool:g_bIsConnected[33], bool:g_bRoundEnding
// Offsets
const m_pPlayer = 41
// A const
const NADE_TYPE_INFECTION = 1111 // from main ZP plugin
// Plug info.
#define PLUG_VERSION "0.7"
#define PLUG_AUTH "meTaLiCroSS"
// Macros
#define zp_get_grenade_type(%1) (entity_get_int(%1, EV_INT_flTimeStepSound))
#define is_user_valid_connected(%1) (1 <= %1 <= g_iMaxPlayers && g_bIsConnected[%1])
/*================================================================================
[Init, CFG and Precache]
=================================================================================*/
public plugin_init()
{
// Plugin Register
register_plugin("[ZP] Zombie Class: Swarm Zombie", PLUG_VERSION, PLUG_AUTH)
// Main events
register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0")
// Hamsandwich Forwards
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "fw_KnifeAttack")
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "fw_KnifeAttack")
// Cvars
cvar_dmgmult = register_cvar("zp_swarm_damage_mult", "2.0")
cvar_surv_dmgmult = register_cvar("zp_swarm_surv_damage_mult", "3.0")
cvar_blockinfbomb_infect = register_cvar("zp_swarm_infbomb_infect", "1")
static szCvar[30]
formatex(szCvar, charsmax(szCvar), "v%s by %s", PLUG_VERSION, PLUG_AUTH)
register_cvar("zp_zclass_swarm", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
// Vars
g_iMaxPlayers = get_maxplayers()
g_msgSayText = get_user_msgid("SayText")
}
public plugin_cfg()
{
// Do some cvars cache
cache_cvars()
}
public plugin_precache()
{
// Hamsandwich Forwards
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
// Register the new class and store ID for reference
g_iSwarmZID = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
/*================================================================================
[Main Events]
=================================================================================*/
public event_RoundStart()
{
// Do some cvars cache
cache_cvars()
// Update bool
g_bRoundEnding = false
}
/*================================================================================
[Main Forwards]
=================================================================================*/
public client_putinserver(id)
{
// Updating bool
g_bIsConnected[id] = true
}
public client_disconnect(id)
{
// Updating bool
g_bIsConnected[id] = false
}
public fw_KnifeAttack(knife)
{
// We need to block the Knife attack, because
// when has throwed an Infection bomb it can Kill/Infect
// with Knife, and will be a bug
// ----
// Get knife owner (player)
static iPlayer
iPlayer = get_pdata_cbase(knife, m_pPlayer, 4)
// Non-player entity
if(!is_user_valid_connected(iPlayer))
return HAM_IGNORED
// Swarm zombie class, not a nemesis/assassin and has throwed a infection nade
if(zp_get_user_zombie_class(iPlayer) == g_iSwarmZID && !zp_get_user_nemesis(iPlayer) && !zp_get_user_assassin(iPlayer) && zp_get_user_infection_nade(iPlayer) > 0)
return HAM_SUPERCEDE
return HAM_IGNORED
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damagetype)
{
// In the Main ZP plugin, the TakeDamage forward is Superceded, so
// we need to register this in Precache to get it working again
// ----
// Non-player attacker, self attack, attacked by world, or isn't make damage by himself
if(!is_user_valid_connected(attacker) || victim == attacker || !attacker || attacker != inflictor)
return HAM_IGNORED
// Swarm zombie class
if(zp_get_user_zombie(attacker) && zp_get_user_zombie_class(attacker) == g_iSwarmZID && !zp_get_user_nemesis(attacker) && !zp_get_user_assassin(attacker) && !g_bRoundEnding)
{
// Get damage result (with survivor and human damage multiplier)
static Float:flDamageResult
flDamageResult = damage * (zp_get_user_survivor(victim) ? g_flCvar_SurvDmgMult : g_flCvar_DmgMult)
// Do damage again
ExecuteHam(Ham_TakeDamage, victim, inflictor, attacker, flDamageResult, damagetype)
// Stop here
return HAM_SUPERCEDE;
}
return HAM_IGNORED
}
/*================================================================================
[Zombie Plague Forwards]
=================================================================================*/
public zp_user_infect_attempt(victim, infector, nemesis)
{
// Non-player infection or turned into a nemesis
if(!infector || nemesis)
return PLUGIN_CONTINUE
// Check Swarm Zombie class and block infection.
// I'm detecting if is Zombie and isn't Nemesis because
// can be an infection by zp_infect_user native
if(zp_get_user_zombie_class(infector) == g_iSwarmZID && zp_get_user_zombie(infector) && !zp_get_user_nemesis(infector))
{
// With infection grenade then must kill or infect, defined by cvar.
if(zp_get_user_infection_nade(infector) > 0)
{
switch(g_bCvar_Infbomb_Infect)
{
case true: return PLUGIN_CONTINUE // Infect
case false: ExecuteHamB(Ham_Killed, victim, infector, 0) // Kill
}
}
return ZP_PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public zp_user_infected_post(id, infector, nemesis)
{
// It's the selected zombie class
if(zp_get_user_zombie_class(id) == g_iSwarmZID && !nemesis)
{
}
}
public zp_round_ended(winteam)
{
// Update bool
g_bRoundEnding = true
}
/*================================================================================
[Internal Functions]
=================================================================================*/
cache_cvars()
{
// Caching cvars
g_flCvar_DmgMult = get_pcvar_float(cvar_dmgmult)
g_flCvar_SurvDmgMult = get_pcvar_float(cvar_surv_dmgmult)
g_bCvar_Infbomb_Infect = bool:get_pcvar_num(cvar_blockinfbomb_infect)
}
/*================================================================================
[Stocks]
=================================================================================*/
stock zp_get_user_infection_nade(id)
{
static iNade
iNade = get_grenade(id)
if(iNade > 0 && is_valid_ent(iNade)
&& zp_get_grenade_type(iNade) == NADE_TYPE_INFECTION)
return iNade
return 0;
}
stock client_printcolor(id, const input[], any:...)
{
static iPlayersNum[32], iCount; iCount = 1
static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)
replace_all(szMsg, 190, "/g", "^4") // green txt
replace_all(szMsg, 190, "/y", "^1") // orange txt
replace_all(szMsg, 190, "/ctr", "^3") // team txt
replace_all(szMsg, 190, "/w", "^0") // team txt
if(id) iPlayersNum[0] = id
else get_players(iPlayersNum, iCount, "ch")
for (new i = 0; i < iCount; i++)
{
if (g_bIsConnected[iPlayersNum[i]])
{
message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayersNum[i])
write_byte(iPlayersNum[i])
write_string(szMsg)
message_end()
}
}
}
Hunter (Igual da RTK/CSP):
Código:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <zombieplague>
#include < fun >
#define PLUGIN "[ZP] Class - Hunter"
#define VERSION "1.1"
#define AUTHOR "HoRRoR"
// Zombie Attributes
new const zclass_name[] = "Zombie Hunter" // name
new const zclass_info[] = "\r[Pode Correr Mt Rapido]" // description
new const zclass_model[] = "zombie_hunter" // model
new const zclass_clawmodel[] = "v_zombie.mdl" // claw model
const zclass_health = 2000 // health
const zclass_speed = 260 // speed
const Float:zclass_gravity = 1.15 // gravity
const Float:zclass_knockback = 2.5 // knockback
// --- config ------------------------ //
#define TRAIL_LIFE 2
#define TRAIL_WIDTH 10
#define TRAIL_RED 90
#define TRAIL_GREEN 200
#define TRAIL_BLUE 90
#define TRAIL_BRIGTHNESS 220
new Float:g_fastspeed = 1000.0 // sprint speed
new Float:g_normspeed = 260.0 // norm speed. must be as zclass_speed
new Float:g_abilonecooldown = 20.0 // cooldown time
new Float:g_abilonelenght = 2.0 // time of sprint
new const sound_hunter_sprint[] = "zombie_plague/spells/zombie_hunter/sprint.wav" //sprint sound
// ----------------------------------- //
new i_cooldown_time[33]
new g_zclass_hunter
new g_speeded[33] = 0
new g_abil_one_used[33] = 0
new gTrail
new g_maxplayers
public plugin_precache()
{
g_zclass_hunter = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
precache_sound(sound_hunter_sprint)
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("ability1", "use_ability_one")
register_concmd("ability1", "use_ability_one")
register_forward( FM_PlayerPreThink, "client_prethink" )
register_logevent("roundStart", 2, "1=Round_Start")
g_maxplayers = get_maxplayers()
gTrail = engfunc(EngFunc_PrecacheModel,"sprites/smoke.spr")
}
public client_prethink(id)
{
if (zp_get_user_zombie_class(id) == g_zclass_hunter)
{
if(is_user_alive(id) && zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_zclass_hunter) && !zp_get_user_nemesis(id))
Action(id);
}
}
public Action(id)
{
if (g_speeded[id] == 1)
{
set_user_maxspeed(id , g_fastspeed);
}
else
{
set_user_maxspeed(id , g_normspeed);
}
return PLUGIN_HANDLED;
}
public roundStart()
{
for (new i = 1; i <= g_maxplayers; i++)
{
i_cooldown_time[i] = floatround(g_abilonecooldown)
g_abil_one_used[i] = 0
g_speeded[i] = 0
remove_task(i)
client_cmd(i,"cl_forwardspeed 400")
client_cmd(i,"cl_backspeed 400")
}
}
public ShowHUD(id)
{
if(is_user_alive(id))
{
i_cooldown_time[id] = i_cooldown_time[id] - 1;
set_hudmessage(200, 100, 0, 0.75, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(id, "Sprint cooldown: %d",i_cooldown_time[id])
}else{
remove_task(id)
}
}
public use_ability_one(id)
{
if (is_user_alive(id) && (zp_get_user_zombie_class(id) == g_zclass_hunter) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
{
if(g_abil_one_used[id] == 0)
{
client_cmd(id,"cl_forwardspeed 1600")
client_cmd(id,"cl_backspeed 1600")
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (TE_BEAMFOLLOW)
write_short (id)
write_short (gTrail)
write_byte (TRAIL_LIFE)
write_byte (TRAIL_WIDTH)
write_byte (TRAIL_RED)
write_byte (TRAIL_GREEN)
write_byte (TRAIL_BLUE)
write_byte (TRAIL_BRIGTHNESS)
message_end()
g_speeded[id] = 1
emit_sound(id, CHAN_STREAM, sound_hunter_sprint, 1.0, ATTN_NORM, 0, PITCH_NORM)
g_abil_one_used[id] = 1
set_task(g_abilonelenght,"set_normal_speed",id)
i_cooldown_time[id] = floatround(g_abilonecooldown)
set_task(1.0, "ShowHUD", id, _, _, "a",i_cooldown_time[id])
// client_print(id,print_chat,"[dev] - use ability")
}
}
}
public set_normal_speed(id)
{
if ((zp_get_user_zombie_class(id) == g_zclass_hunter) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
{
g_speeded[id] = 0
client_cmd(id,"cl_forwardspeed 400")
client_cmd(id,"cl_backspeed 400")
set_task(g_abilonecooldown,"set_ability_one_cooldown",id)
// client_print(id,print_chat,"[dev] - executed 'set normal speed' task")
}
}
public set_ability_one_cooldown(id)
{
if ((zp_get_user_zombie_class(id) == g_zclass_hunter) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
{
g_abil_one_used[id] = 0
new text[100]
format(text,99,"^x04[ZP]^x01 Your ability ^x04Sprint^x01 is ready.")
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
}
}
public zp_user_infected_post(id, infector)
{
if ((zp_get_user_zombie_class(id) == g_zclass_hunter) && !zp_get_user_nemesis(id))
{
new text[100]
new note_cooldown = floatround(g_abilonecooldown)
format(text,99,"^x04[ZP]^x01 Your ability is ^x04Sprint^x01. Cooldown:^x04 %d ^x01seconds.",note_cooldown)
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_abilonecooldown)
remove_task(id)
g_speeded[id] = 0
g_abil_one_used[id] = 0
client_cmd(id,"bind F1 ability1")
}
}
public zp_user_humanized_post(id)
{
remove_task(id)
client_cmd(id,"cl_forwardspeed 400")
client_cmd(id,"cl_backspeed 400")
}
OBS: Vai ter que arrumar as models e os sons ou caso contrario ira dar erro
Espero Ter Ajudado !!!!!!