Is it possible to limit a zombie class that can be picked per round? for example this zombie class:
Spoiler
Code:
/*===================================================================================
/
/
/ [ZP] Class : Mega Jumper Zombie
/ (new zombie class)
/
/ by Fry
/
/
/ Description :
/
/ This is new zombie class but this zombie can Jump very high even on the highest building, however jumps are limited so use them wisely.
/
/
/ Note :
/
/ If you want to use this class for admins only comment out this //#define FOR_ADMINS
/
/
/
/ Cvars :
/
/ zp_maxjumps "50" - How much can jump per round.
/
/
/
/ Credits :
/
/ twistedeuphoria - for his Multi Jump plugin
/
/
/
/ Changelog :
/
/ 10/10/2008 - v1.0 - First test
/ 17/10/2008 - v1.1 - fixed that jumps worked only once in round, rewrited half of code, removed unnecessary code/lines, changed plugin and zombie name. ^^
/ 06/11/2008 - v1.1.2 - fixed bug that mega jump works for all zombie classes, changed plugin name.
/ 07/11/2008 - v1.1.3 - fixed last bug that jumps work for humans not for zombie class.
/ 26/12/2008 - v1.1.6 - removed chat message, fixed admin acces... Admins with flag A can use it already, fixed plugin crash.
/ 27/12/2008 - v1.1.8 - fixed my mistake that this zombie was only for admins, added simple way to use it for admins just comment out #define FOR_ADMINS.
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <zombieplague>
#define PLUGIN "[ZP] Class : Mega Jumper Zombie"
#define VERSION "1.1.8"
#define AUTHOR "The_Thing aka Fry"
/*=============================================*/
/* */
/*=============================================*/
//#define FOR_ADMINS
#if defined FOR_ADMINS
#define ADMINACCESS ADMIN_LEVEL_A
#endif
new Jumpnum[33] = false
new bool:canJump[33] = false
/*=============================================*/
/* Cvars */
/*=============================================*/
new g_maxjumps
/*=============================================*/
/* Zombie Attributes */
/*=============================================*/
new const zclass7_name[] = { "Mega Jumper" }
new const zclass7_info[] = { "Have 50 MultiJumpīs/Round" }
new const zclass7_model[] = { "zombie_source" }
new const zclass7_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass7_health = 2000
const zclass7_speed = 195
const Float:zclass7_gravity = 1.0
const Float:zclass7_knockback = 1.0
new g_zclass7_mega
public plugin_precache()
{
register_cvar("zp_zclass_mega_jumper_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
g_maxjumps = register_cvar("zp_zombie_maxjumps", "50")
g_zclass7_mega = zp_register_zombie_class(zclass7_name,zclass7_info,zclass7_model,zclass7_clawmodel,zclass7_health,zclass7_speed,zclass7_gravity,zclass7_knockback)
}
public client_putinserver(id)
{
Jumpnum[id] = 0
canJump[id] = false
}
public client_disconnect(id)
{
Jumpnum[id] = 0
canJump[id] = false
}
public zp_user_infected_post(player, infector)
{
if (zp_get_user_zombie_class(player) == g_zclass7_mega)
{
canJump[player] = true
Jumpnum[player] = true
}
}
public client_PreThink(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return PLUGIN_CONTINUE
if (zp_get_user_zombie_class(id) != g_zclass7_mega)
return PLUGIN_CONTINUE
#if defined FOR_ADMINS
if( !( get_user_flags(id) & ADMINACCESS) )
return PLUGIN_CONTINUE
#endif
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if (( nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if (Jumpnum[id] < get_pcvar_num(g_maxjumps))
{
canJump[id] = true
Jumpnum[id]++
return PLUGIN_CONTINUE
}
}
if ((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
Jumpnum[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return PLUGIN_CONTINUE
if (zp_get_user_zombie_class(id) != g_zclass7_mega)
return PLUGIN_CONTINUE
#if defined FOR_ADMINS
if( !( get_user_flags(id) & ADMINACCESS) )
return PLUGIN_CONTINUE
#endif
if (canJump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity)
canJump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
Spoiler
Code:
/*===================================================================================
/
/
/ [ZP] Class : Mega Jumper Zombie
/ (new zombie class)
/
/ by Fry
/
/
/ Description :
/
/ This is new zombie class but this zombie can Jump very high even on the highest building, however jumps are limited so use them wisely.
/
/
/ Note :
/
/ If you want to use this class for admins only comment out this //#define FOR_ADMINS
/
/
/
/ Cvars :
/
/ zp_maxjumps "50" - How much can jump per round.
/
/
/
/ Credits :
/
/ twistedeuphoria - for his Multi Jump plugin
/
/
/
/ Changelog :
/
/ 10/10/2008 - v1.0 - First test
/ 17/10/2008 - v1.1 - fixed that jumps worked only once in round, rewrited half of code, removed unnecessary code/lines, changed plugin and zombie name. ^^
/ 06/11/2008 - v1.1.2 - fixed bug that mega jump works for all zombie classes, changed plugin name.
/ 07/11/2008 - v1.1.3 - fixed last bug that jumps work for humans not for zombie class.
/ 26/12/2008 - v1.1.6 - removed chat message, fixed admin acces... Admins with flag A can use it already, fixed plugin crash.
/ 27/12/2008 - v1.1.8 - fixed my mistake that this zombie was only for admins, added simple way to use it for admins just comment out #define FOR_ADMINS.
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <zombieplague>
#define PLUGIN "[ZP] Class : Mega Jumper Zombie"
#define VERSION "1.1.8"
#define AUTHOR "The_Thing aka Fry"
/*=============================================*/
/* */
/*=============================================*/
//#define FOR_ADMINS
#if defined FOR_ADMINS
#define ADMINACCESS ADMIN_LEVEL_A
#endif
new Jumpnum[33] = false
new bool:canJump[33] = false
/*=============================================*/
/* Cvars */
/*=============================================*/
new g_maxjumps
/*=============================================*/
/* Zombie Attributes */
/*=============================================*/
new const zclass7_name[] = { "Mega Jumper" }
new const zclass7_info[] = { "Have 50 MultiJumpīs/Round" }
new const zclass7_model[] = { "zombie_source" }
new const zclass7_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass7_health = 2000
const zclass7_speed = 195
const Float:zclass7_gravity = 1.0
const Float:zclass7_knockback = 1.0
new g_zclass7_mega
public plugin_precache()
{
register_cvar("zp_zclass_mega_jumper_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
g_maxjumps = register_cvar("zp_zombie_maxjumps", "50")
g_zclass7_mega = zp_register_zombie_class(zclass7_name,zclass7_info,zclass7_model,zclass7_clawmodel,zclass7_health,zclass7_speed,zclass7_gravity,zclass7_knockback)
}
public client_putinserver(id)
{
Jumpnum[id] = 0
canJump[id] = false
}
public client_disconnect(id)
{
Jumpnum[id] = 0
canJump[id] = false
}
public zp_user_infected_post(player, infector)
{
if (zp_get_user_zombie_class(player) == g_zclass7_mega)
{
canJump[player] = true
Jumpnum[player] = true
}
}
public client_PreThink(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return PLUGIN_CONTINUE
if (zp_get_user_zombie_class(id) != g_zclass7_mega)
return PLUGIN_CONTINUE
#if defined FOR_ADMINS
if( !( get_user_flags(id) & ADMINACCESS) )
return PLUGIN_CONTINUE
#endif
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if (( nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if (Jumpnum[id] < get_pcvar_num(g_maxjumps))
{
canJump[id] = true
Jumpnum[id]++
return PLUGIN_CONTINUE
}
}
if ((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
Jumpnum[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return PLUGIN_CONTINUE
if (zp_get_user_zombie_class(id) != g_zclass7_mega)
return PLUGIN_CONTINUE
#if defined FOR_ADMINS
if( !( get_user_flags(id) & ADMINACCESS) )
return PLUGIN_CONTINUE
#endif
if (canJump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity)
canJump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
it is just way too powerful if everyone can pick it, but if only for example 1 person can pick it then its a little better, if its too much hard work is it possible to make it for admin only with flag u? or maybe even a plugin for zp43 that is a class limiter (which i know is alot of work)
can you make this for admin only? i'd like it for flag 'u' thanks!
hmm, in this case i recommend to look through code ZPS, there is extra items restriction, you could look how it's made and try to do the same but for your zp 4.3, for zombie classes