Sprawdź
/*================================================================================
----------------------------------
-*- [ZP] Class: Human: Classic -*-
----------------------------------
This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
================================================================================*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <zp50_class_human>
#include <zp50_class_survivor>
#include <zp50_core>
#include <zp50_class_zombie>
#include <zp50_colorchat>
new jumpznum[33] = 0
new bool:dozjump[33] = false
new cvar_jumps
// Classic Human Attributes
new const humanclass1_name[] = ""
new const humanclass1_info[] = ""
new const humanclass1_models[][] = { "" }
const humanclass1_health = 150
const Float:humanclass1_speed = 1.02
const Float:humanclass1_gravity = 0.9
new g_HumanClassID
public plugin_precache()
{
register_plugin("[ZP] Klasa: Human: PredanVIP", ZP_VERSION_STRING, "ZP Dev Team")
g_HumanClassID = zp_class_human_register(humanclass1_name, humanclass1_info, humanclass1_health, humanclass1_speed, humanclass1_gravity)
new index
for (index = 0; index < sizeof humanclass1_models; index++)
zp_class_human_register_model(g_HumanClassID, humanclass1_models[index])
}
public plugin_init()
{
cvar_jumps = register_cvar("zp_premium_jump","1")
}
public zp_fw_class_human_select_pre(id, classid)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H) && classid == g_HumanClassID)
{
return ZP_CLASS_NOT_AVAILABLE;
}
return ZP_CLASS_AVAILABLE;
}
public client_putinserver(id)
{
jumpznum[id] = 0
dozjump[id] = false
}
public client_disconnect(id)
{
jumpznum[id] = 0
dozjump[id] = false
}
public client_PreThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(zp_core_is_zombie(id) || zp_class_human_get_current(id) != g_HumanClassID || zp_class_survivor_get(id))
return PLUGIN_CONTINUE
new nzbut = get_user_button(id)
new ozbut = get_user_oldbutton(id)
if((nzbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(ozbut & IN_JUMP))
{
if (jumpznum[id] < get_pcvar_num(cvar_jumps))
{
dozjump[id] = true
jumpznum[id]++
return PLUGIN_CONTINUE
}
}
if((nzbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpznum[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(zp_core_is_zombie(id) || zp_class_human_get_current(id) != g_HumanClassID) return PLUGIN_CONTINUE
if(dozjump[id] == true)
{
new Float:vezlocityz[3]
entity_get_vector(id,EV_VEC_velocity,vezlocityz)
vezlocityz[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,vezlocityz)
dozjump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}