PDA

View Full Version : How to add ZP class to BB classes?


Wats0N
01-03-2017, 14:32
Hello!

How to add ZP class plugin to BaseBuilder classes?

/*
Wallclimb v1.0f by Python1320
Plagued Version 0.22 by Dabbi

Allows Poison Zombie to Climb Walls in Zombie Plague [3.62]

CVARS: zp_wallclimb 0 = Off / 1 = Hold USE / 2 = Hold JUMP and DUCK (Default 1)
zp_wallclimb_nemesis 0 = Disable wallclimb during nemesis round. / 1 = Enable (Default 1)
zp_wallclimb_survivor 0 = Disable wallclimb during survivor round. / 1 = Enable (Default 0)

Changes:
0.22
Made the function wallclimb return a value.
Put plugin version to a cvar.
0.21
Added cvars to enable disable wallclimb durin survivor/nemesis round
0.2
Added cvar to enable / disable Walllclimb Plugin
0.1
First release.
*/

#include <amxmodx>
// #include <engine>
#include <fakemeta>

#include <cstrike>
#include <zombieplague.inc>

//#include <fakemeta_util>
#define STR_T 33

// Stuff taken from fakemeta_util
#define fm_get_user_button(%1) pev(%1, pev_button)
/* stock fm_get_user_button(index)
return pev(index, pev_button) */

#define fm_get_entity_flags(%1) pev(%1, pev_flags)
/* stock fm_get_entity_flags(index)
return pev(index, pev_flags) */

stock fm_set_user_velocity(entity, const Float:vector[3]) {
set_pev(entity, pev_velocity, vector);

return 1;
}
//End of stuff from fakemeta_util
//new STR_T[32]
new bool:g_WallClimb[33]
new Float:g_wallorigin[32][3]
new cvar_zp_wallclimb, cvar_zp_wallclimb_nemesis, cvar_zp_wallclimb_survivor
new g_zclass_climb

