Ir al contenido
  • Crear una cuenta

[ZP] Anti-granadas para primer zombie


Oops!

Posts recomendados

Hola, tenía ganas de hacer algo e hice este plugin (para Zombie Plague 5.0). Su función es darle inmunidad a las granadas de fuego y/o hielo al primer zombie por X cantidad de segundos.

CVARS

fz_ag [0/1] : activar/desactivar plugin

fz_ag_duracion [segundos] : duración de la inmunidad anti-granadas

fz_ag_fire [0/1] : activar/desactivar inmunidad al fuego

fz_ag_frost [0/1] : activar/desactivar inmunidad al hielo

Code:

Spoiler

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <zombieplague>
#include <zp50_grenade_fire>
#include <zp50_grenade_frost>


#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

//variables
new cvar_on, cvar_time, cvar_antifire, cvar_antifrost
new antifuego[33], antihielo[33]
new maxplayers

public plugin_init() {
	register_plugin("First ZM anti-granadas", "1.0", "Emnlp_")
	
	//CVARs
	cvar_on = register_cvar("fz_ag", "1")
	cvar_time = register_cvar("fz_ag_duracion", "15.0")
	cvar_antifire = register_cvar("fz_ag_fire", "1")
	cvar_antifrost = register_cvar("fz_ag_frost", "1")
	
	
	
	maxplayers = get_maxplayers()
	
}

public zp_round_started(gamemode, id)
{
	if (zp_get_user_first_zombie(id)) // es 1er zombie
	{
		if(get_pcvar_num(cvar_antifrost)) // antihielo on
		{
			antihielo[id] = true
			set_task(get_pcvar_float(cvar_time), "no_frost_gone", 6666)
				
		}
		if(get_pcvar_num(cvar_antifire)) // antifuego on
		{
			antifuego[id] = true
			set_task(get_pcvar_float(cvar_time), "no_fire_gone", 5555)
			
		}
			
		
	}
}
	
	
public zp_fw_grenade_frost_pre(id)
{
	if (get_pcvar_num(cvar_on == 0)) // no esta activado
	return PLUGIN_CONTINUE
	
	if(antihielo[id]) // tiene antihielo
	return PLUGIN_HANDLED //bloquear hielo
	
	
	return PLUGIN_CONTINUE
	
}

public zp_fw_grenade_fire_pre(id)
{
	if (get_pcvar_num(cvar_on == 0)) // no esta activado
	return PLUGIN_CONTINUE
	
	if(antifuego[id]) // tiene antifuego
	return PLUGIN_HANDLED //bloquear fuego
	
	
	
	return PLUGIN_CONTINUE
}
public no_fire_gone()
{
	new id
	
	for (id = 1; id <= maxplayers; id++)
	{
		antifuego[id] = false
	}
}

public no_frost_gone()
{
	new id
	
	for (id = 1; id <= maxplayers; id++)
	{
		antihielo[id] = false
	}
}
public zp_round_ended(winteam)
{
	
	if (task_exists(5555))
	remove_task(5555)
	
	if (task_exists(6666))
	remove_task(6666)
	
	new id
	
	for (id = 1; id <= maxplayers; id++)
	{
		antifuego[id] = false
		antihielo[id] = false
	}
	
}
public client_disconnect(id)
{
	antifuego[id] = false
	antihielo[id] = false
}

		
		

 

 

fz_antigranadas.sma

Enlace al comentario
Compartir en otros sitios

  • Respuestas 0
  • Creado
  • Última respuesta

Top posteadores en este tema

  • Oops!

    1

Días populares

Top posteadores en este tema

Días populares

Invitado
Este tema se encuentra cerrado a nuevas respuestas.
  • Navegando Recientemente   0 miembros

    • No hay usuarios registrados viendo esta página

×
×
  • Crear nuevo...