Преработка zp_extra_(jetpack, armor, unlimited_clip)

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
Dachoni
Извън линия
Потребител
Потребител
Мнения: 157
Регистриран на: 23 Ное 2017, 16:48
Се отблагодари: 95 пъти
Получена благодарност: 6 пъти

Преработка zp_extra_(jetpack, armor, unlimited_clip)

Мнение от Dachoni » 17 Яну 2018, 21:45

Здравейте, бихте ли ми преработили тези три плъгина:

[ZP] Extra Item: Jetpack + Bazooka 1.1:

Код за потвърждение: Избери целия код

/*
---------------------------------------------------------
   #  #  #    #===    ###    ##    #
  #    ##     #===   #      #  #    #
   #   #      #===    ###    ##    #
---------------------------------------------------------
[ZP] Extra Item: Jetpack + Bazooka 1.1

Plugin made by <VeCo>
---------------------------------------------------------
If you modify the code, please DO NOT change the author!
---------------------------------------------------------
Contacts:
e-mail: [email protected]
skype: veco_kn
---------------------------------------------------------
Changes log:
 -> v 1.0 = First release!
 -> v 1.1 = Now, the bazooka can break func_breakable
	    entities.
	    Fixed bug with the knife model.
---------------------------------------------------------
Don't forget to visit http://www.amxmodxbg.org :)
---------------------------------------------------------
*/

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#include <zombieplague>

new sprite_explosion,sprite_beamcylinder, jp_itemid,
cvar_cost,cvar_damage,cvar_speed,cvar_reload_time,cvar_radius,
cvar_start_energy,cvar_remove_energy,cvar_heal_energy,cvar_heal_time,cvar_zvelocity,cvar_aimvelocity,
cvar_can_drop,cvar_one_round,
maxplayers,hudsync, has_jetpack[33],can_shoot[33],energy[33]
public plugin_precache()
{
	precache_model("models/v_egon.mdl")
	precache_model("models/p_egon.mdl")
	precache_model("models/w_egon.mdl")
	
	precache_model("models/rpgrocket.mdl")
	
	sprite_explosion = precache_model("sprites/zerogxplode.spr")
	sprite_beamcylinder = precache_model("sprites/white.spr")
	
	precache_sound("weapons/rocketfire1.wav")
	precache_sound("common/bodydrop2.wav")
	precache_sound("items/gunpickup2.wav")
	precache_sound("jetpack.wav")
}

public plugin_init() {
	register_plugin("[ZP] Extra Item: Jetpack + Bazooka", "1.1", "<VeCo>")
	
	cvar_cost = register_cvar("vecjp_cost","35")
	cvar_speed = register_cvar("vecjp_rocket_speed","800")
	cvar_damage = register_cvar("vecjp_damage","800")
	cvar_reload_time = register_cvar("vecjp_reload_time","10.0")
	cvar_radius = register_cvar("vecjp_radius","150")
	cvar_start_energy = register_cvar("vecjp_start_energy","200")
	cvar_remove_energy = register_cvar("vecjp_remove_energy","1")
	cvar_heal_energy = register_cvar("vecjp_heal_energy","10")
	cvar_heal_time = register_cvar("vecjp_heal_time","1.0")
	cvar_zvelocity = register_cvar("vecjp_zvelocity","300")
	cvar_aimvelocity = register_cvar("vecjp_aimvelocity","300")
	cvar_can_drop = register_cvar("vecjp_can_drop","1")
	cvar_one_round = register_cvar("vecjp_one_round","0")
	
	jp_itemid = zp_register_extra_item("Jetpack + bazooka",get_pcvar_num(cvar_cost),ZP_TEAM_HUMAN)
	
	register_clcmd("drop","drop_jetpack")
	
	RegisterHam(Ham_Weapon_SecondaryAttack,"weapon_knife","shoot_jetpack")
	RegisterHam(Ham_Player_Jump,"player","fly_jetpack")
	
	register_touch("weapon_jetpack","player","get_jetpack")
	register_touch("","info_jetpack_rocket","touch_jetpack")
	
	register_event("DeathMsg","hook_death","a")
	register_event("CurWeapon","event_curweapon","be","1=1","2=29")
	
	register_logevent("round_end",2,"1=Round_End")
	
	maxplayers = get_maxplayers()
	hudsync = CreateHudSyncObj()
}

public zp_extra_item_selected(id,itemid)
{
	if(itemid != jp_itemid) return
	
	if(has_jetpack[id])
	{
		client_print(id,print_chat,"[VECJP] You have already own a jetpack.")
		return
	}
	
	has_jetpack[id] = true
	can_shoot[id] = true
	energy[id] = get_pcvar_num(cvar_start_energy)
	
	emit_sound(id,CHAN_AUTO,"items/gunpickup2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	client_cmd(id,"weapon_knife")
	
	entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
	entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
}

public drop_jetpack(id) if(get_pcvar_num(cvar_can_drop) && get_user_weapon(id) == CSW_KNIFE && has_jetpack[id]) action_drop_user_jetpack(id)

public shoot_jetpack(ent)
{
	new id = entity_get_edict(ent,EV_ENT_owner)
	if(!has_jetpack[id]) return HAM_IGNORED
	
	if(!can_shoot[id])
	{
		client_print(id,print_center,"[VECJP] You can't shoot with the jetpack right now. Please wait...")
		return HAM_IGNORED
	}
	
	action_shoot_user_jetpack(id)
	
	return HAM_IGNORED
}

public fly_jetpack(id)
{
	if(!has_jetpack[id]) return HAM_IGNORED
	
	if(!energy[id])
	{
		client_print(id,print_center,"[VECJP] You don't have enough energy to fly.")
		return HAM_IGNORED
	}
	
	if(get_user_button(id) & IN_DUCK) action_fly_user_jetpack(id)
	
	return HAM_IGNORED
}

public action_heal_user_jetpack(id)
{
	if(!is_user_connected(id) || !has_jetpack[id]) return
	
	if(zp_get_user_zombie(id) || zp_get_user_nemesis(id))
	{
		action_remove_user_jetpack(id)
		return
	}
	
	if(entity_get_int(id,EV_INT_flags) & FL_INWATER)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
	}
	
	if(entity_get_int(id,EV_INT_flags) & FL_ONGROUND)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
		
		if(energy[id] < get_pcvar_num(cvar_start_energy))
		{
			energy[id] += get_pcvar_num(cvar_heal_energy)
			if(energy[id] > get_pcvar_num(cvar_start_energy)) energy[id] = get_pcvar_num(cvar_start_energy)
			
			set_hudmessage(255, 0, 0, -1.0, 0.29, 0, 6.0, 1.0, 0.1, 0.2, -1)
			ShowSyncHudMsg(id,hudsync,"Jetpack Energy: [%i / %i]",energy[id],get_pcvar_num(cvar_start_energy))
		}
	}
	
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
}

public action_drop_user_jetpack(id)
{
	remove_task(id)
	
	has_jetpack[id] = false
	can_shoot[id] = false
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_KILLBEAM)
	write_short(id)
	message_end()
	
	emit_sound(id,CHAN_AUTO,"common/bodydrop2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	new ent = create_entity("info_target")
	if(ent)
	{
		new Float:origin[3],Float:velocity[3]
		
		entity_get_vector(id,EV_VEC_origin,origin)
		velocity_by_aim(id,60,velocity)
		
		origin[0] += velocity[0]
		origin[1] += velocity[1]
		
		entity_set_string(ent,EV_SZ_classname,"weapon_jetpack")
		entity_set_model(ent,"models/w_egon.mdl")
		
		entity_set_int(ent,EV_INT_solid,SOLID_TRIGGER)
		entity_set_int(ent,EV_INT_movetype,MOVETYPE_TOSS)
		
		entity_set_int(ent,EV_INT_iuser1,energy[id])
		
		entity_set_float(ent,EV_FL_gravity,1.0)
		
		entity_set_origin(ent,origin)
	}
	
	energy[id] = 0
}

public action_shoot_user_jetpack(id)
{
	can_shoot[id] = false
	
	emit_sound(id,CHAN_AUTO,"weapons/rocketfire1.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	new ent = create_entity("info_target")
	if(ent)
	{
		new Float:origin[3],Float:velocity[3],Float:angles[3]
		
		entity_get_vector(id,EV_VEC_origin,origin)
		velocity_by_aim(id,60,velocity)
		
		origin[0] += velocity[0]
		origin[1] += velocity[1]
		
		velocity[0] = 0.0
		velocity[1] = 0.0
		
		velocity_by_aim(id,get_pcvar_num(cvar_speed),velocity)
		
		entity_set_string(ent,EV_SZ_classname,"info_jetpack_rocket")
		entity_set_model(ent,"models/rpgrocket.mdl")
		
		entity_set_int(ent,EV_INT_solid,SOLID_BBOX)
		entity_set_int(ent,EV_INT_movetype,MOVETYPE_FLY)
		
		entity_set_size(ent,Float:{-0.5,-0.5,-0.5},Float:{0.5,0.5,0.5})
		
		entity_set_vector(ent,EV_VEC_velocity,velocity)
		
		vector_to_angle(velocity,angles)
		entity_set_vector(ent,EV_VEC_angles,angles)
		
		entity_set_edict(ent,EV_ENT_owner,id)
		
		entity_set_int(ent,EV_INT_effects,entity_get_int(ent,EV_INT_effects) | EF_LIGHT)
		
		entity_set_origin(ent,origin)
		
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_BEAMFOLLOW)
		write_short(ent)
		write_short(sprite_beamcylinder)
		write_byte(30)
		write_byte(5)
		write_byte(255)
		write_byte(255)
		write_byte(255)
		write_byte(140)
		message_end()
	}
	
	set_task(get_pcvar_float(cvar_reload_time),"action_reload_user_jetpack",id)
}