// Climb Zombie Atributes
new const zclass_name[] = { "climb Zombi" } // name
new const zclass_info[] = { "HP- speed+ jump+ Visszalokes+" } // description
new const zclass_model[] = { "zombie_source" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 2500 // health
const zclass_speed = 250 // speed
const Float:zclass_gravity = 0.75 // gravity
const Float:zclass_knockback = 1.25 // knockback

public plugin_init()
{
register_plugin("[ZP] Wallclimb ", "1.0", "WallClimb by Python1320/Cheap_Suit, Plagued by Dabbi")
register_forward(FM_Touch, "fwd_touch")
register_forward(FM_PlayerPreThink, "fwd_playerprethink")
//register_forward(FM_PlayerPostThink, "fwd_playerpostthink")
register_event("DeathMsg","EventDeathMsg","a")
//register_cvar("zp_wallclimb_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
cvar_zp_wallclimb = register_cvar("zp_wallclimb", "1")
cvar_zp_wallclimb_survivor = register_cvar("zp_wallclimb_survivor", "0")
cvar_zp_wallclimb_nemesis = register_cvar("zp_wallclimb_nemesis", "1")

}

public plugin_precache()
{
g_zclass_climb = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}

public EventDeathMsg()
{
new id = read_data(2)
g_WallClimb[id] = true
return PLUGIN_HANDLED
}

public client_connect(id) {
g_WallClimb[id] = true
}

public fwd_touch(id, world)
{
if(!is_user_alive(id) || !g_WallClimb[id] || !pev_valid(id))
return FMRES_IGNORED

new player = STR_T
if (!player)
return FMRES_IGNORED

new classname[STR_T]
pev(world, pev_classname, classname, (STR_T))

if(equal(classname, "worldspawn") || equal(classname, "func_wall") || equal(classname, "func_breakable"))
pev(id, pev_origin, g_wallorigin[id])

return FMRES_IGNORED
}

public wallclimb(id, button)
{
static Float:origin[3]
pev(id, pev_origin, origin)

if(get_distance_f(origin, g_wallorigin[id]) > 25.0)
return FMRES_IGNORED // if not near wall

if(fm_get_entity_flags(id) & FL_ONGROUND)
return FMRES_IGNORED

if(button & IN_FORWARD)
{
static Float:velocity[3]
velocity_by_aim(id, 120, velocity)
fm_set_user_velocity(id, velocity)
}
else if(button & IN_BACK)
{
static Float:velocity[3]
velocity_by_aim(id, -120, velocity)
fm_set_user_velocity(id, velocity)
}
return FMRES_IGNORED
}

public fwd_playerprethink(id)
{
if(!g_WallClimb[id] || !zp_get_user_zombie(id))
return FMRES_IGNORED

if(zp_is_survivor_round() && get_pcvar_num(cvar_zp_wallclimb_survivor) == 0)
return FMRES_IGNORED

if(zp_is_nemesis_round() && get_pcvar_num(cvar_zp_wallclimb_nemesis) == 0)
return FMRES_IGNORED

new button = fm_get_user_button(id)

if((get_pcvar_num(cvar_zp_wallclimb) == 1) && (button & IN_USE) && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Use button = climb
wallclimb(id, button)
else if((get_pcvar_num(cvar_zp_wallclimb) == 2) && (button & IN_JUMP) && button & IN_DUCK && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Jump + Duck = climb
wallclimb(id, button)

return FMRES_IGNORED
}


how to add to this?


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

-----------------------------------
-*- [BB] Default Zombie Classes -*-
-----------------------------------

~~~~~~~~~~~~~~~
- Description -
~~~~~~~~~~~~~~~

This plugin adds the default zombie classes from Zombie Plague
into Base Builder. All credit belongs to MeRcyLeZZ.

All classes have been balanced, but feel free to edit them if
you are not satisfied.

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

#include <amxmodx>
#include <basebuilder>
#include <hamsandwich>
#include <fun>
#include <cstrike>

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

// Classic Zombie Attributes
new const zclass1_name[] = { "Klasszikus Zombi" }
new const zclass1_info[] = { "[alap]" }
new const zclass1_model[] = { "bb_classic" }
new const zclass1_clawmodel[] = { "v_bloodyhands" }
const zclass1_health = 3000
const zclass1_speed = 260
const Float:zclass1_gravity = 1.0
const zclass1_adminflags = ADMIN_ALL

// Fast Zombie Attributes
new const zclass2_name[] = { "Gyors Zombi" }
new const zclass2_info[] = { "" }
new const zclass2_model[] = { "bb_fast" }
new const zclass2_clawmodel[] = { "v_bloodyhands" }
const zclass2_health = 2000
const zclass2_speed = 325
const Float:zclass2_gravity = 1.0
const zclass2_adminflags = ADMIN_ALL

// Jumper Zombie Attributes
new const zclass3_name[] = { "Ugró Zombi" }
new const zclass3_info[] = { "" }
new const zclass3_model[] = { "bb_jumper" }
new const zclass3_clawmodel[] = { "v_bloodyhands" }
const zclass3_health = 2500
const zclass3_speed = 285
const Float:zclass3_gravity = 0.5
const zclass3_adminflags = ADMIN_ALL

// Tanker Zombie Attributes
new const zclass4_name[] = { "Tank Zombi" }
new const zclass4_info[] = { "" }
new const zclass4_model[] = { "bb_tanker" }
new const zclass4_clawmodel[] = { "v_bloodyhands" }
const zclass4_health = 4000
const zclass4_speed = 210
const Float:zclass4_gravity = 1.0
const zclass4_adminflags = ADMIN_ALL
#define TANK_ARMOR 200

// EZ A TULAJ ZOMBI
new const zclass5_name[] = { "Creadz Zombi" } ////Na ide a nevét kell , amit majd a menübe látni fogunk
new const zclass5_info[] = { "[Tulaj]" } ///Ide meg az INFO-t amit a menübe neve mellet látni fogunk.
new const zclass5_model[] = { "bb_creadz" } /// ide a model nevét ami majd beolvas a szerver
new const zclass5_clawmodel[] = { "v_bloodyhands" } ///ide meg a kéz modelt amit szintén beolvassa szeró.
const zclass5_health = 15000 ////Ide az életét (HP-ját) írjuk be
const zclass5_speed = 250 ///Ide a gyorsaságát hogy milyen gyors legyen.
const Float:zclass5_gravity = 1.0 /// Itt meg a gravitációját tudjuk állítani.
const zclass5_adminflags = ADMIN_RCON // itt meg hogy milyen JOG tudja használni ha ADMIN_ALL írtok akkor mindenki használhatja.

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

new g_zclass_tanker

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
register_plugin("[BB] Default Zombie Classes", "6.5", "Tirant")

// Register all classes
bb_register_zombie_class(zclass1_name, zclass1_info, zclass1_model, zclass1_clawmodel, zclass1_health, zclass1_speed, zclass1_gravity, 0.0, zclass1_adminflags)
bb_register_zombie_class(zclass2_name, zclass2_info, zclass2_model, zclass2_clawmodel, zclass2_health, zclass2_speed, zclass2_gravity, 0.0, zclass2_adminflags)
bb_register_zombie_class(zclass3_name, zclass3_info, zclass3_model, zclass3_clawmodel, zclass3_health, zclass3_speed, zclass3_gravity, 0.0, zclass3_adminflags)
g_zclass_tanker = bb_register_zombie_class(zclass4_name, zclass4_info, zclass4_model, zclass4_clawmodel, zclass4_health, zclass4_speed, zclass4_gravity, 0.0, zclass4_adminflags)
bb_register_zombie_class(zclass5_name, zclass5_info, zclass5_model, zclass5_clawmodel, zclass5_health, zclass5_speed, zclass5_gravity, 0.0, zclass5_adminflags)
}

#if defined TANK_ARMOR
public plugin_init()
{
RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn_Post", 1)
}

public ham_PlayerSpawn_Post(id)
{
if (!is_user_alive(id))
return ;

if (bb_is_user_zombie(id) && bb_get_user_zombie_class(id) == g_zclass_tanker)
{
give_item(id, "item_assaultsuit");
cs_set_user_armor(id, TANK_ARMOR, CS_ARMOR_VESTHELM);
}
}
#endif

Relaxing
01-03-2017, 15:08
You have to use your brain, just copy the required information that zombies need and paste into the Basebuilder zombies.

Wats0N
01-04-2017, 12:18
You have to use your brain, just copy the required information that zombies need and paste into the Basebuilder zombies.


I do not understand it, how to.. :/

OciXCrom
01-04-2017, 13:21
Then don't ask how to do it, ask someone to do it.

Wats0N
01-04-2017, 13:40
Then don't ask how to do it, ask someone to do it.

I ask here.. pls