Post by newandclueless on May 7, 2016 12:12:05 GMT
May 7, 2016 1:29:56 GMT zmd94 said:
Just use public zp_user_infected_pre(id) if it can fix the problem and do not cause any other problem.Then, for problem 9 related to jumper zombie, just try below 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_super_jumper_zombie_maxjumps "50" - How much you 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.
18/07/2009 - v1.2.4 - changed zombie and plugin name, fixed none working cvar, fixed now jumps are limited per round, added chat message how much jumps you have left, added chat message if this class is for admins only, dropped engine and using fakemeta instead.
*/
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <zombieplague>
#define PLUGIN "[ZP] Class : Super Jumper Zombie"
#define VERSION "1.2.4"
#define AUTHOR "Fry!"
#define ADMINACCESS ADMIN_LEVEL_H
//#define FOR_ADMINS
#if defined FOR_ADMINS
#define ADMINACCESS ADMIN_LEVEL_H
#endif
new const zclass_name[] = "Hacker Jumper"
new const zclass_info[] = "40 Jumps every round"
new const zclass_model[] = "zm_hacker_scream"
new const zclass_clawmodel[] = "v_hands_hacker_scream.mdl"
const zclass_health = 2200
const zclass_speed = 250
const Float:zclass_gravity = 0.90
const Float:zclass_knockback = 0.20
new Jumpnum[33] = false
new MaxJump[33]
new bool:canJump[33] = false
new g_zclass_super_jumper, g_super_jumper_maxjumps
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("zp_zclass_mega_jumper_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
g_super_jumper_maxjumps = register_cvar("zp_super_jumper_zombie_maxjumps", "40")
register_forward(FM_PlayerPreThink, "fm_PlayerPreThink")
register_forward(FM_PlayerPostThink, "fm_PlayerPostThink")
}
public plugin_precache()
{
g_zclass_super_jumper = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_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_zclass_super_jumper)
{
if(get_user_flags(player) & ADMINACCESS)
{
MaxJump[player] = get_pcvar_num(g_super_jumper_maxjumps) + 3
}
else
{
MaxJump[player] = get_pcvar_num(g_super_jumper_maxjumps)
}
canJump[player] = true
Jumpnum[player] = true
}
}
public fm_PlayerPreThink(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return FMRES_IGNORED
if (zp_get_user_zombie_class(id) != g_zclass_super_jumper)
return FMRES_IGNORED
#if defined FOR_ADMINS
if ( !( get_user_flags(id) & ADMINACCESS) )
{
client_print(id, print_chat, "[Hacker ZM] VIP only.")
return FMRES_IGNORED
}
#endif
new nbut = pev(id, pev_button)
new obut = pev(id, pev_oldbuttons)
if ((nbut & IN_JUMP) && !(pev(id, pev_flags) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if (Jumpnum[id] < MaxJump[player])
{
canJump[id] = true
Jumpnum[id]++
client_print(id, print_chat, "[Hacker ZM] %d of %d jumps done", Jumpnum[id], get_pcvar_num(g_super_jumper_maxjumps))
}
else
{
client_print(id, print_chat, "[Hacker ZM] That's it, you're done, smoking and relaxing time now.")
}
}
else if ((nbut & IN_JUMP) && !(pev(id, pev_flags) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if (Jumpnum[id] == MaxJump[player] || (nbut & IN_JUMP))
{
canJump[id] = false
Jumpnum[id] = false
}
}
return FMRES_IGNORED
}
public fm_PlayerPostThink(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return FMRES_IGNORED
if (zp_get_user_zombie_class(id) != g_zclass_super_jumper)
return FMRES_IGNORED
#if defined FOR_ADMINS
if ( !( pev(id, pev_flags) & ADMINACCESS) )
{
client_print(id, print_chat, "[Hacker ZM] VIP only.")
return FMRES_IGNORED
}
#endif
if (canJump[id] == true)
{
new Float:velocity[3]
pev(id, pev_velocity, velocity)
velocity[2] = random_float(265.0,285.0)
set_pev(id, pev_velocity, velocity)
canJump[id] = false
return FMRES_IGNORED
}
return FMRES_IGNORED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
[/spoiler]
//// zp_zclass_zombie_hackjumper.sma
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmod
x\scripting\zp_zclass_zombie_hackjumper.sma(262) : error 017: undefined symbol "
player"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmod
x\scripting\zp_zclass_zombie_hackjumper.sma(290) : error 017: undefined symbol "
player"
//
// 2 Errors.
// Could not locate output file compiled\zp_zclass_zombie_hackjumper.amx (compil
e failed).
//
// Compilation Time: 0.19 sec
// ----------------------------------------