public action_fly_user_jetpack(id)
{
	new Float:velocity[3]
	velocity_by_aim(id,get_pcvar_num(cvar_aimvelocity),velocity)
	velocity[2] += float(get_pcvar_num(cvar_zvelocity))
	entity_set_vector(id,EV_VEC_velocity,velocity)
	
	energy[id] -= get_pcvar_num(cvar_remove_energy)
	if(energy[id] < 1) energy[id] = 0
	
	set_hudmessage(255, 0, 0, -1.0, 0.29, 0, 6.0, 1.0, 0.1, 0.2, -1)
	ShowSyncHudMsg(id,hudsync,"Jetpack Energy: [%i / %i]",energy[id],get_pcvar_num(cvar_start_energy))
	
	emit_sound(id,CHAN_AUTO,"jetpack.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_KILLBEAM)
	write_short(id)
	message_end()
	
	if(entity_get_int(id,EV_INT_flags) & FL_INWATER) return
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_BEAMFOLLOW)
	write_short(id)
	write_short(sprite_beamcylinder)
	write_byte(25)
	write_byte(10)
	write_byte(255)
	write_byte(255)
	write_byte(255)
	write_byte(175)
	message_end()
}

public action_reload_user_jetpack(id)
{
	if(!is_user_connected(id) || !has_jetpack[id]) return
	can_shoot[id] = true
	
	client_print(id,print_center,"[VECJP] Your jetpack has been reloaded. Now you can shoot again!")
}

public get_jetpack(ent,id)
{
	if(has_jetpack[id] || zp_get_user_zombie(id) || zp_get_user_nemesis(id)) return
	
	remove_task(id)
	
	has_jetpack[id] = true
	can_shoot[id] = false
	energy[id] = entity_get_int(ent,EV_INT_iuser1)
	
	emit_sound(id,CHAN_AUTO,"items/gunpickup2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	client_cmd(id,"weapon_knife")
	
	entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
	entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	
	set_task(get_pcvar_float(cvar_reload_time),"action_reload_user_jetpack",id)
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
	
	remove_entity(ent)
}

public touch_jetpack(world,ent)
{
	if(!is_valid_ent(ent)) return
	
	new Float:origin[3], origin_int[3], owner = entity_get_edict(ent,EV_ENT_owner)
	entity_get_vector(ent,EV_VEC_origin,origin)
	
	FVecIVec(origin,origin_int)
	
	new id = -1
	while((id = find_ent_in_sphere(id,origin,float(get_pcvar_num(cvar_radius)))) != 0)
	{
		if(!is_user_connected(owner)) break
		
		if(1 <= id <= maxplayers)
		{
			if(!zp_get_user_zombie(id) && !zp_get_user_nemesis(id)) continue
			ExecuteHamB(Ham_TakeDamage,id, owner,owner, float(get_pcvar_num(cvar_damage)), DMG_ALWAYSGIB)
		} else {
			if(!is_valid_ent(id)) continue
			
			new classname[15]
			entity_get_string(id,EV_SZ_classname,classname,14)
			
			if(!equal(classname,"func_breakable")) continue
			
			ExecuteHamB(Ham_TakeDamage,id, owner,owner, float(get_pcvar_num(cvar_damage)), DMG_ALWAYSGIB)
		}
	}
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_EXPLOSION)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_short(sprite_explosion)
	write_byte(floatround(get_pcvar_num(cvar_radius) * 0.5))
	write_byte(10)
	write_byte(0)
	message_end()
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_DLIGHT)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_byte(floatround(get_pcvar_num(cvar_radius) * 0.25))
	write_byte(200)
	write_byte(145)
	write_byte(0)
	write_byte(16)
	write_byte(32)
	message_end()
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_BEAMCYLINDER)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2] + get_pcvar_num(cvar_radius))
	write_short(sprite_beamcylinder)
	write_byte(0)
	write_byte(0)
	write_byte(10)
	write_byte(50)
	write_byte(0)
	write_byte(255)
	write_byte(255)
	write_byte(255)
	write_byte(160)
	write_byte(0)
	message_end()
	
	remove_entity(ent)
}

public hook_death()
{
	new id = read_data(2)
	action_remove_user_jetpack(id)
}

public action_remove_user_jetpack(id)
{
	if(get_pcvar_num(cvar_can_drop))
	{
		if(has_jetpack[id] && get_user_weapon(id) == CSW_KNIFE) action_drop_user_jetpack(id)
		
		has_jetpack[id] = false
		can_shoot[id] = false
		energy[id] = 0
		
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
	} else {
		has_jetpack[id] = false
		can_shoot[id] = false
		energy[id] = 0
	}
}

public event_curweapon(id)
{
	if(has_jetpack[id] && !zp_get_user_zombie(id))
	{
		entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
		entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	}
}

public round_end()
{
	remove_entity_name("weapon_jetpack")
	
	if(get_pcvar_num(cvar_one_round))
	{
		for(new i=1;i<maxplayers;i++)
		{
			if(is_user_connected(i))
			{
				has_jetpack[i] = false
				can_shoot[i] = false
				energy[i] = 0
			}
		}
	}
}

public client_connect(id) has_jetpack[id] = false
public client_disconnect(id) has_jetpack[id] = false
Anti-Infection Armor 1.0:

Код за потвърждение: Избери целия код

/*================================================================================
	
	-------------------------------------------------
	-*- [ZP] Extra Item: Anti-Infection Armor 1.0 -*-
	-------------------------------------------------
	
	~~~~~~~~~~~~~~~
	- Description -
	~~~~~~~~~~~~~~~
	
	This item gives humans some armor that offers protection
	against zombie injuries.
	
================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

/*================================================================================
 [Plugin Customization]
=================================================================================*/

new const g_item_name[] = { "Anti-Infection Armor" }
const g_item_cost = 5

new const g_sound_buyarmor[] = { "items/tr_kevlar.wav" }
const g_armor_amount = 100
const g_armor_limit = 999

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

// Item IDs
new g_itemid_humanarmor

public plugin_precache()
{
	precache_sound(g_sound_buyarmor)
}

public plugin_init()
{
	register_plugin("[ZP] Extra: Anti-Infection Armor", "1.0", "MeRcyLeZZ")
	
	g_itemid_humanarmor = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)
}

// Human buys our upgrade, give him some armor
public zp_extra_item_selected(player, itemid)
{
	if (itemid == g_itemid_humanarmor)
	{
		set_pev(player, pev_armorvalue, float(min(pev(player, pev_armorvalue)+g_armor_amount, g_armor_limit)))
		engfunc(EngFunc_EmitSound, player, CHAN_BODY, g_sound_buyarmor, 1.0, ATTN_NORM, 0, PITCH_NORM)
	}
}
zp_extra_unlimited_clip:

Код за потвърждение: Избери целия код

/*================================================================================
	
	-------------------------------------------
	-*- [ZP] Extra Item: Unlimited Clip 1.0 -*-
	-------------------------------------------
	
	~~~~~~~~~~~~~~~
	- Description -
	~~~~~~~~~~~~~~~
	
	This item/upgrade gives players unlimited clip ammo for a single round.
	
================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

/*================================================================================
 [Plugin Customization]
=================================================================================*/

new const g_item_name[] = { "Unlimited Clip (single round)" }
const g_item_cost = 10

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

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4

// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
			10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

new g_itemid_infammo, g_has_unlimited_clip[33]

public plugin_init()
{
	register_plugin("[ZP] Extra: Unlimited Clip", "1.0", "MeRcyLeZZ")
	
	g_itemid_infammo = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)	
	
	register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
	register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
}

// Player buys our upgrade, set the unlimited ammo flag
public zp_extra_item_selected(player, itemid)
{
	if (itemid == g_itemid_infammo)
		g_has_unlimited_clip[player] = true
}

// Reset flags for all players on newround
public event_round_start()
{
	for (new id; id <= 32; id++) g_has_unlimited_clip[id] = false;
}

