Raised This Month: $ Target: $400
 0% 

help with zombie frozen


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
emcifox
Junior Member
Join Date: Dec 2014
Old 12-29-2014 , 11:43   help with zombie frozen
Reply With Quote #1

well hello morning everyone: D translator using google'm from chile, I have server recently and much is not good almost nothing about this whole cs <.<, well the thing is I have a frozen zombie shooting a beam. ice humans and freeze, but when one shoots may harm not want to disable it help me, for they hurt when you shoot. q I let this serve, XD

spaņol
hola buenos dias a todos uso traductor google soy de chile, tengo un servidor de hace poco y no se mucho bueno casi nada sobre todo esto del cs <.< , bueno la cosa es que tengo un zombie frozen que tira un rayo de hielo a los humanos y los congelas, pero cuando uno le dispara no le puede hacer daņo quisiera que me ayudaran en desactivar eso, para que le hagan daņo cuando le disparen. dejo esto creo q servira, XD

/*============================================ ====================================
[ZP] Class: eFrozen Zombie
v1.0
By: TheArmagedon

Cvar's:
** How much time the frozen? **
zp_efzm_frozen_time [TIME] - Default

** How much frozen zombie start? **
zp_efzm_frozen_start [AMOUNT] - Default:5

** Show the Menu? **
zp_efzm_menu [1/0] - Default: 1
* If 1 show the menu / If 0 automatic Hability on E *

============================================= ===================================*/

// Includes
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <fun>
#include <hamsandwich>

// Plugin version
#define VERSION "0.2"

// Variables
new g_Frozed[33], g_iFroz[33], g_frozid[33], timeFr[33], frozenable[33];
new Ebinded[33];
new frozentime, howmcfroz, g_SPR, menufr;

// Zombie Attributes
new const zclass_name[] = { "Frost Zombie" }
new const zclass_info[] = { "Puede congelar humanos" }
new const zclass_model[] = { "frost_zombie" }
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass_health = 1300
const zclass_speed = 220
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0

// Class ID
new g_zclassid1

public plugin_init()
{
// Plugin Register
register_plugin("[ZP] eFrozen Zombie", VERSION, "TheArmagedon")

// Events | Cvars | Forward | Others
frozentime = register_cvar("zp_efzm_frozen_time", "5")
howmcfroz = register_cvar("zp_efzm_frozen_start", "5")
menufr = register_cvar("zp_efzm_menu", "0") // If 1 show the menu | If 0 automatic Hability on E.

register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
RegisterHam(Ham_TakeDamage, "player", "player_damage")
register_forward(FM_CmdStart, "CmdStart" )
register_event("DeathMsg", "eventD", "a")
}
public plugin_precache()
{
// Register Plugin
register_plugin("[ZP] eFrozen Zombie", VERSION, "TheArmagedon")
register_cvar("zp_eFrozen", VERSION, FCVAR_SPONLY|FCVAR_SERVER)
set_cvar_string("zp_eFrozen", VERSION)

// Class Register
g_zclassid1 = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)

g_SPR = precache_model("sprites/zbeam4.spr")
}
public client_disconnect(id)
{
g_Frozed[id] = false;
g_frozid[id] = false;
}
public client_connect(id)
{
g_Frozed[id] = false;
g_frozid[id] = false;
}
public eventD()
{
new id = read_data(2)

if(frozenable[id])
{
g_Frozed[id] = false
frozenable[id] = false
}
}
public fw_PlayerPreThink(id)
{
if(!is_user_alive(id))
return;

// Frozen Command
if(g_Frozed[id])
{
set_pev(id, pev_velocity, Float:{0.0,0.0,0.0})
set_pev(id, pev_maxspeed, 1.0)
}
}
public zp_user_humanized_post(id)
frozenable[id] = false

// User Infected forward
public zp_user_infected_post(id, infector)
{
// Check if the infected player is using our custom zombie class
if (zp_get_user_zombie_class(id) == g_zclassid1)
{
client_print(id, print_chat, "[ZP] Elegiste Frost Zombie , Presiona E para congelar a los humanos[Hecho por Lechuga]! %s.", get_pcvar_num(menufr) ? "" : "")
g_iFroz[id] = get_pcvar_num(howmcfroz);
frozenable[id] = true

if(get_pcvar_num(menufr) == 1) {
menuItem(id)
Ebinded[id] = false
} else {
Ebinded[id] = true
}

if(!Ebinded[id])
set_task(5.0, "menuItem", id)
}
}
public menuItem(id)
{
if(is_user_alive(id)) {
if(frozenable[id]) {
if(get_pcvar_num(menufr) == 1) {
new menu = menu_create("eFrozen Zombie: Menu:", "choosemenuItem")

menu_additem(menu, "\wUse", "1", 0)
menu_additem(menu, "\wUse on \rE \wKey^n^n", "2", 0)

new szText[40]
format(szText, sizeof szText -1, "\yFrozen's left: \r%i", g_iFroz[id])
menu_additem(menu, szText, "3", 0)

menu_setprop(menu, MPROP_EXITNAME, "Exit")
menu_display(id, menu, 0)
}
}
}
}

