Cerere plugin Happy Hours ZM

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
KeNzY213
Membru, skill 0
Membru, skill 0
Posts: 34
Joined: 27 Oct 2018, 12:29
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

01 Nov 2018, 13:00

Salut!
As dori un plugin de Happy Hours Event , sa-l pornesc eu cand vreau, printr-o comanda spre ex " amx_happy on" amx_happy off, dar sa porneasca si la orele setate.
Multumesc!
Voi lasa aici link-ul catre sursa pluginului .
Olium
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2043
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 330 times
Contact:

05 Nov 2018, 11:52

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <zombieplague>

new bool:g_happyhour
new cvar_init,cvar_end,cvar_on,cvar_multi,g_packs[33],message[80]

// Uncomment this line if you use the zombie plague 4.2 or an older
//#define ZP_42_OR_OLDER

public plugin_init() 
{
	register_plugin("Happy hour", "1.0", "capostrike")
	
	cvar_init = register_cvar("zp_happyinit", "2")
	cvar_end = register_cvar("zp_happyend", "7")
	cvar_on = register_cvar("zp_happyhour", "1")
	cvar_multi = register_cvar("zp_happymultipler", "2")
	
	RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
	RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage_post",1)
	RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
	RegisterHam(Ham_Killed, "player", "fw_PlayerKilled_post", 1)
	RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_post",1)

	register_clcmd("amx_happy","ClcmdHAPP",ADMIN_CVAR,"Folosire: amx_happy on/off - pornire/oprire event VIP")
}

public ClcmdHAPP(id,level,cid)
{
	if(!cmd_access(id,level,cid,1))	return	console_print(id,"[AMXX]: Nu ai acces!")

	if(!get_pcvar_num(cvar_on))	return	console_print(id,"[AMXX]: Functie dezactivata!")

	new arg1[32]
	read_argv(1,arg1,charsmax(arg1))

	if(equali(arg1,"")||str_to_num(arg1))	return	console_print(id,"[AMXX]: Folosire corecta > amx_happy ON/OFF")

	if(equali(arg1,"on"))
	{
		if(!g_happyhour)	g_happyhour=true
		return	console_print(id,"[AMXX]: Eventul VIP a fost pornit cu succes.")
	}

	if(equali(arg1,"off"))
	{
		if(g_happyhour)	g_happyhour=false
		return	console_print(id,"[AMXX]: Eventul VIP a fost oprit cu succes.")
	}

	return PLUGIN_HANDLED
}

public plugin_cfg()
{
	if(get_pcvar_num(cvar_on))
	{
		new data[3]
		get_time("%H", data, 2)
		
		if(get_pcvar_num(cvar_end) > str_to_num(data) >= get_pcvar_num(cvar_init))
		{
			g_happyhour = true
			formatex(message, charsmax(message), "[Happy Hour]!! Init: %d - End: %d", get_pcvar_num(cvar_init), get_pcvar_num(cvar_end))
		}  
	}
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(!g_happyhour) return HAM_IGNORED;
	if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;
	#if !defined ZP_42_OR_OLDER
	if(!zp_get_user_zombie(victim) || zp_get_user_zombie(attacker)) return HAM_IGNORED;
	#endif
	
	g_packs[attacker] = zp_get_user_ammo_packs(attacker)
	
	return HAM_IGNORED;
}
public fw_TakeDamage_post(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(!g_happyhour) return HAM_IGNORED;
	if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;
	#if !defined ZP_42_OR_OLDER
	if(!zp_get_user_zombie(victim) || zp_get_user_zombie(attacker)) return HAM_IGNORED;
	#endif
	if(!g_packs[attacker])  return HAM_IGNORED;
	
	new diff = (zp_get_user_ammo_packs(attacker) - g_packs[attacker]);
	
	if(diff)
	{
		diff *= get_pcvar_num(cvar_multi);
		zp_set_user_ammo_packs(attacker, g_packs[attacker]+diff)
		g_packs[attacker] = 0;
	}
	
	return HAM_IGNORED;
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
	if(!g_happyhour) return HAM_IGNORED;
	if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;
	
	g_packs[attacker] = zp_get_user_ammo_packs(attacker)
	
	return HAM_IGNORED;
}
public fw_PlayerKilled_post(victim, attacker, shouldgib)
{
	if(!g_happyhour) return HAM_IGNORED;
	if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;
	if(!g_packs[attacker])  return HAM_IGNORED;
	
	new diff = (zp_get_user_ammo_packs(attacker) - g_packs[attacker]);
	
	if(diff)
	{
		diff *= get_pcvar_num(cvar_multi);
		zp_set_user_ammo_packs(attacker, g_packs[attacker]+diff)
		g_packs[attacker] = 0;
	}
	
	return HAM_IGNORED;
}
#if !defined ZP_42_OR_OLDER
public zp_user_infected_pre(victim,attacker)
{
	if(!g_happyhour) return HAM_IGNORED;
	if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;
	
	g_packs[attacker] = zp_get_user_ammo_packs(attacker)
	
	return HAM_IGNORED;
}
public zp_user_infected_post(victim,attacker)
{
	if(!g_happyhour) return HAM_IGNORED;
	if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;
	if(!g_packs[attacker])  return HAM_IGNORED;
	
	new diff = (zp_get_user_ammo_packs(attacker) - g_packs[attacker]);
	
	if(diff)
	{
		diff *= get_pcvar_num(cvar_multi);
		zp_set_user_ammo_packs(attacker, g_packs[attacker]+diff)
		g_packs[attacker] = 0;
	}
	
	return HAM_IGNORED;
}
#endif
public fw_PlayerSpawn_post(id)
{
	if(message[0]) client_print(id,print_chat, message)
}
KeNzY213
Membru, skill 0
Membru, skill 0
Posts: 34
Joined: 27 Oct 2018, 12:29
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

05 Nov 2018, 23:11

Multumesc!
Post Reply

Return to “Cereri”

  • Information