// Unlimited clip code
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
	// Player doesn't have the unlimited clip upgrade
	if (!g_has_unlimited_clip[msg_entity])
		return;
	
	// Player not alive or not an active weapon
	if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
		return;
	
	static weapon, clip
	weapon = get_msg_arg_int(2) // get weapon ID
	clip = get_msg_arg_int(3) // get weapon clip
	
	// Unlimited Clip Ammo
	if (MAXCLIP[weapon] > 2) // skip grenades
	{
		set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
		
		if (clip < 2) // refill when clip is nearly empty
		{
			// Get the weapon entity
			static wname[32], weapon_ent
			get_weaponname(weapon, wname, sizeof wname - 1)
			weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
			
			// Set max clip on weapon
			fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
		}
	}
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
	while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}
	
	return entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entity, amount)
{
	set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
*/
Да работят с zombie plague Crazy Night

Благодаря ви.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Преработка zp_extra_(jetpack, armor, unlimited_clip)

Мнение от OciXCrom » 17 Яну 2018, 21:57

По-скоро ще преработя .inc файла за да може да поддържа плъгини от Zombie Plague. Ако някой плъгин не се компилира - не е съвместим с мода.

Код за потвърждение: Избери целия код

/*================================================================================
	
	-----------------------------------------------
	-*- Zombie Plague Crazy Night Includes File -*-
	-----------------------------------------------
	
	~~~~~~~~~~
	- How To -
	~~~~~~~~~~
	
	To make use of the Zombie Plague API features in your plugin, just
	add the following line at the beginning of your script:
	
	#include <zplague_crazynight>
	
	~~~~~~~~~~~
	- Natives -
	~~~~~~~~~~~
	
	These work just like any other functions: you may have to pass
	parameters and they usually return values.
	
	Example:
	
	if ( is_user_alive( id ) && zpcn_get_user_zombie( id ) )
	{
		server_print( "Player %d is alive and a zombie", id )
	}
	
	~~~~~~~~~~~~
	- Forwards -
	~~~~~~~~~~~~
	
	Forwards get called whenever an event happens during the game.
	You need to make a public callback somewhere on your script,
	and it will automatically be triggered when the event occurs.
	
	Example:
	
	public zpcn_user_infected_post( id, infector, nemesis, assassin )
	{
		if ( !infector || nemesis || assassin )
			return;
		
		server_print( "Player %d just got infected by %d!", id, infector )
	}
	
	Also, take note of cases when there's a suffix:
	
	* _pre  : means the forward will be called BEFORE the event happens
	* _post : means it will be called AFTER the event takes place
	
=================================================================================*/

#if defined _zplague_crazynight_included
  #endinput
#endif
#define _zplague_crazynight_included

#if AMXX_VERSION_NUM >= 175
	#pragma reqlib zplague_crazynight
	#if !defined AMXMODX_NOAUTOLOAD
		#pragma loadlib zplague_crazynight
	#endif
#else
	#pragma library zplague_crazynight
#endif

/* Teams for zpcn_register_extra_item() */
#define ZPCN_TEAM_ZOMBIE (1<<0)
#define ZPCN_TEAM_HUMAN (1<<1)

#define ZP_TEAM_ZOMBIE ZPCN_TEAM_ZOMBIE
#define ZP_TEAM_HUMAN ZPCN_TEAM_HUMAN

/* Weapon types for zpcn_register_weapon() */
#define ZPCN_PRIMARY_WEAPON (1<<0)
#define ZPCN_SECONDARY_WEAPON (1<<1)

/* Game modes for zpcn_round_started() */
enum
{
	MODE_INFECTION = 1,
	MODE_MULTI,
	MODE_SWARM,
	MODE_NEMESIS,
	MODE_ASSASSIN,
	MODE_SURVIVOR,
	MODE_SNIPER,
	MODE_PLAGUE,
	MODE_ARMAGEDDON,
	MODE_APOCALYPSE,
};

/* Winner teams for zpcn_round_ended() */
enum
{
	WIN_NO_ONE = 0,
	WIN_ZOMBIES,
	WIN_HUMANS,
};

/* Custom forward return values */
#define ZPCN_PLUGIN_HANDLED 97
#define ZP_PLUGIN_HANDLED ZPCN_PLUGIN_HANDLED

/**
 * Returns whether a player is a VIP.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_vip(id)

/**
 * Returns whether a player is a zombie.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_zombie(id)
#define zp_get_user_zombie zpcn_get_user_zombie

/**
 * Returns whether a player is a human.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_human(id)

/**
 * Returns whether a player is a nemesis.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_nemesis(id)
#define zp_get_user_nemesis zpcn_get_user_nemesis

/**
 * Returns whether a player is a assassin.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_assassin(id)

/**
 * Returns whether a player is a survivor.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_survivor(id)
#define zp_get_user_survivor zpcn_get_user_survivor

/**
 * Returns whether a player is a sniper.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_sniper(id)

/**
 * Returns whether a player is the first zombie.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_first_zombie(id)
#define zp_get_user_first_zombie zpcn_get_user_first_zombie

/**
 * Returns whether a player is the last zombie.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_last_zombie(id)
#define zp_get_user_last_zombie zpcn_get_user_last_zombie

/**
 * Returns whether a player is the last human.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_last_human(id)
#define zp_get_user_last_human zpcn_get_user_last_human

/**
 * Returns a player's current zombie class ID.
 *
 * @param id		Player index.
 * @return		Internal zombie class ID, or -1 if not yet chosen.
 */
native zpcn_get_user_zombie_class(id)
#define zp_get_user_zombie_class zpcn_get_user_zombie_class

/**
 * Returns a player's current human class ID.
 *
 * @param id		Player index.
 * @return		Internal human class ID, or -1 if not yet chosen.
 */
native zpcn_get_user_human_class(id)

/**
 * Returns a player's next zombie class ID (for the next infection).
 *
 * @param id		Player index.
 * @return		Internal zombie class ID, or -1 if not yet chosen.
 */
native zpcn_get_user_next_zclass(id)
#define zp_get_user_next_class zpcn_get_user_next_zclass

/**
 * Returns a player's next human class ID (for the next infection).
 *
 * @param id		Player index.
 * @return		Internal human class ID, or -1 if not yet chosen.
 */
native zpcn_get_user_next_hlass(id)

/**
 * Sets a player's next zombie class ID (for the next infection).
 *
 * @param id		Player index.
 * @param classid	A valid zombie class ID.
 * @return		True on success, false otherwise.
 */
native zpcn_set_user_next_zclass(id, classid)
#define zp_set_user_zombie_class zpcn_set_user_next_zclass

/**
 * Sets a player's next human class ID (for the next spawn or cure).
 *
 * @param id		Player index.
 * @param classid	A valid human class ID.
 * @return		True on success, false otherwise.
 */
native zpcn_set_user_next_hlass(id, classid)

/**
 * Returns a player's ammo pack count.
 *
 * @param id		Player index.
 * @return		Number of ammo packs owned.
 */
native zpcn_get_user_ammo_packs(id)
#define zp_get_user_ammo_packs zpcn_get_user_ammo_packs

/**
 * Sets a player's ammo pack count.
 *
 * @param id		Player index.
 * @param amount	New quantity of ammo packs owned.
 */
native zpcn_set_user_ammo_packs(id, amount)
#define zp_set_user_ammo_packs zpcn_set_user_ammo_packs

/**
 * Returns a player's current knife.
 *
 * Note: Only avaliable to humans.
 *
 * @param id		Player index.
 * @return		Current knife is use.
 */
native zpcn_get_user_knife(id)

/**
 * Returns the default maximum health of a zombie.
 *
 * Note: Takes into account first zombie's HP multiplier.
 *
 * @param id		Player index.
 * @return		Maximum amount of health points, or -1 if not a normal zombie.
 */
native zpcn_get_zombie_maxhealth(id)
#define zp_get_zombie_maxhealth zpcn_get_zombie_maxhealth

/**
 * Returns the default maximum health of a human.
 *
 * @param id		Player index.
 * @return		Maximum amount of health points, or -1 if not a normal human.
 */
native zpcn_get_human_maxhealth(id)

/**
 * Forces a player to become a zombie.
 *
 * Note: Unavailable for last human/survivor/sniper.
 *
 * @param id		Player index to be infected.
 * @param infector	Player index who infected him (optional).
 * @param silent	If set, there will be no HUD messages or infection sounds.
 * @param rewards	Whether to show DeathMsg and reward frags, hp, and ammo packs to infector.
 * @return		True on success, false otherwise.
 */
native zpcn_infect_user(id, infector = 0, silent = 0, rewards = 0)
#define zp_infect_user zpcn_infect_user

/**
 * Forces a player to become a human.
 *
 * Note: Unavailable for last zombie/nemesis/assassin.
 *
 * @param id		Player index to be cured.
 * @param silent	If set, there will be no HUD messages or antidote sounds.
 * @return		True on success, false otherwise.
 */
native zpcn_desinfect_user(id, silent = 0)
#define zp_disinfect_user zpcn_disinfect_user

/**
 * Forces a player to become a nemesis.
 *
 * Note: Unavailable for last human/survivor/sniper.
 *
 * @param id		Player index to turn into nemesis.
 * @return		True on success, false otherwise.
 */
native zpcn_make_user_nemesis(id)
#define zp_make_user_nemesis zpcn_make_user_nemesis

/**
 * Forces a player to become a assassin.
 *
 * Note: Unavailable for last human/survivor/sniper.
 *
 * @param id		Player index to turn into assassin.
 * @return		True on success, false otherwise.
 */
native zpcn_make_user_assassin(id)

/**
 * Forces a player to become a survivor.
 *
 * Note: Unavailable for last zombie/nemesis/assassin.
 *
 * @param id		Player index to turn into survivor.
 * @return		True on success, false otherwise.
 */
native zpcn_make_user_survivor(id)
#define zp_make_user_survivor zpcn_make_user_survivor

/**
 * Forces a player to become a sniper.
 *
 * Note: Unavailable for last zombie/nemesis/assassin.
 *
 * @param id		Player index to turn into sniper.
 * @return		True on success, false otherwise.
 */
native zpcn_make_user_sniper(id)

/**
 * Respawns a player into a specific team.
 *
 * @param id		Player index to be respawned.
 * @return		True on success, false otherwise.
 */
native zpcn_respawn_user(id)
#define zp_respawn_user zpcn_respawn_user

/**
 * Forces a player to buy an extra item.
 *
 * @param id		Player index.
 * @param itemid	A valid extra item ID.
 * @param ignorecost	If set, item's cost won't be deduced from player.
 * @return		True on success, false otherwise.
 */
native zpcn_force_buy_extra_item(id, itemid, ignorecost = 0)
#define zp_force_buy_extra_item zpcn_force_buy_extra_item

/**
 * Forces a player to buy an weapon.
 *
 * @param id		Player index.
 * @param weaponid	A valid weapon ID.
 * @return		True on success, false otherwise.
 */
native zpcn_force_buy_weapon(id, weaponid)

/**
 * Forces a player to buy an knife.
 *
 * @param id		Player index.
 * @param knifeid	A valid knife ID.
 * @return		True on success, false otherwise.
 */
native zpcn_force_buy_knife(id, knifeid)

/**
 * Returns whether the ZP round has started, i.e. first zombie
 * has been chosen or a game mode has begun.
 *
 * @return		0 - Round not started
 *			1 - Round started
 *			2 - Round starting
 */
native zpcn_has_round_started()
#define zp_has_round_started zpcn_has_round_started

/**
 * Returns whether the current round is a nemesis round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_nemesis_round()
#define zp_is_nemesis_round zpcn_is_nemesis_round

/**
 * Returns whether the current round is a assassin round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_assassin_round()

/**
 * Returns whether the current round is a survivor round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_survivor_round()
#define zp_is_survivor_round zpcn_is_survivor_round

/**
 * Returns whether the current round is a sniper round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_sniper_round()

/**
 * Returns whether the current round is a swarm round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_swarm_round()
#define zp_is_swarm_round zpcn_is_swarm_round

/**
 * Returns whether the current round is a plague round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_plague_round()
#define zp_is_plague_round zpcn_is_plague_round

/**
 * Returns whether the current round is a armageddon round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_armageddon_round()

/**
 * Returns whether the current round is a apocalypse round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_apocalypse_round()

/**
 * Returns number of alive zombies.
 *
 * @return		Zombie count.
 */
native zpcn_get_zombie_count()
#define zp_get_zombie_count zpcn_get_zombie_count

/**
 * Returns number of alive humans.
 *
 * @return		Human count.
 */
native zpcn_get_human_count()
#define zp_get_human_count zpcn_get_human_count

/**
 * Returns number of alive nemesis.
 *
 * @return		Nemesis count.
 */
native zpcn_get_nemesis_count()
#define zp_get_nemesis_count zpcn_get_nemesis_count

/**
 * Returns number of alive assassin.
 *
 * @return		Assassin count.
 */
native zpcn_get_assassin_count()

/**
 * Returns number of alive survivors.
 *
 * @return		Survivor count.
 */
native zpcn_get_survivor_count()
#define zp_get_survivor_count zpcn_get_survivor_count

/**
 * Returns number of alive snipers.
 *
 * @return		Sniper count.
 */
native zpcn_get_sniper_count()

/**
 * Returns ID of current round.
 *
 * @return		Mode ID if round already has started, -1 otherwise.
 */
native zpcn_get_current_round()

/**
 * Force begin of a game mode.
 *
 * @param gamemode	Mode which will start.
 * @param id		Affected player's index (if applicable).
 * @return		True on success, false otherwise.
 */
native zpcn_start_game_mode(gamemode, id)

/**
 * Registers a custom class which will be added to the human classes menu of ZP.
 *
 * Note: The returned human class ID can be later used to identify
 * the class when calling the zpcn_get_user_human_class() natives.
 *
 * @param name		Caption to display on the menu.
 * @param info		Brief description of the class.
 * @param health	Initial health points.
 * @param armor		Initial armor points.
 * @param gravity	Gravity multiplier.
 * @param speed		Maximum speed.
 * @param model		Player model to be used.
 * @param cost		Enable cost. Set "0" to be a free class.
 * @param vip		Allow only for VIP users.
 * @return		An internal human class ID, or -1 on failure.
 */
native zpcn_register_human_class(const name[], const info[], health, armor, Float:gravity, Float:speed, const model[], cost = 0, vip = 0)

/**
 * Registers a custom class which will be added to the zombie classes menu of ZP.
 *
 * Note: The returned zombie class ID can be later used to identify
 * the class when calling the zpcn_get_user_zombie_class() natives.
 *
 * @param name		Caption to display on the menu.
 * @param info		Brief description of the class.
 * @param health	Initial health points.
 * @param gravity	Gravity multiplier.
 * @param speed		Maximum speed.
 * @param claw		Claw model to be used.
 * @param model		Player model to be used.
 * @param cost		Enable cost. Set "0" to be a free class.
 * @param vip		Allow only for VIP users.
 * @return		An internal zombie class ID, or -1 on failure.
 */
native zpcn_register_zombie_class(const name[], const info[], health, Float:gravity, Float:speed, const claw[], const model[], cost = 0, vip = 0)
#define zp_register_zombie_class zpcn_register_zombie_class

/**
 * Registers a custom weapon which will be added to the weapons menu of ZP.
 *
 * @param name		Caption to display on the menu.
 * @param handler	Function to be executed when selected.
 * @param type		Bitsum of type it should be available for (primary or secondary).
 * @param vip		Allow only for VIP users.
 * @return		An internal weapon ID, or -1 on failure.
 */
native zpcn_register_weapon(const name[], const handler[], type, vip = 0)

/**
 * Registers a custom knife which will be added to the knifes menu of ZP.
 *
 * @param name		Caption to display on the menu.
 * @param vmodel	Knife v_ model.
 * @param pmodel	Knife p_ model.
 * @param vip		Allow only for VIP users.
 * @return		An internal knife ID, or -1 on failure.
 */
native zpcn_register_knife(const name[], const vmodel[], const pmodel[], vip = 0)

/**
 * Registers a custom item which will be added to the extra items menu of ZP.
 *
 * @param name		Caption to display on the menu.
 * @param cost		Ammo packs to be deducted on purchase.
 * @param handler	Function to be executed when selected.
 * @param team		Bitsum of team it should be available for.
 * @param limit		Item buy limit for each round.
 * @param vip		Allow only for VIP users.
 * @return		An internal extra item ID, or -1 on failure.
 */
native zpcn_register_extra_item(const name[], cost, const handler[], team, limit = 0, vip = 0)
#define zp_register_extra_item zpcn_register_extra_item

/**
 * Registers a custom game mode which will be added to the game.
 *
 * @param name			Caption to display on the menu.
 * @param handler		Function to be executed when started.
 * @param enable		Enable custom game mode.
 * @param chance		Custom game mode chance (1 in x).
 * @param minplayers	Custom game mode minimum players.
 * @param infection		Allow infection from zombies.
 * @param extraitems	Allow extra items menu.
 * @param respawn		Allow automatically respawn.
 * @param flags			Access flags to start game mode (admin menu).
 * @return		An internal game mode ID, or -1 on failure.
 */
native zpcn_register_game_mode(const name[], const handler[], enable, chance, minplayers, infection = 0, extraitems = 0, respawn = 1, const flags[]="d")

/**
 * Registers a custom game mode which will be added to the game.
 *
 * @param modeid		An internal game mode ID.
 * @param sound			Sound to be executed when mode start.
 * @param ambience		Round ambience sound name.
 * @param enable		Enable round ambience sound.
 * @param duration		Ambience sound duration.
 * @return		True on success, or false on failure.
 */
native zpcn_register_mode_sounds(modeid, const sound[], const ambience[], enable, duration)

/**
 * Returns an weapon's ID.
 *
 * @param name		Weapon name to look for.
 * @return		Internal weapon ID, or -1 if not found.
 */
native zpcn_get_weapon_id(const name[])

/**
 * Returns an extra item's ID.
 *
 * @param name		Item name to look for.
 * @return		Internal extra item ID, or -1 if not found.
 */
native zpcn_get_extra_item_id(const name[])
#define zp_get_extra_item_id zpcn_get_extra_item_id

/**
 * Returns an knife's ID.
 *
 * @param name		Knife name to look for.
 * @return		Internal knife ID, or -1 if not found.
 */
native zpcn_get_knife_id(const name[])

/**
 * Returns a zombie class' ID.
 *
 * @param name		Class name to look for.
 * @return		Internal zombie class ID, or -1 if not found.
 */
native zpcn_get_zombie_class_id(const name[])
#define zp_get_zombie_class_id zpcn_get_zombie_class_id

/**
 * Returns a human class' ID.
 *
 * @param name		Class name to look for.
 * @return		Internal human class ID, or -1 if not found.
 */
native zpcn_get_human_classe_id(const name[])

/**
 * Called when the ZP round starts, i.e. first zombie
 * is chosen or a game mode begins.
 *
 * @param gamemode	Mode which has started.
 * @param id		Affected player's index (if applicable).
 */
forward zpcn_round_started(gamemode, id)
#define zp_round_started zpcn_round_started

/**
 * Called when the round ends.
 *
 * @param winteam	Team which has won the round.
 */
forward zpcn_round_ended(winteam)
#define zp_round_ended zpcn_round_ended

/**
 * Called when a player gets infected.
 *
 * @param id		Player index who was infected.
 * @param infector	Player index who infected him (if applicable).
 * @param nemesis	Whether the player was turned into a nemesis.
 * @param assassin	Whether the player was turned into a assassin.
 */
forward zpcn_user_infected_pre(id, infector, nemesis, assassin)
forward zpcn_user_infected_post(id, infector, nemesis, assassin)
#define zp_user_infected_pre zpcn_user_infected_pre
#define zp_user_infected_post zpcn_user_infected_post

/**
 * Called when a player turns back to human.
 *
 * @param id		Player index who was cured.
 * @param survivor	Whether the player was turned into a survivor.
 * @param sniper	Whether the player was turned into a sniper.
 */
forward zpcn_user_humanized_pre(id, survivor, sniper)
forward zpcn_user_humanized_post(id, survivor, sniper)
#define zp_user_humanized_pre zpcn_user_humanized_pre
#define zp_user_humanized_post zpcn_user_humanized_post

/**
 * Called on a player infect/cure attempt. You can use this to block
 * an infection/humanization by returning ZPCN_PLUGIN_HANDLED in your plugin.
 *
 * Note: Right now this is only available after the ZP round starts, since some
 * situations (like blocking a first zombie's infection) are not yet handled.
 */
forward zpcn_user_infect_attempt(id, infector, nemesis, assassin)
forward zpcn_user_humanize_attempt(id, survivor, sniper)
#define zp_user_infect_attempt zpcn_user_infect_attempt
#define zp_user_humanize_attempt zpcn_user_humanize_attempt

/**
 * Called when a player gets unfrozen (frostnades).
 *
 * @param id		Player index.
 */
forward zpcn_user_unfrozen(id)
#define zp_user_unfrozen zpcn_user_unfrozen

/**
 * Called when a player becomes the last zombie.
 *
 * Note: This is called for the first zombie too.
 *
 * @param id		Player index.
 */
forward zpcn_user_last_zombie(id)
#define zp_user_last_zombie zpcn_user_last_zombie

/**
 * Called when a player becomes the last human.
 *
 * @param id		Player index.
 */
forward zpcn_user_last_human(id)
#define zp_user_last_human zpcn_user_last_human

Аватар
Dachoni
Извън линия
Потребител
Потребител
Мнения: 157
Регистриран на: 23 Ное 2017, 16:48
Се отблагодари: 95 пъти
Получена благодарност: 6 пъти

Преработка zp_extra_(jetpack, armor, unlimited_clip)

Мнение от Dachoni » 17 Яну 2018, 22:20

Промених и компилирах плъгините под това, което дадохте zplague_crazynight.inc
Това пише в лога с debug за 3-те плъгина:

Код за потвърждение: Избери целия код

L 01/17/2018 - 22:10:48: -------- Mapchange to zm_ice_attack3 --------
L 01/17/2018 - 22:10:48: [AMXX] Plugin "zp_jetpack_veco.amxx" failed to load: Plugin uses an unknown function (name "zp_get_user_nemesis") - check your modules.ini.
L 01/17/2018 - 22:10:48: [AMXX] Plugin "zp_extra_human_armor.amxx" failed to load: Plugin uses an unknown function (name "zp_register_extra_item") - check your modules.ini.
L 01/17/2018 - 22:10:48: [AMXX] Plugin "zp_extra_unlimited_clip.amxx" failed to load: Plugin uses an unknown function (name "zp_register_extra_item") - check your modules.ini.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Преработка zp_extra_(jetpack, armor, unlimited_clip)

Мнение от OciXCrom » 17 Яну 2018, 22:23

Забравих да кажа, че трябва да замениш в кодовете #include <zombieplague> с #include <zplague_crazynight>.

//Едит: няма как да стане така. Трябва изцяло да се променя кода, тъй като начинът на регистриране екстра итеми не е един и същ.

Аватар
Dachoni
Извън линия
Потребител
Потребител
Мнения: 157
Регистриран на: 23 Ное 2017, 16:48
Се отблагодари: 95 пъти
Получена благодарност: 6 пъти

Преработка zp_extra_(jetpack, armor, unlimited_clip)

Мнение от Dachoni » 17 Яну 2018, 22:30

И трите плъгина искат цялосна промяна май:

Код за потвърждение: Избери целия код

Error: Argument type mismatch (argument 3) on line 73
Това е на 73 ред (пример от джета):

Код за потвърждение: Избери целия код

jp_itemid = zp_register_extra_item("Jetpack + bazooka",get_pcvar_num(cvar_cost),ZP_TEAM_HUMAN)
---------
Благодаря за помоща!
Мода бил доста бъгав и явно няма да стане.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Преработка zp_extra_(jetpack, armor, unlimited_clip)

Мнение от OciXCrom » 18 Яну 2018, 20:41

Опитай така за първия плъгин:

Код за потвърждение: Избери целия код

/*
---------------------------------------------------------
   #  #  #    #===    ###    ##    #
  #    ##     #===   #      #  #    #
   #   #      #===    ###    ##    #
---------------------------------------------------------
[ZP] Extra Item: Jetpack + Bazooka 1.1

Plugin made by <VeCo>
---------------------------------------------------------
If you modify the code, please DO NOT change the author!
---------------------------------------------------------
Contacts:
e-mail: [email protected]
skype: veco_kn
---------------------------------------------------------
Changes log:
 -> v 1.0 = First release!
 -> v 1.1 = Now, the bazooka can break func_breakable
		entities.
		Fixed bug with the knife model.
---------------------------------------------------------
Don't forget to visit http://www.amxmodxbg.org :)
---------------------------------------------------------
*/

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#include <zplague_crazynight>

new sprite_explosion,sprite_beamcylinder,
cvar_cost,cvar_damage,cvar_speed,cvar_reload_time,cvar_radius,
cvar_start_energy,cvar_remove_energy,cvar_heal_energy,cvar_heal_time,cvar_zvelocity,cvar_aimvelocity,
cvar_can_drop,cvar_one_round,
maxplayers,hudsync, has_jetpack[33],can_shoot[33],energy[33]
public plugin_precache()
{
	precache_model("models/v_egon.mdl")
	precache_model("models/p_egon.mdl")
	precache_model("models/w_egon.mdl")
	
	precache_model("models/rpgrocket.mdl")
	
	sprite_explosion = precache_model("sprites/zerogxplode.spr")
	sprite_beamcylinder = precache_model("sprites/white.spr")
	
	precache_sound("weapons/rocketfire1.wav")
	precache_sound("common/bodydrop2.wav")
	precache_sound("items/gunpickup2.wav")
	precache_sound("jetpack.wav")
}

public plugin_init() {
	register_plugin("[ZP] Extra Item: Jetpack + Bazooka", "1.1", "<VeCo>")
	
	cvar_cost = register_cvar("vecjp_cost","35")
	cvar_speed = register_cvar("vecjp_rocket_speed","800")
	cvar_damage = register_cvar("vecjp_damage","800")
	cvar_reload_time = register_cvar("vecjp_reload_time","10.0")
	cvar_radius = register_cvar("vecjp_radius","150")
	cvar_start_energy = register_cvar("vecjp_start_energy","200")
	cvar_remove_energy = register_cvar("vecjp_remove_energy","1")
	cvar_heal_energy = register_cvar("vecjp_heal_energy","10")
	cvar_heal_time = register_cvar("vecjp_heal_time","1.0")
	cvar_zvelocity = register_cvar("vecjp_zvelocity","300")
	cvar_aimvelocity = register_cvar("vecjp_aimvelocity","300")
	cvar_can_drop = register_cvar("vecjp_can_drop","1")
	cvar_one_round = register_cvar("vecjp_one_round","0")
	
	zpcn_register_extra_item("Jetpack + bazooka",get_pcvar_num(cvar_cost),"zp_extra_item_selected",ZP_TEAM_HUMAN)
	
	register_clcmd("drop","drop_jetpack")
	
	RegisterHam(Ham_Weapon_SecondaryAttack,"weapon_knife","shoot_jetpack")
	RegisterHam(Ham_Player_Jump,"player","fly_jetpack")
	
	register_touch("weapon_jetpack","player","get_jetpack")
	register_touch("","info_jetpack_rocket","touch_jetpack")
	
	register_event("DeathMsg","hook_death","a")
	register_event("CurWeapon","event_curweapon","be","1=1","2=29")
	
	register_logevent("round_end",2,"1=Round_End")
	
	maxplayers = get_maxplayers()
	hudsync = CreateHudSyncObj()
}

public zp_extra_item_selected(id)
{	
	if(has_jetpack[id])
	{
		client_print(id,print_chat,"[VECJP] You have already own a jetpack.")
		return
	}
	
	has_jetpack[id] = true
	can_shoot[id] = true
	energy[id] = get_pcvar_num(cvar_start_energy)
	
	emit_sound(id,CHAN_AUTO,"items/gunpickup2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	client_cmd(id,"weapon_knife")
	
	entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
	entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
}

public drop_jetpack(id) if(get_pcvar_num(cvar_can_drop) && get_user_weapon(id) == CSW_KNIFE && has_jetpack[id]) action_drop_user_jetpack(id)

public shoot_jetpack(ent)
{
	new id = entity_get_edict(ent,EV_ENT_owner)
	if(!has_jetpack[id]) return HAM_IGNORED
	
	if(!can_shoot[id])
	{
		client_print(id,print_center,"[VECJP] You can't shoot with the jetpack right now. Please wait...")
		return HAM_IGNORED
	}
	
	action_shoot_user_jetpack(id)
	
	return HAM_IGNORED
}

public fly_jetpack(id)
{
	if(!has_jetpack[id]) return HAM_IGNORED
	
	if(!energy[id])
	{
		client_print(id,print_center,"[VECJP] You don't have enough energy to fly.")
		return HAM_IGNORED
	}
	
	if(get_user_button(id) & IN_DUCK) action_fly_user_jetpack(id)
	
	return HAM_IGNORED
}

public action_heal_user_jetpack(id)
{
	if(!is_user_connected(id) || !has_jetpack[id]) return
	
	if(zp_get_user_zombie(id) || zp_get_user_nemesis(id))
	{
		action_remove_user_jetpack(id)
		return
	}
	
	if(entity_get_int(id,EV_INT_flags) & FL_INWATER)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
	}
	
	if(entity_get_int(id,EV_INT_flags) & FL_ONGROUND)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
		
		if(energy[id] < get_pcvar_num(cvar_start_energy))
		{
			energy[id] += get_pcvar_num(cvar_heal_energy)
			if(energy[id] > get_pcvar_num(cvar_start_energy)) energy[id] = get_pcvar_num(cvar_start_energy)
			
			set_hudmessage(255, 0, 0, -1.0, 0.29, 0, 6.0, 1.0, 0.1, 0.2, -1)
			ShowSyncHudMsg(id,hudsync,"Jetpack Energy: [%i / %i]",energy[id],get_pcvar_num(cvar_start_energy))
		}
	}
	
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
}

public action_drop_user_jetpack(id)
{
	remove_task(id)
	
	has_jetpack[id] = false
	can_shoot[id] = false
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_KILLBEAM)
	write_short(id)
	message_end()
	
	emit_sound(id,CHAN_AUTO,"common/bodydrop2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	new ent = create_entity("info_target")
	if(ent)
	{
		new Float:origin[3],Float:velocity[3]
		
		entity_get_vector(id,EV_VEC_origin,origin)
		velocity_by_aim(id,60,velocity)
		
		origin[0] += velocity[0]
		origin[1] += velocity[1]
		
		entity_set_string(ent,EV_SZ_classname,"weapon_jetpack")
		entity_set_model(ent,"models/w_egon.mdl")
		
		entity_set_int(ent,EV_INT_solid,SOLID_TRIGGER)
		entity_set_int(ent,EV_INT_movetype,MOVETYPE_TOSS)
		
		entity_set_int(ent,EV_INT_iuser1,energy[id])
		
		entity_set_float(ent,EV_FL_gravity,1.0)
		
		entity_set_origin(ent,origin)
	}
	
	energy[id] = 0
}

public action_shoot_user_jetpack(id)
{
	can_shoot[id] = false
	
	emit_sound(id,CHAN_AUTO,"weapons/rocketfire1.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	new ent = create_entity("info_target")
	if(ent)
	{
		new Float:origin[3],Float:velocity[3],Float:angles[3]
		
		entity_get_vector(id,EV_VEC_origin,origin)
		velocity_by_aim(id,60,velocity)
		
		origin[0] += velocity[0]
		origin[1] += velocity[1]
		
		velocity[0] = 0.0
		velocity[1] = 0.0
		
		velocity_by_aim(id,get_pcvar_num(cvar_speed),velocity)
		
		entity_set_string(ent,EV_SZ_classname,"info_jetpack_rocket")
		entity_set_model(ent,"models/rpgrocket.mdl")
		
		entity_set_int(ent,EV_INT_solid,SOLID_BBOX)
		entity_set_int(ent,EV_INT_movetype,MOVETYPE_FLY)
		
		entity_set_size(ent,Float:{-0.5,-0.5,-0.5},Float:{0.5,0.5,0.5})
		
		entity_set_vector(ent,EV_VEC_velocity,velocity)
		
		vector_to_angle(velocity,angles)
		entity_set_vector(ent,EV_VEC_angles,angles)
		
		entity_set_edict(ent,EV_ENT_owner,id)
		
		entity_set_int(ent,EV_INT_effects,entity_get_int(ent,EV_INT_effects) | EF_LIGHT)
		
		entity_set_origin(ent,origin)
		
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_BEAMFOLLOW)
		write_short(ent)
		write_short(sprite_beamcylinder)
		write_byte(30)
		write_byte(5)
		write_byte(255)
		write_byte(255)
		write_byte(255)
		write_byte(140)
		message_end()
	}
	
	set_task(get_pcvar_float(cvar_reload_time),"action_reload_user_jetpack",id)
}

