/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#include <engine>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "appLy"
#define VIP_FLAG ADMIN_LEVEL_H
#define FALL_VELOCITY 350.0
new jumpnum[33] = 0
new bool:dojump[33] = false
new bool:falling[33];
new g_type, g_enabled, g_recieved, bool:g_showrecieved, g_hudmsg1, g_hudmsg2, vip_MsgSync, award_hp, award_hp2
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
register_event("HLTV", "on_new_round", "a", "1=0", "2=0")
RegisterHam( Ham_Spawn, "player", "ham_SpawnPlayerPost", true );
register_cvar("vip_maxjumps","2") // 0 + numar = jumps , ex 0+2 = max 2 jump
g_type = register_cvar("vip_bulletdamage","1")
g_recieved = register_cvar("vip_bulletdamage_recieved","1")
register_event("DeathMsg" , "event_DeathMsg" , "a" , "1>0" , "2>0");
register_cvar("vip_award","1")
register_cvar("vip_award_hp","25") // head kill
register_cvar("vip_award_hp2","10") // body kill
register_cvar("vip_award_show","1")
vip_MsgSync = CreateHudSyncObj()
g_hudmsg1 = CreateHudSyncObj()
g_hudmsg2 = CreateHudSyncObj()
}
public on_new_round()
{
g_enabled = get_pcvar_num(g_type)
if(get_pcvar_num(g_recieved)) g_showrecieved = true
}
public on_damage(id)
{
if(g_enabled && get_user_flags(id) & VIP_FLAG)
{
static attacker; attacker = get_user_attacker(id)
static damage; damage = read_data(2)
if(g_showrecieved)
{
set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(id, g_hudmsg2, "%i^n", damage)
}
if(is_user_connected(attacker))
{
switch(g_enabled)
{
case 1: {
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)
}
case 2: {
if(fm_is_ent_visible(attacker,id))
{
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(attacker, g_hudmsg1, "%i^n", damage)
}
}
}
}
}
}
public ham_SpawnPlayerPost( id ) {
if( is_user_alive( id ) && get_user_flags(id) & VIP_FLAG )
set_user_health( id, 120 );
set_user_footsteps(id, 1);
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_deagle")
give_item(id,"weapon_awp")
set_task(0.8, "iScoreBoard", id + 6969)
}
public iScoreBoard(tID) {
new id = tID - 6969
message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
write_byte(id)
write_byte(4)
message_end()
}
public event_DeathMsg()
{
if(!get_cvar_num("vip_award"))
return PLUGIN_HANDLED
new id = read_data(1)
new bool:killhead = bool:read_data(3)
new player_hp = get_user_health(id)
award_hp = get_cvar_num("vip_award_hp")
award_hp2 = get_cvar_num("vip_award_hp2")
if((killhead) && (award_hp>0) && (is_user_alive(id))) // head kill
{
if((player_hp + award_hp) > 150)
set_user_health(id , 150)
else
set_user_health(id , player_hp+award_hp)
if(get_cvar_num("vip_award_show"))
{
set_hudmessage(0, 255, 0, 0.01, 0.90, 0, 0.2, 0.2, 0.025, 0.02, -1)
ShowSyncHudMsg(id, vip_MsgSync, "+%i^n", award_hp)
}
}
if((!killhead) && (award_hp2>0) && (is_user_alive(id)))// body kill
{
if((player_hp + award_hp2) > 150)
set_user_health(id , 150)
else
set_user_health(id , player_hp + award_hp2)
if(get_cvar_num("vip_award_show"))
{
set_hudmessage(0, 255, 0, 0.01, 0.90, 0, 0.2, 0.2, 0.025, 0.02, -1)
ShowSyncHudMsg(id, vip_MsgSync, "+%i^n", award_hp2)
}
}
return PLUGIN_CONTINUE
}
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) && !(get_user_flags(id) & ADMIN_LEVEL_H)) return PLUGIN_CONTINUE
if(is_user_alive(id) && get_user_flags(id) & VIP_FLAG){
if(entity_get_float(id, EV_FL_flFallVelocity) >= FALL_VELOCITY) {
falling[id] = true;
} else {
falling[id] = false;
}
}
if(!(get_user_flags(id) & ADMIN_LEVEL_H)) return PLUGIN_CONTINUE
if(get_user_flags(id) & VIP_FLAG){
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_cvar_num("vip_maxjumps"))
{
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( !(get_user_flags(id) & ADMIN_LEVEL_H) )
if(!is_user_alive(id) && !(get_user_flags(id) & ADMIN_LEVEL_H)) return PLUGIN_CONTINUE
if(is_user_alive(id) && get_user_flags(id) & VIP_FLAG ){
if(falling[id]) {
entity_set_int(id, EV_INT_watertype, -3);
}
}
if(!(get_user_flags(id) & ADMIN_LEVEL_H)) return PLUGIN_CONTINUE
if(get_user_flags(id) & VIP_FLAG){
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
}