#include < amxmodx >
#include < hamsandwich >
#include <
cstrike >
#include < fun >
#include < fakemeta >
#include < engine >
#include < amxmisc >
#pragma tabsize 0
#define VIP_USER ADMIN_MAP
#define PLUGIN "Vip Clasic"
#define VERSION "1.0"
new maxplayers
new round;
new gMoneyToGivePerDamage,money_kill,hp_kill_hs,money_kill_hs;
new jumpnum[33] = 0
new bool:dojump[33] = false
new bool:has_parachute[33]
new para_ent[33]
new pDetach, pFallSpeed
public plugin_init( )
{
register_plugin( PLUGIN, VERSION, "D3luxe" );
register_clcmd("say /vips", "ShowVipsOnline", ADMIN_ALL, "Show Vips Online");
RegisterHam(Ham_TakeDamage, "player", "Ham_PlayerTakeDamagePost", true );
RegisterHam(Ham_Killed, "player", "fw_player_killed");
RegisterHam(Ham_Spawn, "player", "Spawn_player", 1);
register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
register_message( get_user_msgid( "ScoreAttrib" ), "VipStatus" );
//parasuta
register_cvar("amx_maxjumps","2")
pFallSpeed = register_cvar("parachute_fallspeed", "100")
pDetach = register_cvar("parachute_detach", "1")
new cvarString[256], shortName[16]
copy(shortName,15,"chute")
register_cvar("jtp10181","",FCVAR_SERVER|FCVAR_SPONLY)
get_cvar_string("jtp10181",cvarString,255)
if (strlen(cvarString) == 0) {
formatex(cvarString,255,shortName)
set_cvar_string("jtp10181",cvarString)
}
else if (contain(cvarString,shortName) == -1) {
format(cvarString,255,"%s,%s",cvarString, shortName)
set_cvar_string("jtp10181",cvarString)
}
gMoneyToGivePerDamage = register_cvar( "vip_mpd", "3" );
money_kill = register_cvar( "vip_moneykill", "200" );
hp_kill_hs = register_cvar( "vip_hpkillhs", "15" );
money_kill_hs = register_cvar( "vip_moneykillhs", "500" );
maxplayers = get_maxplayers()
}
public plugin_precache()
{
precache_model("models/parachuteVIP.mdl")
}
bool:is_user_vip(id)
{
if(id < 0 || id > 32)
return false
if( !(get_user_flags(id) & VIP_USER ) )
return false
return true
}
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(!is_user_vip(id)) 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] < get_cvar_num("amx_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
}
new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0
new Float:frame
new button = get_user_button(id)
new oldbutton = get_user_oldbutton(id)
new flags = get_entity_flags(id)
if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
if (get_pcvar_num(pDetach)) {
if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
entity_set_int(para_ent[id], EV_INT_sequence, 2)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
entity_set_float(para_ent[id], EV_FL_framerate, 0.0)
return PLUGIN_CONTINUE
}
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
entity_set_float(para_ent[id],EV_FL_fuser1,frame)
entity_set_float(para_ent[id],EV_FL_frame,frame)
if (frame > 254.0) {
remove_entity(para_ent[id])
para_ent[id] = 0
}
}
else {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
return PLUGIN_CONTINUE
}
if (button & IN_USE) {
new Float:velocity[3]
entity_get_vector(id, EV_VEC_velocity, velocity)
if (velocity[2] < 0.0) {
if(para_ent[id] <= 0) {
para_ent[id] = create_entity("info_target")
if(para_ent[id] > 0) {
entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
entity_set_edict(para_ent[id], EV_ENT_aiment, id)
entity_set_edict(para_ent[id], EV_ENT_owner, id)
entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_model(para_ent[id], "models/parachute.mdl")
entity_set_int(para_ent[id], EV_INT_sequence, 0)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
}
}
if (para_ent[id] > 0) {
entity_set_int(id, EV_INT_sequence, 3)
entity_set_int(id, EV_INT_gaitsequence, 1)
entity_set_float(id, EV_FL_frame, 1.0)
entity_set_float(id, EV_FL_framerate, 1.0)
set_user_gravity(id, 0.1)
velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
entity_set_vector(id, EV_VEC_velocity, velocity)
if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
entity_set_float(para_ent[id],EV_FL_fuser1,frame)
entity_set_float(para_ent[id],EV_FL_frame,frame)
if (frame > 100.0) {
entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
entity_set_float(para_ent[id], EV_FL_framerate, 0.4)
entity_set_int(para_ent[id], EV_INT_sequence, 1)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
}
}
}
}
else if (para_ent[id] > 0) {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
}
else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(!is_user_vip(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
}
public Spawn_player(id)
{
if(is_user_alive(id) && is_user_connected(id) && is_user_vip(id))
{
if(para_ent[id] > 0)
{
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
give_item(id,"weapon_hegrenade");
give_item(id,"weapon_flashbang");
has_parachute[id] = true;
}
}
public event_new_round()
{
round++
new players[32], player, pnum;
get_players(players, pnum, "a");
for(new i = 0; i < pnum; i++)
{
player = players[i];
if(is_user_vip(player) && round >= 3)
{
arme_vip(player);
}
}
return PLUGIN_HANDLED
}
public Event_RoundRestart(id)
{
round=0;
}
public VipStatus(const MsgId, const MsgType, const MsgDest)
{
static id;
id = get_msg_arg_int(1);
if(is_user_vip(id) && !get_msg_arg_int(2))
set_msg_arg_int(2, ARG_BYTE, (1 << 2 ));
}
public arme_vip(id)
{
if(!is_user_alive(id))
{
ChatColor(id, "!g[VIP] !yNu poti accesa !teamMENIUL!y deoarece esti mort !")
return PLUGIN_HANDLED
}
new menu = menu_create("\wArme \rV\yI\rP :" , "arme_handler" );
menu_additem(menu, "\yM4A1 \w+ \rFlashbang", "1", 0);
menu_additem(menu, "\rAk47 \w+ \yFlashbang", "2", 0);
menu_setprop( menu, MPROP_EXITNAME, "Exit")
menu_display( id, menu, 0);
return PLUGIN_CONTINUE;
}
public arme_handler(id, menu, item, client)
{
if(item == MENU_EXIT || !is_user_alive(id))
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
static data[6], name[64], acs, cllbck, key
menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck)
key = str_to_num(data)
switch(key)
{
case 1:
{
if(is_user_alive(id))
{
give_item(id,"weapon_m4a1");
cs_set_user_bpammo(id,CSW_M4A1,250);
give_item(id,"weapon_flashbang");
cs_set_user_bpammo(id,CSW_FLASHBANG,2);
ChatColor(id, "!g[VIP] !yAi primit !teamM4a1 + Flashbang !ydeoarece esti VIP!")
}else
{
ChatColor(id, "!g[VIP] !yNu poti accesa !teamVIP-ul !ydeoarece esti MORT!")
}
}
case 2:
{
if(is_user_alive(id))
{
give_item(id,"weapon_ak47");
cs_set_user_bpammo(id,CSW_AK47,250);
give_item(id,"weapon_flashbang");
cs_set_user_bpammo(id,CSW_FLASHBANG,2);
ChatColor(id, "!g[VIP] !yAi primit !teamAk47+ Flashbang !ydeoarece esti VIP!")
}else
{
ChatColor(id, "!g[VIP] !yNu poti accesa !teamVIP-ul !ydeoarece esti MORT!")
}
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public fw_player_killed(victim, attacker, shouldgib)
{
if(is_user_alive(attacker) && is_user_vip(attacker))
{
if(get_pdata_int(victim, 75) == HIT_HEAD)
{
if(get_user_health(attacker) < 125)
{
new BaniPeHs = get_pcvar_num( money_kill_hs );
cs_set_user_money( attacker, cs_get_user_money( attacker) + BaniPeHs);
set_user_health( attacker,get_user_health(attacker) + get_pcvar_num( hp_kill_hs));
ChatColor(attacker, "!g[VIP] !yAi primit !team%d $ !ysi !team%d Hp !ypentru acest HeadShoot !",get_pcvar_num( money_kill_hs ),get_pcvar_num( hp_kill_hs ));
}else{
new BaniPeHs = get_pcvar_num( money_kill_hs );
cs_set_user_money( attacker, cs_get_user_money( attacker) + BaniPeHs);
ChatColor(attacker, "!g[VIP] !yAi primit !team%d $ !ysi !teamAi MAX HP !ypentru acest HeadShoot !",get_pcvar_num( money_kill_hs ));
}
}else
if(get_user_health(attacker) < 125)
{
new BaniNormal = get_pcvar_num( money_kill );
cs_set_user_money( attacker, cs_get_user_money( attacker) + BaniNormal );
set_user_health( attacker,get_user_health(attacker) + 10);
ChatColor(attacker, "!g[VIP] !yAi primit !team%d $ !ysi !team10 Hp !ypentru acest frag !",get_pcvar_num( money_kill ));
}else{
new BaniNormal = get_pcvar_num( money_kill );
cs_set_user_money( attacker, cs_get_user_money( attacker) + BaniNormal );
ChatColor(attacker, "!g[VIP] !yAi primit !team%d $ !ysi !teamAi MAX HP !ypentru acest frag!",get_pcvar_num( money_kill ));
}
}
return PLUGIN_CONTINUE;
}
public Ham_PlayerTakeDamagePost( id, iInflictor, iAttacker, Float:fDamage, bitsDamageType )
{
if( is_user_vip( iAttacker ) && !iAttacker || id == iAttacker || !is_user_connected( iAttacker ) || !is_user_connected( id ) || cs_get_user_team( id ) == cs_get_user_team( iAttacker ))
return HAM_IGNORED;
new iAttackerMoney = cs_get_user_money( iAttacker );
new iMoneyToAddOrRemove = get_pcvar_num( gMoneyToGivePerDamage );
cs_set_user_money( iAttacker, iAttackerMoney + iMoneyToAddOrRemove );
return HAM_IGNORED;
}
public ShowVipsOnline(id)
{
new message[256], name[32], count = 0;
new len = format(message, charsmax(message), "Vip-uri online: ");
for (new player = 1; player <= maxplayers; player++)
{
if (is_user_connected(player) && is_user_vip(player))
{
get_user_name(player, name, charsmax(name));
if (count && len)
{
len += format(message[len], 255 - len, ", ");
}
len += format(message[len], 255 - len, "%s", name);
if (len > 96) {
client_print(id, print_chat, "%s", message);
len = format(message, charsmax(message), "");
}
count++;
}
}
if (len)
{
if (!count)
{
len += format(message[len], 255 - len, "Nu este nici un vip online.");
}
client_print(id, print_chat, "%s", message);
}
return PLUGIN_HANDLED;
}
//stock
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!team", "^3")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}