public action_fly_user_jetpack(id)
{
	new Float:velocity[3]
	velocity_by_aim(id,get_pcvar_num(cvar_aimvelocity),velocity)
	velocity[2] += float(get_pcvar_num(cvar_zvelocity))
	entity_set_vector(id,EV_VEC_velocity,velocity)
	
	energy[id] -= get_pcvar_num(cvar_remove_energy)
	if(energy[id] < 1) energy[id] = 0
	
	set_hudmessage(255, 0, 0, -1.0, 0.29, 0, 6.0, 1.0, 0.1, 0.2, -1)
	ShowSyncHudMsg(id,hudsync,"Jetpack Energy: [%i / %i]",energy[id],get_pcvar_num(cvar_start_energy))
	
	emit_sound(id,CHAN_AUTO,"jetpack.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_KILLBEAM)
	write_short(id)
	message_end()
	
	if(entity_get_int(id,EV_INT_flags) & FL_INWATER) return
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_BEAMFOLLOW)
	write_short(id)
	write_short(sprite_beamcylinder)
	write_byte(25)
	write_byte(10)
	write_byte(255)
	write_byte(255)
	write_byte(255)
	write_byte(175)
	message_end()
}

public action_reload_user_jetpack(id)
{
	if(!is_user_connected(id) || !has_jetpack[id]) return
	can_shoot[id] = true
	
	client_print(id,print_center,"[VECJP] Your jetpack has been reloaded. Now you can shoot again!")
}