public choosemenuItem(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

new data[6], iName[64]
new access, callback

menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)

switch(str_to_num(data))
{
case 1:
{
if(is_user_alive(id)) {
g_iFroz[id] ? frozen(id) : client_print(id, print_console, "[ZP] Ya no te queda para congelar!")

if(g_iFroz[id] > 0) {
set_task(2.0, "menuItem", id)
} else
client_print(id, print_chat, "[ZP] Se te ha acabado para congelar!")
}
}
case 2:
{
if(is_user_alive(id)) {
Ebinded[id] = true
}
}
case 3:
{
menuItem(id)
}
}

menu_destroy(menu)
return PLUGIN_HANDLED
}

public frozen(id)
{
if(!g_iFroz[id])
return HAM_IGNORED;

if(!frozenable[id])
return HAM_IGNORED;

if(!zp_get_user_zombie(id))
return HAM_IGNORED;

new player, body
get_user_aiming(id, player, body)

g_frozid[id] = true

dois_wave(id)

if(!is_user_connected(player) || !is_user_alive(player))
return HAM_IGNORED;

new parms[2]
parms[0] = id
parms[1] = player
set_task(0.2, "frozed", 0, parms, 2)

return HAM_IGNORED;
}
public frozed(parm[])
{
new id = parm[0]
new player = parm[1]

if(!is_user_connected(id) || !is_user_connected(player))
return

if(zp_get_user_zombie(player))
return

if(!zp_get_user_zombie(id))
return

if(zp_get_user_nemesis(id))
return

if(zp_get_user_survivor(player))
return

if(g_Frozed[player]) {
client_print(id, print_chat, "[ZP] El jugador ya esta congelado")
return
}

g_iFroz[id]--

client_print(id, print_chat, "[ZP] %i Frozen's left!" ,g_iFroz[id])

g_Frozed[player] = true

set_user_rendering(player, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25)

set_task(get_pcvar_float(frozentime), "remove_froz", player)

client_print(player, print_chat, "You has been Frozen, You cant damage now! (Unfrozen in %d Seconds)", get_pcvar_num(frozentime));
}
public remove_froz(id)
{
if(g_Frozed[id]) {
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 0)
g_Frozed[id] = false
client_print(id, print_chat, "Your frozen end!")
}
}
// Froz Skill
public dois_wave(id)
{
if(g_frozid[id]) {
if(frozenable[id]) {
new aimvec[3]

new damradius = 50

if( !is_user_alive(id) ) return

get_user_origin(id, aimvec, 3)
beam_effectz(id, aimvec, damradius)

set_task(1.5, "gfrozfalse", id)
}
}
}
public gfrozfalse(id)
g_frozid[id] = false

public beam_effectz(id, aimvec[3], damradius)
{
if(g_frozid[id]) {
new beamWidth

//Change sprite size according to blast radius
new blastSize = floatround(damradius / 12.0)

if (blastSize <= 1 {
beamWidth = 50
}
else {
beamWidth = 75
}

//Beam
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(1) //TE_BEAMENTPOINTS
write_short(id) //ent
write_coord(aimvec[0]) //position
write_coord(aimvec[1])
write_coord(aimvec[2])
write_short(g_SPR) // sprite index
write_byte(0) // start frame
write_byte(35) // framerate
write_byte(4) // life
write_byte(beamWidth) // width
write_byte(0) // noise
write_byte(0) // red (rgb color)
write_byte(100) // green (rgb color)
write_byte(200) // blue (rgb color)
write_byte(215) // brightness
write_byte(21) // speed
message_end()
}
}
public player_damage(victim, ent, attacker, Float:damage, bits)
{
if(!is_user_connected(victim) || !is_user_connected(attacker))
return HAM_IGNORED;

if(g_Frozed[attacker])
return HAM_SUPERCEDE;

return HAM_IGNORED;
}
public CmdStart( const id, const uc_handle, random_seed ) {

if(is_user_alive(id))
{
new buttons = pev(id, pev_button)
new oldbuttons = pev(id, pev_oldbuttons)

if(Ebinded[id]) {
if(buttons & IN_USE) {
if(g_iFroz[id] > 0) {
if(!timeFr[id]) {
timeFr[id] = true
set_task(5.0, "RmvTask", id)
frozen(id)
}
}
}
}
if(Ebinded[id]) {
if(oldbuttons & IN_USE && !(buttons & IN_USE)) {
if(g_iFroz[id] > 0) {
if(!timeFr[id]) {
timeFr[id] = true
set_task(5.0, "RmvTask", id)
frozen(id)
}
}
}
}
}
return FMRES_IGNORED
}
public RmvTask(id)
timeFr[id] = false
emcifox is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-30-2014 , 02:13   Re: help with zombie frozen
Reply With Quote #2

Please use [ PAWN ] tags to post your code.
__________________
Kia is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode