#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>
#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "Demon"
#define JOG ADMIN_LEVEL_H
#define MAX_HP 130
#define HS 25
#define KILL 15
new bool:dojump[33] = false
new jumpnum[33] = 0
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "HSpawn", 1);
register_event("ResetHUD", "resetModel", "b")
}
public plugin_precache() {
precache_model("models/player/vip_ct/vip_ct.mdl")
precache_model("models/player/vip_te/vip_te.mdl")
return PLUGIN_CONTINUE
}
public resetModel(id, level, cid) {
if (get_user_flags(id) & JOG) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "vip_te")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "vip_ct")
}
else {
cs_reset_user_model(id)
}
}
return PLUGIN_CONTINUE
}
public client_death(killer, victim, wpnid, hitplace, TK)
{
if(!TK && (get_user_flags(killer) & JOG))
{
if(hitplace != HIT_HEAD)
{
if(get_user_health(killer)<=MAX_HP-HS)
set_user_health(killer, get_user_health(killer) +HS);
}
else
{
if(get_user_health(killer)<=MAX_HP-KILL)
set_user_health(killer, get_user_health(killer) +KILL);
}
}
}
public HSpawn(id){
if(get_user_flags(id) & JOG)
set_user_health(id, MAX_HP);
}
public client_putinserver(id)
{
jumpnum[id] = 0
dojump[id] = false
}
public client_disconnect(id)
{
jumpnum[id] = 0
dojump[id] = false
}
public client_PreThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(!(get_user_flags(id) & JOG)) return PLUGIN_CONTINUE
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] < 2)
{
dojump[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)) return PLUGIN_CONTINUE
if(dojump[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)
dojump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}