public get_jetpack(ent,id)
{
	if(has_jetpack[id] || zp_get_user_zombie(id) || zp_get_user_nemesis(id)) return
	
	remove_task(id)
	
	has_jetpack[id] = true
	can_shoot[id] = false
	energy[id] = entity_get_int(ent,EV_INT_iuser1)
	
	emit_sound(id,CHAN_AUTO,"items/gunpickup2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	client_cmd(id,"weapon_knife")
	
	entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
	entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	
	set_task(get_pcvar_float(cvar_reload_time),"action_reload_user_jetpack",id)
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
	
	remove_entity(ent)
}

public touch_jetpack(world,ent)
{
	if(!is_valid_ent(ent)) return
	
	new Float:origin[3], origin_int[3], owner = entity_get_edict(ent,EV_ENT_owner)
	entity_get_vector(ent,EV_VEC_origin,origin)
	
	FVecIVec(origin,origin_int)
	
	new id = -1
	while((id = find_ent_in_sphere(id,origin,float(get_pcvar_num(cvar_radius)))) != 0)
	{
		if(!is_user_connected(owner)) break
		
		if(1 <= id <= maxplayers)
		{
			if(!zp_get_user_zombie(id) && !zp_get_user_nemesis(id)) continue
			ExecuteHamB(Ham_TakeDamage,id, owner,owner, float(get_pcvar_num(cvar_damage)), DMG_ALWAYSGIB)
		} else {
			if(!is_valid_ent(id)) continue
			
			new classname[15]
			entity_get_string(id,EV_SZ_classname,classname,14)
			
			if(!equal(classname,"func_breakable")) continue
			
			ExecuteHamB(Ham_TakeDamage,id, owner,owner, float(get_pcvar_num(cvar_damage)), DMG_ALWAYSGIB)
		}
	}
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_EXPLOSION)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_short(sprite_explosion)
	write_byte(floatround(get_pcvar_num(cvar_radius) * 0.5))
	write_byte(10)
	write_byte(0)
	message_end()
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_DLIGHT)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_byte(floatround(get_pcvar_num(cvar_radius) * 0.25))
	write_byte(200)
	write_byte(145)
	write_byte(0)
	write_byte(16)
	write_byte(32)
	message_end()
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_BEAMCYLINDER)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2] + get_pcvar_num(cvar_radius))
	write_short(sprite_beamcylinder)
	write_byte(0)
	write_byte(0)
	write_byte(10)
	write_byte(50)
	write_byte(0)
	write_byte(255)
	write_byte(255)
	write_byte(255)
	write_byte(160)
	write_byte(0)
	message_end()
	
	remove_entity(ent)
}

public hook_death()
{
	new id = read_data(2)
	action_remove_user_jetpack(id)
}

public action_remove_user_jetpack(id)
{
	if(get_pcvar_num(cvar_can_drop))
	{
		if(has_jetpack[id] && get_user_weapon(id) == CSW_KNIFE) action_drop_user_jetpack(id)
		
		has_jetpack[id] = false
		can_shoot[id] = false
		energy[id] = 0
		
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
	} else {
		has_jetpack[id] = false
		can_shoot[id] = false
		energy[id] = 0
	}
}

public event_curweapon(id)
{
	if(has_jetpack[id] && !zp_get_user_zombie(id))
	{
		entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
		entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	}
}

public round_end()
{
	remove_entity_name("weapon_jetpack")
	
	if(get_pcvar_num(cvar_one_round))
	{
		for(new i=1;i<maxplayers;i++)
		{
			if(is_user_connected(i))
			{
				has_jetpack[i] = false
				can_shoot[i] = false
				energy[i] = 0
			}
		}
	}
}

public client_connect(id) has_jetpack[id] = false
public client_disconnect(id) has_jetpack[id] = false
.inc файла:

Код за потвърждение: Избери целия код

/*================================================================================
	
	-----------------------------------------------
	-*- Zombie Plague Crazy Night Includes File -*-
	-----------------------------------------------
	
	~~~~~~~~~~
	- How To -
	~~~~~~~~~~
	
	To make use of the Zombie Plague API features in your plugin, just
	add the following line at the beginning of your script:
	
	#include <zplague_crazynight>
	
	~~~~~~~~~~~
	- Natives -
	~~~~~~~~~~~
	
	These work just like any other functions: you may have to pass
	parameters and they usually return values.
	
	Example:
	
	if ( is_user_alive( id ) && zpcn_get_user_zombie( id ) )
	{
		server_print( "Player %d is alive and a zombie", id )
	}
	
	~~~~~~~~~~~~
	- Forwards -
	~~~~~~~~~~~~
	
	Forwards get called whenever an event happens during the game.
	You need to make a public callback somewhere on your script,
	and it will automatically be triggered when the event occurs.
	
	Example:
	
	public zpcn_user_infected_post( id, infector, nemesis, assassin )
	{
		if ( !infector || nemesis || assassin )
			return;
		
		server_print( "Player %d just got infected by %d!", id, infector )
	}
	
	Also, take note of cases when there's a suffix:
	
	* _pre  : means the forward will be called BEFORE the event happens
	* _post : means it will be called AFTER the event takes place
	
=================================================================================*/

#if defined _zplague_crazynight_included
  #endinput
#endif
#define _zplague_crazynight_included

