Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[rezolvat]Problema] Clase Zombie
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
821
QuIzZ
[Banned user]
Status: Offline
(since 03-02-2015 21:28)
Joined: 03 Jan 2015
Posts: 101
,
Topics: 20
Location:
Romania
Reputation:
24.2
Votes
: 9
Posted: 30-01-2015, 14:54:12
| Translate post to:
... (
Click for more languages
)
»Nume*: Clase Zombie
»Descriere problema*: Nu se compileaza.
P.S: Trebuie sa mearga pe sistemul XP
»Poze: -
1.
Spoiler:
Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <zombieplague>
#include <fun>
#include <hamsandwich>
#include <fakemeta_util>
#include <zombiexp>
#define PLUGIN "[ZP] Class - Ghost"
#define VERSION "1.3"
#define AUTHOR "HoRRoR, Fry!"
// Zombie Attributes
new g_zclass_ghost
new const zclass_name[] = "Zombie Fantoma" // name
new const zclass_info[] = "Se face invizibil" // description
new const zclass_model[] = "zombie_ghost" // model
new const zclass_clawmodel[] = "v_zombie.mdl" // claw model
const zclass_health = 2600 // health
const zclass_speed = 265 // speed
const Float:zclass_gravity = 0.85 // gravity
const Float:zclass_knockback = 1.5// knockback
const hclass_level = 5 // level required to use
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
// --- config ------------------------ //
new Float:g_stealth_time_standart = 15.0 //first stealth time
new Float:g_stealth_cooldown_standart = 30.0 //cooldown time
new const sound_ghost_stealth[] = "zombie_plague/spells/zombie_ghost/stealth.wav" //stealth sound
new const sound_ghost_stealth_end[] = "zombie_plague/spells/zombie_ghost/end_stealth.wav" //end stealth sound
// ----------------------------------- //
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("ability1", "use_ability_one")
register_concmd("ability1", "use_ability_one")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_logevent("roundStart", 2, "1=Round_Start")
g_maxplayers = get_maxplayers()
}
public plugin_precache()
{
g_zclass_ghost = zpxp_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)
}
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)
{
set_user_rendering(id, kRenderFxGlowShell, 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(200, 100, 0, 0.75, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(id, "Stealth cooldown: %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(200, 100, 0, -1.0, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(id, "Stealth time: %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)
{
set_user_rendering(id, kRenderFxHologram, 0, 0, 0, kRenderTransAlpha, 125)
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[ZP]^x01 Your ability ^x04Stealth^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_ghost) && !zp_get_user_nemesis(id))
{
set_user_rendering(id, kRenderFxHologram, 0, 0, 0, kRenderTransAlpha, 125)
new text[100]
new note_cooldown = floatround(g_stealth_cooldown_standart)
new note_stealthtime = floatround(g_stealth_time_standart)
format(text,99,"^x04[ZP]^x01 Your ability is ^x04Stealth^x01. Cooldown:^x04 %d ^x01seconds. Stealth time: ^x04%d^x01 seconds.",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
client_cmd(id,"bind F1 ability1")
}
if((zp_get_user_zombie_class(infector) == g_zclass_ghost) && !zp_get_user_nemesis(infector))
{
g_stealth_time[infector] = g_stealth_time[infector] + 1;
infections_hud(infector)
}
}
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[ZP]^x01 Your stealth time is^x04 %d ^x01seconds.",i_stealth_time)
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
}
}
public zp_user_humanized_post(id)
{
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255)
remove_task(id)
}
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)
{
set_user_rendering(id, kRenderFxHologram, 0, 0, 0, kRenderTransAlpha, 125)
}
}
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
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
2.
Spoiler:
Code:
* zp_smoker_maxdrags 10 // how many times Smoker can drag player to himself? def=10
* zp_smoker_dragspeed 160 // speed of dragging player to Smoker def=160
* zp_smoker_cooldown 5 // time in sec before you can use drag again. def=5
* zp_smoker_mates 0 // can Smoker drag teammates to? 1=yes 0=no def=0
* zp_smoker_dmg2stop 300 // damage to stop dragging. set 0 to disable it. def=300
* zp_smoker_extrahook 2 // additional hooks after Smoker infects smb. def=2
* zp_smoker_unable_move 1 // 0=human & Smoker can move / 1=unable human to move when dragging / 2=unable Smoker to move / 3=unable both
* zp_smoker_nemesis 0 // 0=Smoker can't drag players if he is Nemesis / 1=Smoker can. def=0
* zp_smoker_survivor 1 // 0=Smoker can't drag Survivor / 1=Smoker can. def=1
#include <amxmodx>
#include <zombieplague>
#include <fakemeta>
#include <hamsandwich>
#include <engine>
#include <zombiexp>
#define PLUGIN "[ZP] Class Smoker"
#define VERSION "1.3"
#define AUTHOR "IceCreamCandy"
//Main Class, modelT & Sprite Beam
new g_zclass_smoker, g_Line
new const generic_models[][] = { "models/player/zombie_smoker/zombie_smokerT.mdl" }
//Sounds
new g_sndMiss[] = "zombie_plague/Smoker_TongueHit_miss.wav"
new g_sndDrag[] = "zombie_plague/Smoker_TongueHit_drag.wav"
//Some vars
new g_hooked[33], g_hooksLeft[33], g_unable2move[33], g_ovr_dmg[33]
new Float:g_lastHook[33]
new bool: g_bind_use[33] = false, bool: g_bind_or_not[33] = false, bool: g_drag_i[33] = false
//Cvars
new cvar_maxdrags, cvar_dragspeed, cvar_cooldown, cvar_dmg2stop, cvar_mates, cvar_extrahook, cvar_unb2move, cvar_nemesis, cvar_survivor
//Menu keys
new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
//Smoker Atributes
new const zclass_name[] = { "Zombie Smoker" }
new const zclass_info[] = { "Atrage jucatorii" }
new const zclass_model[] = { "zombie_smoker" }
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass_health = 3100
const zclass_speed = 290
const Float:zclass_gravity = 0.75
const Float:zclass_knockback = 1.0
const zclass_level = 9 // level required to use
public plugin_init()
{
cvar_dragspeed = register_cvar("zp_smoker_dragspeed", "200")
cvar_maxdrags = register_cvar("zp_smoker_maxdrags", "5")
cvar_cooldown = register_cvar("zp_smoker_cooldown", "15")
cvar_dmg2stop = register_cvar("zp_smoker_dmg2stop", "500")
cvar_mates = register_cvar("zp_smoker_mates", "0")
cvar_extrahook = register_cvar("zp_smoker_extrahook", "2")
cvar_unb2move = register_cvar("zp_smoker_unable_move", "0")
cvar_nemesis = register_cvar("zp_smoker_nemesis", "0")
cvar_survivor = register_cvar("zp_smoker_survivor", "0")
register_event("ResetHUD", "newSpawn", "b")
register_event("DeathMsg", "smoker_death", "a")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_clcmd("+drag","drag_start", ADMIN_USER, "bind ^"key^" ^"+drag^"")
register_clcmd("-drag","drag_end")
register_menucmd(register_menuid("Do you want to bind V +drag?"), keys, "bind_v_key")
}
public plugin_precache()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_zclass_smoker = zpxp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback, zclass_level)
precache_sound(g_sndDrag)
precache_sound(g_sndMiss)
g_Line = precache_model("sprites/zbeam4.spr")
for (new i = 0; i < sizeof generic_models; i++)
precache_model(generic_models[i])
}
public zp_user_infected_post(id, infector)
{
if ((zp_get_user_zombie_class(infector) == g_zclass_smoker) && (get_pcvar_num(cvar_extrahook) > 0))
{
g_hooksLeft[infector] = g_hooksLeft[infector] + get_pcvar_num(cvar_extrahook)
set_hudmessage(255, 0, 0, -1.0, 0.45, 0, 0.0, 3.0, 0.01, 0.01, -1)
show_hudmessage(infector, "+%d drag%s!", get_pcvar_num(cvar_extrahook), (get_pcvar_num(cvar_extrahook) < 2) ? "" : "s")
}
if (zp_get_user_zombie_class(id) == g_zclass_smoker)
{
g_hooksLeft[id] = get_pcvar_num(cvar_maxdrags)
if (!g_bind_or_not[id])
{
new menu[192]
format(menu, 191, "Do you want to bind V +drag?^n^n1. Yes^n2. No^n3. Drag on +USE")
show_menu(id, keys, menu)
}
}
}
public newSpawn(id)
{
if (g_hooked[id])
drag_end(id)
}
public drag_start(id) // starts drag, checks if player is Smoker, checks cvars
{
if (zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_zclass_smoker) && !g_drag_i[id]) {
static Float:cdown
cdown = get_pcvar_float(cvar_cooldown)
if (!is_user_alive(id)) {
client_print(id, print_chat, "[ZP] You can't drag if you are dead!")
return PLUGIN_HANDLED
}
if (g_hooksLeft[id] <= 0) {
client_print(id, print_chat, "[ZP] You can't drag anymore!")
return PLUGIN_HANDLED
}
if (get_gametime() - g_lastHook[id] < cdown) {
client_print(id, print_chat, "[ZP] Wait %.f0 sec. to drag again!", get_pcvar_float(cvar_cooldown) - (get_gametime() - g_lastHook[id]))
return PLUGIN_HANDLED
}
new hooktarget, body
get_user_aiming(id, hooktarget, body)
if (zp_get_user_nemesis(id) && get_pcvar_num(cvar_nemesis) == 0) {
client_print(id, print_chat, "[ZP] You can't drag if you are Nemesis!")
return PLUGIN_HANDLED
}
if (is_user_alive(hooktarget)) {
if (!zp_get_user_zombie(hooktarget))
{
if (zp_get_user_survivor(hooktarget) && get_pcvar_num(cvar_survivor) == 0) {
client_print(id, print_chat, "[ZP] You can't drag Survivor!")
return PLUGIN_HANDLED
}
g_hooked[id] = hooktarget
emit_sound(hooktarget, CHAN_BODY, g_sndDrag, 1.0, ATTN_NORM, 0, PITCH_HIGH)
}
else
{
if (get_pcvar_num(cvar_mates) == 1)
{
g_hooked[id] = hooktarget
emit_sound(hooktarget, CHAN_BODY, g_sndDrag, 1.0, ATTN_NORM, 0, PITCH_HIGH)
}
else
{
client_print(id, print_chat, "[ZP] You can't drag teammates!")
return PLUGIN_HANDLED
}
}
if (get_pcvar_float(cvar_dragspeed) <= 0.0)
cvar_dragspeed = 1
new parm[2]
parm[0] = id
parm[1] = hooktarget
set_task(0.1, "smoker_reelin", id, parm, 2, "b")
harpoon_target(parm)
g_hooksLeft[id]--
client_print(id, print_chat, "[ZP] You can drag player to youself %d time%s", g_hooksLeft[id], (g_hooksLeft[id] < 2) ? "" : "s")
g_drag_i[id] = true
if(get_pcvar_num(cvar_unb2move) == 1)
g_unable2move[hooktarget] = true
if(get_pcvar_num(cvar_unb2move) == 2)
g_unable2move[id] = true
if(get_pcvar_num(cvar_unb2move) == 3)
{
g_unable2move[hooktarget] = true
g_unable2move[id] = true
}
} else {
g_hooked[id] = 33
noTarget(id)
emit_sound(hooktarget, CHAN_BODY, g_sndMiss, 1.0, ATTN_NORM, 0, PITCH_HIGH)
g_drag_i[id] = true
g_hooksLeft[id]--
client_print(id, print_chat, "[ZP] You can drag player to youself %d time%s", g_hooksLeft[id], (g_hooksLeft[id] < 2) ? "" : "s")
}
}
else
return PLUGIN_HANDLED
return PLUGIN_CONTINUE
}
public smoker_reelin(parm[]) // dragging player to smoker
{
new id = parm[0]
new victim = parm[1]
if (!g_hooked[id] || !is_user_alive(victim))
{
drag_end(id)
return
}
new Float:fl_Velocity[3]
new idOrigin[3], vicOrigin[3]
get_user_origin(victim, vicOrigin)
get_user_origin(id, idOrigin)
new distance = get_distance(idOrigin, vicOrigin)
if (distance > 1) {
new Float:fl_Time = distance / get_pcvar_float(cvar_dragspeed)
fl_Velocity[0] = (idOrigin[0] - vicOrigin[0]) / fl_Time
fl_Velocity[1] = (idOrigin[1] - vicOrigin[1]) / fl_Time
fl_Velocity[2] = (idOrigin[2] - vicOrigin[2]) / fl_Time
} else {
fl_Velocity[0] = 0.0
fl_Velocity[1] = 0.0
fl_Velocity[2] = 0.0
}
entity_set_vector(victim, EV_VEC_velocity, fl_Velocity) //<- rewritten. now uses engine
}
public drag_end(id) // drags end function
{
g_hooked[id] = 0
beam_remove(id)
remove_task(id)
if (g_drag_i[id])
g_lastHook[id] = get_gametime()
g_drag_i[id] = false
g_unable2move[id] = false
}
public smoker_death() // if smoker dies drag off
{
new id = read_data(2)
beam_remove(id)
if (g_hooked[id])
drag_end(id)
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage) // if take damage drag off
{
if (is_user_alive(attacker) && (get_pcvar_num(cvar_dmg2stop) > 0))
{
g_ovr_dmg[victim] = g_ovr_dmg[victim] + floatround(damage)
if (g_ovr_dmg[victim] >= get_pcvar_num(cvar_dmg2stop))
{
g_ovr_dmg[victim] = 0
drag_end(victim)
return HAM_IGNORED;
}
}
return HAM_IGNORED;
}
public fw_PlayerPreThink(id)
{
if (!is_user_alive(id))
return FMRES_IGNORED
new button = get_user_button(id)
new oldbutton = get_user_oldbutton(id)
if (g_bind_use[id] && zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_zclass_smoker))
{
if (!(oldbutton & IN_USE) && (button & IN_USE))
drag_start(id)
if ((oldbutton & IN_USE) && !(button & IN_USE))
drag_end(id)
}
if (!g_drag_i[id]) {
g_unable2move[id] = false
}
if (g_unable2move[id] && get_pcvar_num(cvar_unb2move) > 0)
{
set_pev(id, pev_maxspeed, 1.0)
}
return PLUGIN_CONTINUE
}
public client_disconnect(id) // if client disconnects drag off
{
if (id <= 0 || id > 32)
return
if (g_hooked[id])
drag_end(id)
if(g_unable2move[id])
g_unable2move[id] = false
}
public harpoon_target(parm[]) // set beam (ex. tongue:) if target is player
{
new id = parm[0]
new hooktarget = parm[1]
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(8) // TE_BEAMENTS
write_short(id)
write_short(hooktarget)
write_short(g_Line) // sprite index
write_byte(0) // start frame
write_byte(0) // framerate
write_byte(200) // life
write_byte(8) // width
write_byte(1) // noise
write_byte(155) // r, g, b
write_byte(155) // r, g, b
write_byte(55) // r, g, b
write_byte(90) // brightness
write_byte(10) // speed
message_end()
}
public bind_v_key(id, keys)
{
g_bind_or_not[id] = true
switch(keys)
{
case 0:
client_cmd(id, "bind v ^"+drag^"")
case 1:
client_print(id, print_chat, "[ZP] To drag player to youself (bind ^'^'key^'^' ^'^'+drag^'^') hold binded key")
case 2:
g_bind_use[id] = true
default:
g_bind_or_not[id] = false
}
return PLUGIN_HANDLED
}
public noTarget(id) // set beam if target isn't player
{
new endorigin[3]
get_user_origin(id, endorigin, 3)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte( TE_BEAMENTPOINT ); // TE_BEAMENTPOINT
write_short(id)
write_coord(endorigin[0])
write_coord(endorigin[1])
write_coord(endorigin[2])
write_short(g_Line) // sprite index
write_byte(0) // start frame
write_byte(0) // framerate
write_byte(200) // life
write_byte(8) // width
write_byte(1) // noise
write_byte(155) // r, g, b
write_byte(155) // r, g, b
write_byte(55) // r, g, b
write_byte(75) // brightness
write_byte(0) // speed
message_end()
}
public beam_remove(id) // remove beam
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(99) //TE_KILLBEAM
write_short(id) //entity
message_end()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
3.
Spoiler:
Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <cstrike>
#include <fun>
#include <zombiexp>
//Predator Atributes
new const zclass_name[] = { "Sniper Zombie" }
new const zclass_info[] = { "Infecter AwP" }
new const zclass_model[] = { "zombie_sniper" }
new const zclass_clawmodel[] = { "v_Predator.mdl" }
const zclass_health = 1600
const zclass_speed = 300
const Float:zclass_gravity = 0.7
const Float:zclass_knockback = 1.0
const hclass_level = 10 // level required to use
new g_zclassid1, cvar_ammo, cvar_fov
new const model_weapon_awp[] = "models/v_awp_sniper.mdl"
new g_zombies_fov
public plugin_init()
{
register_plugin("[ZP] Class: Sniper Zombie", "0.3", "Zombie-rus")
cvar_ammo = register_cvar("zp_ammo_bullets", "5")
cvar_fov = register_cvar("zp_class_fov", "135")
}
public plugin_precache()
{
g_zclassid1 = zpxp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
engfunc(EngFunc_PrecacheModel, model_weapon_awp)
}
public plugin_cfg()
{
g_zombies_fov = get_cvar_pointer("zp_zombie_fov")
}
public zp_user_infected_post(id, infector)
{
if (zp_get_user_zombie_class(id) == g_zclassid1)
{
strip_user_weapons(id)
give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, get_pcvar_num(cvar_ammo))
new weapon = get_user_weapon(id)
if (weapon == CSW_AWP)
{
set_pev(id, pev_viewmodel2, model_weapon_awp)
}
msg_one_unreliable(id)
}
}
public msg_one_unreliable(id)
{
if (zp_get_user_zombie_class(id) == g_zclassid1)
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SetFOV"), {0,0,0}, id)
write_byte(get_pcvar_num(cvar_fov))
message_end()
}
else
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SetFOV"), {0,0,0}, id)
write_byte(g_zombies_fov) // fov angle
message_end()
}
}
4.
Spoiler:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
#include <zombieplague>
#include <hamsandwich>
#include <zombiexp>
#define PLUGIN "[ZP] Class Predator"
#define VERSION "1.0"
#define AUTHOR "IceCreamCandy"
//Predator Atributes
new const zclass_name[] = { "Zombie Predator" }
new const zclass_info[] = { "Invisible + X2 DMG + HP" }
new const zclass_model[] = { "Predator" }
new const zclass_clawmodel[] = { "v_Predator.mdl" }
const zclass_health = 1600
const zclass_speed = 400
const Float:zclass_gravity = 0.6
const Float:zclass_knockback = 1.0
const hclass_level = 12 // level required to use
//Some vars
new g_zclass_Predator, g_maxplayers, g_status
new g_sndInv[] = "predator/predator.wav"
new cvar_ability_time, cvar_invamount, cvar_speed, cvar_infect_hp, cvar_cooldown, cvar_gravity, cvar_icon, cvar_dmg_multi
new Float:g_last[33]
new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
new g_icon[33][16]
new bool: g_ability[33], bool: g_bind[33] = false, bool: g_use[33]
public plugin_init()
{
cvar_dmg_multi = register_cvar("zp_predator_dmg_multi", "2")
cvar_ability_time = register_cvar("zp_Predator_ability_long", "15")
cvar_invamount = register_cvar("zp_Predator_visible_amount", "0")
cvar_speed = register_cvar("zp_Predator_max_speed", "400")
cvar_infect_hp = register_cvar("zp_Predator_infect_hp", "300")
cvar_cooldown = register_cvar("zp_Predator_cooldown", "40")
cvar_gravity = register_cvar("zp_Predator_gravity", "600")
cvar_icon = register_cvar("zp_Predator_icon", "1")
register_clcmd("ability","ability", ADMIN_ALL, "bind p ability")
register_forward(FM_PlayerPreThink, "fw_ppt")
register_event("HLTV", "newround", "a", "1=0", "2=0")
register_event("DeathMsg", "death", "a")
register_menucmd(register_menuid("Do you want to bind P ability?"), keys, "bind_p_ability")
RegisterHam( Ham_TakeDamage, "player", "fw_TakeDamage" )
g_status = get_user_msgid("StatusIcon")
}
public plugin_precache()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_zclass_Predator = zpxp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
precache_sound(g_sndInv)
}
public zp_user_infected_post(id, infector)
{
if (zp_get_user_zombie_class(infector) == g_zclass_Predator)
{
set_pev(infector, pev_health, float(pev(infector, pev_health) + get_pcvar_num(cvar_infect_hp)))
set_hudmessage(255, 0, 0, -1.0, 0.45, 0, 0.0, 3.0, 0.01, 0.01, -1)
show_hudmessage(infector, "+%i HP!", get_pcvar_num(cvar_infect_hp))
}
if (zp_get_user_zombie_class(id) == g_zclass_Predator)
{
g_ability[id] = false
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 255)
set_user_maxspeed(id, float(zclass_speed))
set_user_gravity(id, zclass_gravity)
if (!g_bind[id])
{
new menu[192]
format(menu, 191, "Do you want to bind P ability?^n^n1. Yes^n2. No^n3. Ability on +USE")
show_menu(id, keys, menu)
}
}
}
public zp_user_humanized_post(id)
if(zp_get_user_zombie_class(id) == g_zclass_Predator)
ability_end(id)
public bind_p(id, keys)
{
g_bind[id] = true
switch(keys)
{
case 0:
client_cmd(id, "bind p ability")
case 1:
client_print(id, print_chat, "[ZP] Ca sa fii invizibil scrie in consola: bind k ability. Apoi apasa tasta k!")
case 2:
g_use[id] = true
default:
g_bind[id] = false
}
return PLUGIN_HANDLED
}
public ability(id)
{
if (zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_zclass_Predator))
{
if(g_ability[id])
{
client_print(id, print_chat, "[ZP] You are already invisible and have maximum speed.")
return PLUGIN_HANDLED
}
if(!is_user_alive(id))
{
client_print(id, print_chat, "[ZP] You are dead now. Dead people can't use abilities.")
return PLUGIN_HANDLED
}
static Float: i
i = get_pcvar_float(cvar_cooldown)
if (get_gametime() - g_last[id] < i) {
client_print(id, print_chat, "[ZP] Wait %.f0 sec. to use your ability!", get_pcvar_float(cvar_cooldown) - (get_gametime() - g_last[id]))
return PLUGIN_HANDLED
} else {
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, get_pcvar_num(cvar_invamount))
set_user_maxspeed(id, get_pcvar_float(cvar_speed))
set_user_gravity(id, get_pcvar_float(cvar_gravity) / 800)
emit_sound(id, CHAN_BODY, g_sndInv, 1.0, ATTN_NORM, 0, PITCH_HIGH)
set_hudmessage(200, 100, 0, -1.0, 0.85, 0, 0.0, 3.0, 0.01, 0.01, -1)
show_hudmessage(id, "You are now invisible. Time to hunt!")
set_task(get_pcvar_float(cvar_ability_time), "ability_end", id)
if(get_pcvar_num(cvar_icon) == 1)
set_icon(id)
g_ability[id] = true
}
}
return PLUGIN_CONTINUE
}
public ability_end(id)
{
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 255)
set_user_maxspeed(id, float(zclass_speed))
set_user_gravity(id, zclass_gravity)
if (get_pcvar_num(cvar_cooldown) > 0)
client_print(id, print_chat, "[ZP] Wait %i sec to use your ability again.", get_pcvar_num(cvar_cooldown))
if(get_pcvar_num(cvar_icon) == 1)
delete_icon(id)
g_last[id] = get_gametime()
g_ability[id] = false
}
public fw_ppt(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return FMRES_IGNORED
if (g_use[id])
{
static button, oldbutton
button = get_user_button(id)
oldbutton = get_user_oldbutton(id)
if (!(button & IN_USE) && (oldbutton & IN_USE))
ability(id)
}
if (g_ability[id] && (zp_get_user_zombie_class(id) == g_zclass_Predator) && zp_get_user_zombie(id))
{
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, get_pcvar_num(cvar_invamount))
set_user_maxspeed(id, get_pcvar_float(cvar_speed))
set_pev(id, pev_flTimeStepSound, 999)
set_user_gravity(id, get_pcvar_float(cvar_gravity) / 800)
}
return PLUGIN_CONTINUE
}
public newround()
{
g_maxplayers = get_maxplayers()
for (new id = 1; id <= g_maxplayers; id++)
{
g_last[id] = get_gametime()
g_ability[id] = false
}
}
public fw_TakeDamage( victim, inflictor, attacker, Float:damage, damagebits )
{
if ((zp_get_user_zombie_class(attacker) == g_zclass_Predator) && (get_user_weapon(attacker) == CSW_KNIFE))
{
SetHamParamFloat( 4, damage * get_pcvar_float(cvar_dmg_multi) )
}
}
public death()
{
new id = read_data(2)
ability_end(id)
return PLUGIN_HANDLED
}
public set_icon(id)
{
static color[3], sprite[16]
color = {250, 250, 250}
sprite = "dmg_gas"
g_icon[id] = sprite
message_begin(MSG_ONE, g_status, {0, 0, 0}, id)
write_byte(1)
write_string(g_icon[id])
write_byte(color[0])
write_byte(color[1])
write_byte(color[2])
message_end()
}
public delete_icon(id)
{
message_begin(MSG_ONE, g_status, {0, 0, 0}, id)
write_byte(0)
write_string(g_icon[id])
message_end()
}
stock get_user_button(id)
return pev(id, pev_button)
stock get_user_oldbutton(id)
return pev(id, pev_oldbuttons)
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/
5.
Spoiler:
Code:
#include <amxmodx>
#include <zombieplague>
#include <engine>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#include <zombiexp>
#define ID_FURY (taskid - TASK_FURY)
// Task offsets
enum (+= 100)
{
TASK_FURY
}
// Zombie Attributes
new const zclass10_name[] = { "Zombie Cerberus Dog"}
new const zclass10_info[] = { "You have a fury" }
new const zclass10_model[] = { "Cerberus_frk_14" }
new const zclass10_clawmodel[] = { "v_doghands.mdl" }
const zclass10_health = 1999
const zclass10_speed = 375
const Float:zclass10_gravity = 0.55
const Float:zclass10_knockback = 0.5
const hclass_level = 13 // level required to use
new const idle[] = "zombie_plague/cerberus_idle.wav"
new const fury[] = "zombie_plague/cerberus_fury.wav"
new const normaly[] = "zombie_plague/cerberus_normaly.wav"
/*================================================================================
Customization ends here!
Any edits will be your responsibility
=================================================================================*/
// Plugin info.
#define PLUGIN "[ZP] Zombie Class: Cerberus Dog"
#define VERSION "0.1"
#define AUTHOR "DJHD!"
// Variables
new g_cerberus, g_veces[33], i_fury_time[33], g_maxplayers
// Cvar Pointers
new cvar_fury, cvar_furytime
/*================================================================================
[Init, CFG and Precache]
=================================================================================*/
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_fury = register_cvar("zp_cerberus_fury", "2)
cvar_furytime = register_cvar("zp_cerberus_fury_time", "20,0")
static szCvar[30]
formatex(szCvar, charsmax(szCvar), "v%s by %s", VERSION, AUTHOR)
register_cvar("zp_zclass_cerberus", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
register_logevent("roundStart", 2, "1=Round_Start")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
g_maxplayers = get_maxplayers()
}
public plugin_precache()
{
g_cerberus = zpxp_register_zombie_class(zclass10_name, zclass10_info, zclass10_model, zclass10_clawmodel, zclass10_health, zclass10_speed, zclass10_gravity, zclass10_knockback)
precache_sound(idle)
precache_sound(fury)
precache_sound(normaly)
}
/*================================================================================
[Zombie Plague Forwards]
=================================================================================*/
public zp_user_infected_post(id, infector)
{
if (zp_get_user_zombie_class(id) == g_cerberus)
{
client_print(id, print_chat, "[ZP] You have %d fury to use press - ^"E^"", get_pcvar_num(cvar_fury))
g_veces[id] = get_pcvar_num(cvar_fury)
i_fury_time[id] = get_pcvar_num(cvar_furytime)
emit_sound(id, CHAN_STREAM, idle, 1.0, ATTN_NORM, 0, PITCH_HIGH)
remove_task(id)
}
}
public zp_user_humanized_post(taskid)
{
new id = ID_FURY
remove_task(id+TASK_FURY)
set_user_godmode(id, 0)
}
/*================================================================================
[Main Forwards]
=================================================================================*/
public fw_PlayerPreThink(id)
{
if (!is_user_alive(id))
return FMRES_IGNORED
new button = get_user_button(id)
new oldbutton = get_user_oldbutton(id)
if (zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_cerberus))
{
if (!(oldbutton & IN_USE) && (button & IN_USE))
clcmd_furia(id)
}
return PLUGIN_CONTINUE
}
/*================================================================================
[Internal Functions]
=================================================================================*/
public clcmd_furia(taskid)
{
new id = ID_FURY
if(!is_user_alive(id) || !is_user_connected(id)|| !zp_get_user_zombie(id) || zp_get_user_nemesis(id) || zp_get_user_zombie_class(id) != g_cerberus)
return PLUGIN_HANDLED
if(g_veces[id] > 0)
{
g_veces[id] = g_veces[id] -1
set_task(0.1, "effects", id+TASK_FURY, _, _, "b")
i_fury_time[id] = get_pcvar_num(cvar_furytime)
set_task(1.0, "ShowHUD", id+TASK_FURY, _, _, "a", i_fury_time[id])
emit_sound(id, CHAN_STREAM, fury, 1.0, ATTN_NORM, 0, PITCH_HIGH)
}
else
{
client_print(id, print_chat, "[ZP] You dont have more fury.")
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public effects(id)
{
if(!is_user_alive(id) || !is_user_connected(id)|| !zp_get_user_zombie(id) || zp_get_user_nemesis(id) || zp_get_user_zombie_class(id) != g_cerberus)
return
static origin[3]
get_user_origin(id, origin)
message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_byte(TE_PARTICLEBURST) // TE id
write_coord(origin[0]) // x
write_coord(origin[1]) // y
write_coord(origin[2]) // z
write_short(130) // radius
write_byte(70) // color
write_byte(3) // duration (will be randomized a bit)
message_end()
message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_byte(TE_DLIGHT) // TE id
write_coord(origin[0]) // x
write_coord(origin[1]) // y
write_coord(origin[2]) // z
write_byte(22) // radius
write_byte(255) // r
write_byte(0) // g
write_byte(30) // b
write_byte(2) // life
write_byte(0) // decay rate
message_end()
set_user_godmode(id, 1)
set_task(get_pcvar_float(cvar_furytime), "remove_fury", id)
}
public ShowHUD(id)
{
if(is_user_alive(id))
{
i_fury_time[id] = i_fury_time[id] - 1;
set_hudmessage(200, 100, 0, -1.0, -0.46, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(id, "Fury: %d", i_fury_time[id]+1)
}
else
{
remove_task(id+TASK_FURY)
}
}
public remove_fury(taskid)
{
new id = ID_FURY
remove_task(id+TASK_FURY)
set_user_godmode(id, 0)
emit_sound(id, CHAN_STREAM, normaly, 1.0, ATTN_NORM, 0, PITCH_HIGH)
}
public roundStart()
{
for(new i = 1; i <= g_maxplayers; i++)
{
i_fury_time[i] = get_pcvar_num(cvar_furytime)
remove_task(i)
}
}
Si imi puteti da clasa aia de zombie care se reinviaza ? Doar sma-ul.
0
0
Back to top
destroi112
[DEV]
Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042
,
Topics: 119
Location:
---------
Reputation:
515.9
Votes
: 118
Posted: 30-01-2015, 15:14:10
| Translate post to:
... (
Click for more languages
)
Posteaza erorile.
EDIT:Uite aici foarte multe clase vezi daca gasesti ceva ce te atrage
AICI
Retired from Amxmodx
0
0
Back to top
QuIzZ
[Banned user]
Status: Offline
(since 03-02-2015 21:28)
Joined: 03 Jan 2015
Posts: 101
,
Topics: 20
Location:
Romania
Reputation:
24.2
Votes
: 9
Posted: 30-01-2015, 15:23:02
| Translate post to:
... (
Click for more languages
)
Am ales deja clase de acolo.
Compileaza-le si tu pe
https://amx.freakz.ro/
si vezi ce erori iti dau.
0
0
Back to top
GoguSM
[.: ZMGO.FREAKZ.RO :.]
Status: Offline
(since 16-03-2022 00:38)
Joined: 24 Aug 2013
Posts: 1516
,
Topics: 71
Location:
Brasov
Reputation:
1144
Votes
: 95
Posted: 30-01-2015, 15:46:30
| Translate post to:
... (
Click for more languages
)
Problemele sunt urmatoarele:
g_zclass_ghost = zpxp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
-->
g_zclass_ghost = zpxp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback, zclass_level)
Ai uitat sa inregistrezi clasele pe level.
0
0
Back to top
QuIzZ
[Banned user]
Status: Offline
(since 03-02-2015 21:28)
Joined: 03 Jan 2015
Posts: 101
,
Topics: 20
Location:
Romania
Reputation:
24.2
Votes
: 9
Posted: 30-01-2015, 15:53:41
| Translate post to:
... (
Click for more languages
)
Asa este.
Multumesc !
0
0
Back to top
Topic locked
Topic is closed, you cannot post any messages in it anymore
Locked by
-P!C@-
, 30 January 2015 14:07
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 05-12-2024, 05:42:32
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details