#if AMXX_VERSION_NUM >= 175
	#pragma reqlib zplague_crazynight
	#if !defined AMXMODX_NOAUTOLOAD
		#pragma loadlib zplague_crazynight
	#endif
#else
	#pragma library zplague_crazynight
#endif

/* Teams for zpcn_register_extra_item() */
#define ZPCN_TEAM_ZOMBIE (1<<0)
#define ZPCN_TEAM_HUMAN (1<<1)

#define ZP_TEAM_ZOMBIE ZPCN_TEAM_ZOMBIE
#define ZP_TEAM_HUMAN ZPCN_TEAM_HUMAN

/* Weapon types for zpcn_register_weapon() */
#define ZPCN_PRIMARY_WEAPON (1<<0)
#define ZPCN_SECONDARY_WEAPON (1<<1)

/* Game modes for zpcn_round_started() */
enum
{
	MODE_INFECTION = 1,
	MODE_MULTI,
	MODE_SWARM,
	MODE_NEMESIS,
	MODE_ASSASSIN,
	MODE_SURVIVOR,
	MODE_SNIPER,
	MODE_PLAGUE,
	MODE_ARMAGEDDON,
	MODE_APOCALYPSE,
};

/* Winner teams for zpcn_round_ended() */
enum
{
	WIN_NO_ONE = 0,
	WIN_ZOMBIES,
	WIN_HUMANS,
};

/* Custom forward return values */
#define ZPCN_PLUGIN_HANDLED 97
#define ZP_PLUGIN_HANDLED ZPCN_PLUGIN_HANDLED

/**
 * Returns whether a player is a VIP.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_vip(id)

/**
 * Returns whether a player is a zombie.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_zombie(id)
#define zp_get_user_zombie zpcn_get_user_zombie

/**
 * Returns whether a player is a human.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_human(id)

/**
 * Returns whether a player is a nemesis.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_nemesis(id)
#define zp_get_user_nemesis zpcn_get_user_nemesis

/**
 * Returns whether a player is a assassin.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_assassin(id)

/**
 * Returns whether a player is a survivor.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_survivor(id)
#define zp_get_user_survivor zpcn_get_user_survivor

/**
 * Returns whether a player is a sniper.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_sniper(id)

/**
 * Returns whether a player is the first zombie.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_first_zombie(id)
#define zp_get_user_first_zombie zpcn_get_user_first_zombie

/**
 * Returns whether a player is the last zombie.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_last_zombie(id)
#define zp_get_user_last_zombie zpcn_get_user_last_zombie

/**
 * Returns whether a player is the last human.
 *
 * @param id		Player index.
 * @return		True if it is, false otherwise.
 */
native zpcn_get_user_last_human(id)
#define zp_get_user_last_human zpcn_get_user_last_human

/**
 * Returns a player's current zombie class ID.
 *
 * @param id		Player index.
 * @return		Internal zombie class ID, or -1 if not yet chosen.
 */
native zpcn_get_user_zombie_class(id)
#define zp_get_user_zombie_class zpcn_get_user_zombie_class

/**
 * Returns a player's current human class ID.
 *
 * @param id		Player index.
 * @return		Internal human class ID, or -1 if not yet chosen.
 */
native zpcn_get_user_human_class(id)

/**
 * Returns a player's next zombie class ID (for the next infection).
 *
 * @param id		Player index.
 * @return		Internal zombie class ID, or -1 if not yet chosen.
 */
native zpcn_get_user_next_zclass(id)
#define zp_get_user_next_class zpcn_get_user_next_zclass

/**
 * Returns a player's next human class ID (for the next infection).
 *
 * @param id		Player index.
 * @return		Internal human class ID, or -1 if not yet chosen.
 */
native zpcn_get_user_next_hlass(id)

/**
 * Sets a player's next zombie class ID (for the next infection).
 *
 * @param id		Player index.
 * @param classid	A valid zombie class ID.
 * @return		True on success, false otherwise.
 */
native zpcn_set_user_next_zclass(id, classid)
#define zp_set_user_zombie_class zpcn_set_user_next_zclass

/**
 * Sets a player's next human class ID (for the next spawn or cure).
 *
 * @param id		Player index.
 * @param classid	A valid human class ID.
 * @return		True on success, false otherwise.
 */
native zpcn_set_user_next_hlass(id, classid)

/**
 * Returns a player's ammo pack count.
 *
 * @param id		Player index.
 * @return		Number of ammo packs owned.
 */
native zpcn_get_user_ammo_packs(id)
#define zp_get_user_ammo_packs zpcn_get_user_ammo_packs

/**
 * Sets a player's ammo pack count.
 *
 * @param id		Player index.
 * @param amount	New quantity of ammo packs owned.
 */
native zpcn_set_user_ammo_packs(id, amount)
#define zp_set_user_ammo_packs zpcn_set_user_ammo_packs

/**
 * Returns a player's current knife.
 *
 * Note: Only avaliable to humans.
 *
 * @param id		Player index.
 * @return		Current knife is use.
 */
native zpcn_get_user_knife(id)

/**
 * Returns the default maximum health of a zombie.
 *
 * Note: Takes into account first zombie's HP multiplier.
 *
 * @param id		Player index.
 * @return		Maximum amount of health points, or -1 if not a normal zombie.
 */
native zpcn_get_zombie_maxhealth(id)
#define zp_get_zombie_maxhealth zpcn_get_zombie_maxhealth

/**
 * Returns the default maximum health of a human.
 *
 * @param id		Player index.
 * @return		Maximum amount of health points, or -1 if not a normal human.
 */
native zpcn_get_human_maxhealth(id)

/**
 * Forces a player to become a zombie.
 *
 * Note: Unavailable for last human/survivor/sniper.
 *
 * @param id		Player index to be infected.
 * @param infector	Player index who infected him (optional).
 * @param silent	If set, there will be no HUD messages or infection sounds.
 * @param rewards	Whether to show DeathMsg and reward frags, hp, and ammo packs to infector.
 * @return		True on success, false otherwise.
 */
native zpcn_infect_user(id, infector = 0, silent = 0, rewards = 0)
#define zp_infect_user zpcn_infect_user

/**
 * Forces a player to become a human.
 *
 * Note: Unavailable for last zombie/nemesis/assassin.
 *
 * @param id		Player index to be cured.
 * @param silent	If set, there will be no HUD messages or antidote sounds.
 * @return		True on success, false otherwise.
 */
native zpcn_desinfect_user(id, silent = 0)
#define zp_disinfect_user zpcn_disinfect_user

/**
 * Forces a player to become a nemesis.
 *
 * Note: Unavailable for last human/survivor/sniper.
 *
 * @param id		Player index to turn into nemesis.
 * @return		True on success, false otherwise.
 */
native zpcn_make_user_nemesis(id)
#define zp_make_user_nemesis zpcn_make_user_nemesis

/**
 * Forces a player to become a assassin.
 *
 * Note: Unavailable for last human/survivor/sniper.
 *
 * @param id		Player index to turn into assassin.
 * @return		True on success, false otherwise.
 */
native zpcn_make_user_assassin(id)

/**
 * Forces a player to become a survivor.
 *
 * Note: Unavailable for last zombie/nemesis/assassin.
 *
 * @param id		Player index to turn into survivor.
 * @return		True on success, false otherwise.
 */
native zpcn_make_user_survivor(id)
#define zp_make_user_survivor zpcn_make_user_survivor

/**
 * Forces a player to become a sniper.
 *
 * Note: Unavailable for last zombie/nemesis/assassin.
 *
 * @param id		Player index to turn into sniper.
 * @return		True on success, false otherwise.
 */
native zpcn_make_user_sniper(id)

/**
 * Respawns a player into a specific team.
 *
 * @param id		Player index to be respawned.
 * @return		True on success, false otherwise.
 */
native zpcn_respawn_user(id)
#define zp_respawn_user zpcn_respawn_user

/**
 * Forces a player to buy an extra item.
 *
 * @param id		Player index.
 * @param itemid	A valid extra item ID.
 * @param ignorecost	If set, item's cost won't be deduced from player.
 * @return		True on success, false otherwise.
 */
native zpcn_force_buy_extra_item(id, itemid, ignorecost = 0)
#define zp_force_buy_extra_item zpcn_force_buy_extra_item

/**
 * Forces a player to buy an weapon.
 *
 * @param id		Player index.
 * @param weaponid	A valid weapon ID.
 * @return		True on success, false otherwise.
 */
native zpcn_force_buy_weapon(id, weaponid)

/**
 * Forces a player to buy an knife.
 *
 * @param id		Player index.
 * @param knifeid	A valid knife ID.
 * @return		True on success, false otherwise.
 */
native zpcn_force_buy_knife(id, knifeid)

/**
 * Returns whether the ZP round has started, i.e. first zombie
 * has been chosen or a game mode has begun.
 *
 * @return		0 - Round not started
 *			1 - Round started
 *			2 - Round starting
 */
native zpcn_has_round_started()
#define zp_has_round_started zpcn_has_round_started

/**
 * Returns whether the current round is a nemesis round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_nemesis_round()
#define zp_is_nemesis_round zpcn_is_nemesis_round

/**
 * Returns whether the current round is a assassin round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_assassin_round()

/**
 * Returns whether the current round is a survivor round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_survivor_round()
#define zp_is_survivor_round zpcn_is_survivor_round

/**
 * Returns whether the current round is a sniper round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_sniper_round()

/**
 * Returns whether the current round is a swarm round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_swarm_round()
#define zp_is_swarm_round zpcn_is_swarm_round

/**
 * Returns whether the current round is a plague round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_plague_round()
#define zp_is_plague_round zpcn_is_plague_round

/**
 * Returns whether the current round is a armageddon round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_armageddon_round()

/**
 * Returns whether the current round is a apocalypse round.
 *
 * @return		True if it is, false otherwise.
 */
native zpcn_is_apocalypse_round()

/**
 * Returns number of alive zombies.
 *
 * @return		Zombie count.
 */
native zpcn_get_zombie_count()
#define zp_get_zombie_count zpcn_get_zombie_count

/**
 * Returns number of alive humans.
 *
 * @return		Human count.
 */
native zpcn_get_human_count()
#define zp_get_human_count zpcn_get_human_count

/**
 * Returns number of alive nemesis.
 *
 * @return		Nemesis count.
 */
native zpcn_get_nemesis_count()
#define zp_get_nemesis_count zpcn_get_nemesis_count

/**
 * Returns number of alive assassin.
 *
 * @return		Assassin count.
 */
native zpcn_get_assassin_count()

/**
 * Returns number of alive survivors.
 *
 * @return		Survivor count.
 */
native zpcn_get_survivor_count()
#define zp_get_survivor_count zpcn_get_survivor_count

/**
 * Returns number of alive snipers.
 *
 * @return		Sniper count.
 */
native zpcn_get_sniper_count()

/**
 * Returns ID of current round.
 *
 * @return		Mode ID if round already has started, -1 otherwise.
 */
native zpcn_get_current_round()

/**
 * Force begin of a game mode.
 *
 * @param gamemode	Mode which will start.
 * @param id		Affected player's index (if applicable).
 * @return		True on success, false otherwise.
 */
native zpcn_start_game_mode(gamemode, id)

/**
 * Registers a custom class which will be added to the human classes menu of ZP.
 *
 * Note: The returned human class ID can be later used to identify
 * the class when calling the zpcn_get_user_human_class() natives.
 *
 * @param name		Caption to display on the menu.
 * @param info		Brief description of the class.
 * @param health	Initial health points.
 * @param armor		Initial armor points.
 * @param gravity	Gravity multiplier.
 * @param speed		Maximum speed.
 * @param model		Player model to be used.
 * @param cost		Enable cost. Set "0" to be a free class.
 * @param vip		Allow only for VIP users.
 * @return		An internal human class ID, or -1 on failure.
 */
native zpcn_register_human_class(const name[], const info[], health, armor, Float:gravity, Float:speed, const model[], cost = 0, vip = 0)

/**
 * Registers a custom class which will be added to the zombie classes menu of ZP.
 *
 * Note: The returned zombie class ID can be later used to identify
 * the class when calling the zpcn_get_user_zombie_class() natives.
 *
 * @param name		Caption to display on the menu.
 * @param info		Brief description of the class.
 * @param health	Initial health points.
 * @param gravity	Gravity multiplier.
 * @param speed		Maximum speed.
 * @param claw		Claw model to be used.
 * @param model		Player model to be used.
 * @param cost		Enable cost. Set "0" to be a free class.
 * @param vip		Allow only for VIP users.
 * @return		An internal zombie class ID, or -1 on failure.
 */
native zpcn_register_zombie_class(const name[], const info[], health, Float:gravity, Float:speed, const claw[], const model[], cost = 0, vip = 0)
#define zp_register_zombie_class zpcn_register_zombie_class

/**
 * Registers a custom weapon which will be added to the weapons menu of ZP.
 *
 * @param name		Caption to display on the menu.
 * @param handler	Function to be executed when selected.
 * @param type		Bitsum of type it should be available for (primary or secondary).
 * @param vip		Allow only for VIP users.
 * @return		An internal weapon ID, or -1 on failure.
 */
native zpcn_register_weapon(const name[], const handler[], type, vip = 0)

/**
 * Registers a custom knife which will be added to the knifes menu of ZP.
 *
 * @param name		Caption to display on the menu.
 * @param vmodel	Knife v_ model.
 * @param pmodel	Knife p_ model.
 * @param vip		Allow only for VIP users.
 * @return		An internal knife ID, or -1 on failure.
 */
native zpcn_register_knife(const name[], const vmodel[], const pmodel[], vip = 0)

/**
 * Registers a custom item which will be added to the extra items menu of ZP.
 *
 * @param name		Caption to display on the menu.
 * @param cost		Ammo packs to be deducted on purchase.
 * @param handler	Function to be executed when selected.
 * @param team		Bitsum of team it should be available for.
 * @param limit		Item buy limit for each round.
 * @param vip		Allow only for VIP users.
 * @return		An internal extra item ID, or -1 on failure.
 */
native zpcn_register_extra_item(const name[], cost, const handler[], team, limit = 0, vip = 0)

/**
 * Registers a custom game mode which will be added to the game.
 *
 * @param name			Caption to display on the menu.
 * @param handler		Function to be executed when started.
 * @param enable		Enable custom game mode.
 * @param chance		Custom game mode chance (1 in x).
 * @param minplayers	Custom game mode minimum players.
 * @param infection		Allow infection from zombies.
 * @param extraitems	Allow extra items menu.
 * @param respawn		Allow automatically respawn.
 * @param flags			Access flags to start game mode (admin menu).
 * @return		An internal game mode ID, or -1 on failure.
 */
native zpcn_register_game_mode(const name[], const handler[], enable, chance, minplayers, infection = 0, extraitems = 0, respawn = 1, const flags[]="d")

/**
 * Registers a custom game mode which will be added to the game.
 *
 * @param modeid		An internal game mode ID.
 * @param sound			Sound to be executed when mode start.
 * @param ambience		Round ambience sound name.
 * @param enable		Enable round ambience sound.
 * @param duration		Ambience sound duration.
 * @return		True on success, or false on failure.
 */
native zpcn_register_mode_sounds(modeid, const sound[], const ambience[], enable, duration)

/**
 * Returns an weapon's ID.
 *
 * @param name		Weapon name to look for.
 * @return		Internal weapon ID, or -1 if not found.
 */
native zpcn_get_weapon_id(const name[])

/**
 * Returns an extra item's ID.
 *
 * @param name		Item name to look for.
 * @return		Internal extra item ID, or -1 if not found.
 */
native zpcn_get_extra_item_id(const name[])
#define zp_get_extra_item_id zpcn_get_extra_item_id

/**
 * Returns an knife's ID.
 *
 * @param name		Knife name to look for.
 * @return		Internal knife ID, or -1 if not found.
 */
native zpcn_get_knife_id(const name[])

/**
 * Returns a zombie class' ID.
 *
 * @param name		Class name to look for.
 * @return		Internal zombie class ID, or -1 if not found.
 */
native zpcn_get_zombie_class_id(const name[])
#define zp_get_zombie_class_id zpcn_get_zombie_class_id

/**
 * Returns a human class' ID.
 *
 * @param name		Class name to look for.
 * @return		Internal human class ID, or -1 if not found.
 */
native zpcn_get_human_classe_id(const name[])

/**
 * Called when the ZP round starts, i.e. first zombie
 * is chosen or a game mode begins.
 *
 * @param gamemode	Mode which has started.
 * @param id		Affected player's index (if applicable).
 */
forward zpcn_round_started(gamemode, id)
#define zp_round_started zpcn_round_started

/**
 * Called when the round ends.
 *
 * @param winteam	Team which has won the round.
 */
forward zpcn_round_ended(winteam)
#define zp_round_ended zpcn_round_ended

/**
 * Called when a player gets infected.
 *
 * @param id		Player index who was infected.
 * @param infector	Player index who infected him (if applicable).
 * @param nemesis	Whether the player was turned into a nemesis.
 * @param assassin	Whether the player was turned into a assassin.
 */
forward zpcn_user_infected_pre(id, infector, nemesis, assassin)
forward zpcn_user_infected_post(id, infector, nemesis, assassin)
#define zp_user_infected_pre zpcn_user_infected_pre
#define zp_user_infected_post zpcn_user_infected_post

/**
 * Called when a player turns back to human.
 *
 * @param id		Player index who was cured.
 * @param survivor	Whether the player was turned into a survivor.
 * @param sniper	Whether the player was turned into a sniper.
 */
forward zpcn_user_humanized_pre(id, survivor, sniper)
forward zpcn_user_humanized_post(id, survivor, sniper)
#define zp_user_humanized_pre zpcn_user_humanized_pre
#define zp_user_humanized_post zpcn_user_humanized_post

/**
 * Called on a player infect/cure attempt. You can use this to block
 * an infection/humanization by returning ZPCN_PLUGIN_HANDLED in your plugin.
 *
 * Note: Right now this is only available after the ZP round starts, since some
 * situations (like blocking a first zombie's infection) are not yet handled.
 */
forward zpcn_user_infect_attempt(id, infector, nemesis, assassin)
forward zpcn_user_humanize_attempt(id, survivor, sniper)
#define zp_user_infect_attempt zpcn_user_infect_attempt
#define zp_user_humanize_attempt zpcn_user_humanize_attempt

/**
 * Called when a player gets unfrozen (frostnades).
 *
 * @param id		Player index.
 */
forward zpcn_user_unfrozen(id)
#define zp_user_unfrozen zpcn_user_unfrozen

/**
 * Called when a player becomes the last zombie.
 *
 * Note: This is called for the first zombie too.
 *
 * @param id		Player index.
 */
forward zpcn_user_last_zombie(id)
#define zp_user_last_zombie zpcn_user_last_zombie

/**
 * Called when a player becomes the last human.
 *
 * @param id		Player index.
 */
forward zpcn_user_last_human(id)
#define zp_user_last_human zpcn_user_last_human
Иначе самият автор каза, че модът е бъгав, тъй че не ти препоръчвам да го ползваш.

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Bing [Bot], Google [Bot] и 16 госта