Raised This Month: $209 Target: $400
 52% 

Plugin Event VIP FREE [UPDATE - V4.0]


Post New Thread Reply   
 
Thread Tools Display Modes
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-31-2019 , 11:11   Re: Plugin Event VIP FREE [UPDATE - V4.0]
Reply With Quote #11

Better way

PHP Code:
#include < amxmodx >
#include < amxmisc > 
#include < engine >
#include < hamsandwich >

#define MAX_PLAYERS         32
#define VIP_FLAG            ADMIN_LEVEL_H
#define PLUGIN_VERSION      "1.2"

new g_iCvars];

new 
bool:g_bFreeVipTimebool:g_bAlreadyVipMAX_PLAYERS ];

new 
g_iCacheFlagsMAX_PLAYERS ];

const 
g_iFlagsBitsum = ( VIP_FLAG // you can add multiple flags ( VIP_FLAG | FLAG_1 | FLAG_2 )

public plugin_init( )
{
    
register_plugin"Free VIP"PLUGIN_VERSION"DoNii" );

    
register_cvar"free_vip_version"PLUGIN_VERSIONFCVAR_SERVER FCVAR_SPONLY FCVAR_UNLOGGED )
    
    
register_event"HLTV""OnNewRound""a""1=0""2=0" );

    
RegisterHamHam_Spawn"player""fw_HamSpawnPost");
    
    
g_iCvars] = register_cvar"free_vip_on""1" );
    
g_iCvars] = register_cvar"free_vip_start_time""15" );
    
g_iCvars] = register_cvar"free_vip_end_time""22" );
}

public 
plugin_natives( )
{
    
register_library"free_vip" );
    
register_native"is_free_vip_time""native_is_free_vip_time" );
}

public 
native_is_free_vip_timeiPluginiParams )
{
    return 
g_bFreeVipTime;
}

public 
client_putinserverid )
{
    
g_bAlreadyVipid ] = ( get_user_flagsid ) & VIP_FLAG ) ? true false;
}

public 
client_disconnectid )
{
    
ResetFlagsToDefaultid );
    
    
g_bAlreadyVipid ] = false;
    
g_iCacheFlagsid ] = 0;
}

public 
OnNewRound( )
{
    if( ! 
get_pcvar_numg_iCvars] ) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    
g_bFreeVipTime IsVipHourget_pcvar_numg_iCvars] ), get_pcvar_numg_iCvars] ) );
    
    return 
PLUGIN_CONTINUE;
}

public 
fw_HamSpawnPostid )
{
    if( ! 
is_user_aliveid ) || is_user_botid ) || ! get_pcvar_numg_iCvars] ) )
    return 
HAM_IGNORED;
    
    if( 
g_bFreeVipTime )
    {
        if( 
get_user_flagsid ) & ADMIN_USER && ! g_bAlreadyVipid ] )
        {
            
g_iCacheFlagsid ] = get_user_flagsid ); // cache his flags
            
SetVipFlagid );
        }
    }
    
    else
    {
        if( ! 
g_bAlreadyVipid ] && ( get_user_flagsid ) & VIP_FLAG ) )
        {
            
ResetFlagsBackid ); // time expired so should the flag
        
}
    }    
    return 
HAM_IGNORED;
}

ResetFlagsToDefaultid )
{
    
remove_user_flagsid )
    
set_user_flagsidADMIN_USER );
}

ResetFlagsBackid )
{
    
remove_user_flagsid );    
    
set_user_flagsidg_iCacheFlagsid ] );
}

SetVipFlagid )
{
    if( 
get_user_flagsid ) & ADMIN_USER )
    {
        
remove_user_flagsidADMIN_USER );
    }
    
set_user_flagsidg_iFlagsBitsum );
}

bool:IsVipHouriStartiEnd )
{
    new 
iHourtimeiHour );
    return 
bool:( iStart iEnd ? ( iStart <= iHour iEnd ) : ( iStart <= iHour || iHour iEnd ) )

__________________

Last edited by edon1337; 09-02-2019 at 14:01.
edon1337 is offline
Send a message via Skype™ to edon1337
Gulden
New Member
Join Date: May 2020
Old 05-23-2020 , 12:46   Re: Plugin Event VIP FREE [UPDATE - V4.0]
Reply With Quote #12

Quote:
Originally Posted by FonixPro20 View Post
Hello All,

Plugin Event VIP FREE [UPDATE - V4.0]

Time 20 - 23 Change It If You Want .

PHP Code:
#include <amxmodx>
#include <amxmisc>

new start,
stop,
minutes,
h,
m

new boolHaveVipBefore[33];

#define FLAGS "t"

public plugin_init()
{
    
register_plugin("VIP FREE""4.0""LOL")
    
    
start register_cvar"vip_start""20" );
    
stop register_cvar"vip_end""23" );
    
minutes register_cvar"vip_minutes""00" ); // nu modificati
    
    
set_task60.0"check"___"b" );
    
}

public 
client_putinserver(id)
{
    
check(id)
}
public 
check(id)
{
    
    
timehm);
    new 
flags read_flags(FLAGS)
    
    if(
>= get_pcvar_numstart ) && get_pcvar_numstop ))
    {        
        if(!(
get_user_flags(id) & flags ))
        {
            
set_user_flags(idflags)
            
server_cmd"amx_reloadadmins" );
            
HaveVipBefore[id] = false;
            }else{
            
HaveVipBefore[id] = true;
        }
        if(
== get_pcvar_numstart ) && == get_pcvar_numminutes ))
        {
            
ColorChat(0"!g***** !tFREE VIP EVENT STARTED !g*****")
            
log_amx("***** FREE VIP EVENT STARTED *****")
        }
        
        
set_hudmessage(random(256), random(256), random(256),0.020.21_59.0__, -1)
        
show_hudmessage(0"** FREE VIP EVENT ACTIVE **")
    }
    else if(
get_pcvar_numstart ) || >= get_pcvar_numstop ))
    {
        if (!(
HaveVipBefore[id]))
        {
            
remove_user_flags(idflags);
            
server_cmd"amx_reloadadmins" );
        }
        if(
== get_pcvar_numstop ) && == get_pcvar_numminutes ))
        {
            
ColorChat(0"!g***** !tFREE VIP EVENT ENDED !g*****")
            
log_amx("***** FREE VIP EVENT ENDED *****")
        }
    }
}

stock ColorChat(const id, const input[], any:...) {
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^4");
    
replace_all(msg190"!n""^1");
    
replace_all(msg190"!t""^3");
    
    if(
idplayers[0] = id;
    else 
get_players(playerscount"ch"); {
        for(new 
0counti++) {
            if(
is_user_connected(players[i])) {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

Thanks All .

I don't know why I don't like the VIP event !! I put flags from the VIP that I have on the server and it doesn't work for me !! can someone help me too !! I have "br" flags on vip and I would like it to be set from 7 pm to 11 pm
__________________
Gulden-Cs.Sladers.Ro !!
Gulden is offline
Mohamed null
BANNED
Join Date: Sep 2020
Location: Algeria
Old 09-23-2020 , 15:54   Re: Plugin Event VIP FREE [UPDATE - V4.0]
Reply With Quote #13

Pls Tell me
How to add Items :
Models Menu
Knifes Menu
Glow Menu
Golden Deagle
Buy Bomb
Health Shop
----------
I HAVE Golden Deagle mdl + Glow Menu + Knifes menu models + Models menu
PLS MAKE IT FOR ME GUYS !!!
Mohamed null is offline
EKOLOGA90
New Member
Join Date: Jul 2021
Location: LONDON
Old 07-17-2021 , 09:48   Re: Plugin Event VIP FREE [UPDATE - V4.0]
Reply With Quote #14

can anyone help me to change the flag as it is currently flag t and i would like it to become flag z

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta_util>
#include <fun>
#include <hamsandwich>

#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#endif

#define PLUGIN "Simple VIP"
#define VERSION "4.3"
#define AUTHOR "ArtHa"

#define VIP ADMIN_LEVEL_H
#define REMOVE_MENU 20.05
#define TID_REMOVE 2551

new CurrentRound
new bool:HasC4[33]
new bool:gShopVipmenu = true
new bool:gAwpBlock;
new bool:gVipmenuActive[33];
new grenades, pistols, armor, vipmenu_weapon4
new vipinfo, vip_motd
new show_received, bulletdmg_vip, received_vip, g_visible, bulletdmg_type
new Float: Yv[ 33 ]
new Float: Ya[ 33 ]
new g_pHp[ 3 ], chat_message
new awp_vip, cvar_player, awp_block, awp_limit
new vip_check, fall_damage

// VIP MENU WEAPONS
new weapon[8]
#define CSW_WEAPON1 CSW_M4A1
#define CSW_WEAPON2 CSW_AK47
#define CSW_WEAPON3 CSW_FAMAS
#define CSW_WEAPON4 CSW_AWP

#define CSW_GUN CSW_DEAGLE
#define CSW_GUN1 CSW_GLOCK18
#define CSW_GUN2 CSW_USP
#define CSW_GUN3 CSW_DEAGLE

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_dictionary("simple_vip.txt")

register_logevent("logevent_round_end", 2, "1=Round_End")
register_event( "TextMsg","round_restart","a","2&#Game_C" , "2&#Game_W" );
register_concmd( "amx_roundrestart", "restartnumber", ADMIN_KICK );
RegisterHam( Ham_Spawn, "player", "FnHamSpawn", 1 )

new configsdir[64], file[132]
get_configsdir(configsdir, 63)

format(file, 131, "%s/blockedmaps.ini", configsdir)
load_maps(file)

register_cvar("vipmenu_round","2")

pistols = register_cvar("vipmenu_pistols","1")
grenades = register_cvar("vipmenu_grenades","1")
armor = register_cvar("vipmenu_armor","1")
vipmenu_weapon4 = register_cvar("vipmenu_weapon4","1")

register_clcmd("say /noriuvip", "motd")
vipinfo = register_cvar("vipinfo_website", "http://amxmodx.lt/viewtopic.php?f=12&t=5707")
vip_motd = register_cvar("vipmenu_motd","1")

register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
show_received = register_cvar("show_received","1")
bulletdmg_vip = register_cvar("bulletdmg_vip","1")
received_vip = register_cvar("receivedmg_vip","1")
g_visible = register_cvar("visible_player","1")
bulletdmg_type = register_cvar("bullet_damage_type","2")

register_event( "DeathMsg", "Event_DeathMsg", "a" )
g_pHp[ 0 ] = register_cvar( "amx_vip_hpadd", "10" )
g_pHp[ 1 ] = register_cvar( "amx_vip_hsadd", "20" )
g_pHp[ 2 ] = register_cvar( "amx_vip_hpmax", "100" )

chat_message = register_cvar( "amx_hpbonus_msg", "2" )

register_event("CurWeapon", "event_CurWeapon", "be")
awp_vip = register_cvar( "amx_vip_awp", "1" )
awp_limit = register_cvar( "amx_awp_limit", "1" )
awp_block = register_cvar( "amx_awp_block", "1" )
cvar_player = register_cvar("na_players_count", "10")

vip_check = register_cvar( "amx_vip_check", "1" )
register_clcmd("say", "handle_say")

RegisterHam(Ham_TakeDamage, "player", "OnCBasePlayer_TakeDamage")
fall_damage = register_cvar( "amx_no_falldmg", "1" )

weapon[0] = register_cvar( "amx_weapon1_ammo", "90" )
weapon[1] = register_cvar( "amx_weapon2_ammo", "90" )
weapon[2] = register_cvar( "amx_weapon3_ammo", "90" )
weapon[3] = register_cvar( "amx_weapon4_ammo", "30" )
weapon[4] = register_cvar( "amx_gun_ammo", "35" )
weapon[5] = register_cvar( "amx_gun1_ammo", "120" )
weapon[6] = register_cvar( "amx_gun2_ammo", "100" )
weapon[7] = register_cvar( "amx_gun3_ammo", "35" )
}

public logevent_round_end()
{
CurrentRound++;
}

public plugin_cfg()
{
new cfgdir[32];
get_configsdir(cfgdir, charsmax(cfgdir));

server_cmd("exec %s/simple_vip.cfg", cfgdir);
}

public load_maps(path[])
{
new szMapname[64], szMap[64]
new file = fopen(path, "rt")

if(!file)
{
server_print("Nepavyko rasti blockedmaps.ini failo!")
return PLUGIN_HANDLED
}

new iSize = file_size(path, 1);

for(new i = 0, iLen; i < iSize; i++)
{
read_file(path, i, szMapname, charsmax(szMapname), iLen);

if(equal(szMapname[0], "") || equal(szMapname[0], ";"))
{
continue;
}

get_mapname(szMap, 63)
if(equali(szMap, szMapname))
{
gShopVipmenu = false;
break;
}
}
fclose(file);
return PLUGIN_CONTINUE
}

public round_restart()
{
CurrentRound = 1;
return PLUGIN_HANDLED;
}

public restartnumber( id, level, cid )
{
if( !cmd_access( id, level, cid, 1 ) )
return PLUGIN_HANDLED;

CurrentRound = 1;
return PLUGIN_HANDLED;
}

public FnHamSpawn(id)
{
if(is_user_alive(id))
{
if(gShopVipmenu)
{
gVipmenuActive[id] = false

if(CurrentRound >= get_cvar_num( "vipmenu_round" ) )
{
if(get_user_flags(id) & VIP )
{
if(task_exists(TID_REMOVE+id))
remove_task(TID_REMOVE+id)

gVipmenuActive[id] = true
set_task(REMOVE_MENU, "close_menu", TID_REMOVE+id )
vipmenu(id);
}
}

if(get_pcvar_num(pistols) == 1 && CurrentRound <= get_cvar_num( "vipmenu_round" ))
{
if(get_user_flags(id) & VIP )
{
if(task_exists(TID_REMOVE+id))
remove_task(TID_REMOVE+id)

gVipmenuActive[id] = true
set_task(REMOVE_MENU, "close_menu", TID_REMOVE+id )
vipmenu2(id)
}
}
}
}
}

public close_menu(tid)
{
static id
id = tid-TID_REMOVE

if(gVipmenuActive[id])
{
client_cmd(id, "slot10" )
gVipmenuActive[id] = false
ChatColor(id, "%L", id, "CLOSED" )
}
}

public vipmenu(id)
{
new buffer[1024];
formatex(buffer, charsmax(buffer), "%L", LANG_PLAYER, "VIPMENU");
new menu = menu_create(buffer, "menu_handler");

formatex(buffer, charsmax(buffer), "%L", id, "WEAPONS1");
menu_additem(menu, buffer, "1", 0);

formatex(buffer, charsmax(buffer), "%L", id, "WEAPONS2");
menu_additem(menu, buffer, "2", 0);

formatex(buffer, charsmax(buffer), "%L", id, "WEAPONS3");
menu_additem(menu, buffer, "3", 0);

if(get_pcvar_num(vipmenu_weapon4) == 1)
{
formatex(buffer, charsmax(buffer), "%L", id, "WEAPONS4");
menu_additem(menu, buffer, "4", 0);
}

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0);
}

public vipmenu2(id)
{
new buffer[1024];
formatex(buffer, charsmax(buffer), "%L", LANG_PLAYER, "VIPMENU");
new menu = menu_create(buffer, "menu_handler");

formatex(buffer, charsmax(buffer), "%L", id, "GUN1");
menu_additem(menu, buffer, "5", 0);

formatex(buffer, charsmax(buffer), "%L", id, "GUN2");
menu_additem(menu, buffer, "6", 0);

formatex(buffer, charsmax(buffer), "%L", id, "GUN3");
menu_additem(menu, buffer, "7", 0);

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0);
}

public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
give_items(id);
gVipmenuActive[id] = false;
menu_destroy(menu);
return PLUGIN_HANDLED;
}

new data[6], iName[64];
new acess, callback;

menu_item_getinfo(menu, item, acess, data,6, iName, 63, callback);
new key = str_to_num(data);

switch(key)
{
case 1: { give_weapons(id, CSW_WEAPON1, get_pcvar_num( weapon[ 0 ] ), CSW_GUN, get_pcvar_num( weapon[ 4 ] )); }
case 2: { give_weapons(id, CSW_WEAPON2, get_pcvar_num( weapon[ 1 ] ), CSW_GUN, get_pcvar_num( weapon[ 4 ] )); }
case 3: { give_weapons(id, CSW_WEAPON3, get_pcvar_num( weapon[ 2 ] ), CSW_GUN, get_pcvar_num( weapon[ 4 ] )); }
case 4: { give_weapons(id, CSW_WEAPON4, get_pcvar_num( weapon[ 3 ] ), CSW_GUN, get_pcvar_num( weapon[ 4 ] )); }
case 5: { give_weapon(id, CSW_GUN1, get_pcvar_num( weapon[ 5 ] )); }
case 6: { give_weapon(id, CSW_GUN2, get_pcvar_num( weapon[ 6 ] )); }
case 7: { give_weapon(id, CSW_GUN3, get_pcvar_num( weapon[ 7 ] )); }
}

gVipmenuActive[id] = false;
menu_destroy(menu);
return PLUGIN_HANDLED;
}

public give_weapons(id, prim, ammo1, sec, ammo2)
{
HasC4[id] = (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)

new weapon[32]
strip_user_weapons (id)
get_weaponname(prim, weapon, 31)
give_item(id,weapon)
cs_set_user_bpammo(id, prim, ammo1)

get_weaponname(sec, weapon, 31)
give_item(id,weapon)
cs_set_user_bpammo(id, sec, ammo2)

give_item(id,"weapon_knife")

if(HasC4[id])
{
give_item(id, "weapon_c4")
cs_set_user_plant( id )
}

give_items(id)
}

public give_weapon(id, sec, ammo)
{
HasC4[id] = (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)

new weapon[32]
strip_user_weapons (id)
get_weaponname(sec, weapon, 31)
give_item(id,weapon)
cs_set_user_bpammo(id, sec, ammo)

give_item(id,"weapon_knife")

if (HasC4[id])
{
give_item(id, "weapon_c4")
cs_set_user_plant( id )
}

give_items(id)
}

give_items(id)
{
if(is_user_alive(id))
{
if(get_pcvar_num(grenades) == 1)
{
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_smokegrenade");
give_item(id, "weapon_flashbang");
cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
}

if(get_pcvar_num(armor) == 1)
{
give_item(id, "item_assaultsuit");
if(get_user_team(id) == 2)
give_item(id, "item_thighpack");
}
}
}

public motd(id)
{
if(get_pcvar_num(vip_motd) == 1)
Link( id, "%s" )
}

stock Link( id, url[] )
{
static html[ 128 ]
new site[64]
get_pcvar_string(vipinfo, site, charsmax(site))

format( html, 127, "<html><head><META HTTP-EQUIV=^"Refresh^" CONTENT=^"0; URL=%s^"></head><body bgcolor=^"black^" scroll=^"yes^"><a href=^"%s^">VIP privilegijos</a></body></html>", site, url, url, url )

show_motd( id, html, "Pirkti VIP" )
}

public on_damage(id)
{
static attacker; attacker = get_user_attacker(id)
static damage; damage = read_data(2)

if(get_pcvar_num(show_received) == 1)
{
if(get_pcvar_num(received_vip) == 1)
{
if( get_user_flags(id) & VIP )
{
if(get_pcvar_num(bulletdmg_type) == 1)
{
set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(id, CreateHudSyncObj(), "%L^n", id, "MINUS_DAMAGE", damage)
}

else
{
set_dhudmessage( 255,0,0, 0.45, Yv[ id ], 1, 0.1, 4.0, 0.1, 0.1)
show_dhudmessage(id, "%L^n", id, "MINUS_DAMAGE", damage)

Yv[ id ] += 0.05
set_task( 3.0, "RestartdHudPos1", id )
}
}
}

else
{
if(get_pcvar_num(bulletdmg_type) == 1)
{
set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(id, CreateHudSyncObj(), "%L^n", id, "MINUS_DAMAGE", damage)
}

else
{
set_dhudmessage( 255,0,0, 0.45, Yv[ id ], 1, 0.1, 4.0, 0.1, 0.1)
show_dhudmessage(id, "%L^n", id, "MINUS_DAMAGE", damage)

Yv[ id ] += 0.05
set_task( 3.0, "RestartdHudPos1", id )
}
}
}

if(is_user_connected(attacker))
{
if(get_pcvar_num(bulletdmg_vip) == 1)
{
if( get_user_flags(attacker) & VIP )
{
if(get_pcvar_num(g_visible) == 1)
{
if(fm_is_ent_visible(attacker,id))
{
if(get_pcvar_num(bulletdmg_type) == 1)
{
set_hudmessage(0, 255, 0, 0.55, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(attacker, CreateHudSyncObj(), "%L^n", attacker, "PLIUS_DAMAGE", damage)
}

else if(get_pcvar_num(bulletdmg_type) == 2)
{
set_dhudmessage( 0,255,0, 0.55, Ya[ attacker ], 1, 0.1, 4.0, 0.1, 0.1)
show_dhudmessage(attacker, "%L^n", attacker, "PLIUS_DAMAGE", damage)
Ya[ attacker ] += 0.05
set_task( 3.0, "RestartdHudPos2", attacker )
}
}
}

else
{
if(get_pcvar_num(bulletdmg_type) == 1)
{
set_hudmessage(0, 255, 0, 0.55, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(attacker, CreateHudSyncObj(), "%L^n", attacker, "PLIUS_DAMAGE", damage)
}

else if(get_pcvar_num(bulletdmg_type) == 2)
{
set_dhudmessage( 0,255,0, 0.55, Ya[ attacker ], 1, 0.1, 4.0, 0.1, 0.1)
show_dhudmessage(attacker, "%L^n", attacker, "PLIUS_DAMAGE", damage)
Ya[ attacker ] += 0.05
set_task( 3.0, "RestartdHudPos2", attacker )
}
}
}
}

else if(get_pcvar_num(bulletdmg_vip) == 2)
{
if(get_pcvar_num(g_visible) == 1)
{
if(fm_is_ent_visible(attacker,id))
{
if(get_pcvar_num(bulletdmg_type) == 1)
{
set_hudmessage(0, 255, 0, 0.55, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(attacker, CreateHudSyncObj(), "%L^n", attacker, "PLIUS_DAMAGE", damage)
}

else if(get_pcvar_num(bulletdmg_type) == 2)
{
set_dhudmessage( 0,255,0, 0.55, Ya[ attacker ], 1, 0.1, 4.0, 0.1, 0.1)
show_dhudmessage(attacker, "%L^n", attacker, "PLIUS_DAMAGE", damage)
Ya[ attacker ] += 0.05
set_task( 3.0, "RestartdHudPos2", attacker )
}
}
}

else
{
if(get_pcvar_num(bulletdmg_type) == 1)
{
set_hudmessage(0, 255, 0, 0.55, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(attacker, CreateHudSyncObj(), "%L^n", attacker, "PLIUS_DAMAGE", damage)
}

else if(get_pcvar_num(bulletdmg_type) == 2)
{
set_dhudmessage( 0,255,0, 0.55, Ya[ attacker ], 1, 0.1, 4.0, 0.1, 0.1)
show_dhudmessage(attacker, "%L^n", attacker, "PLIUS_DAMAGE", damage)
Ya[ attacker ] += 0.05
set_task( 3.0, "RestartdHudPos2", attacker )
}
}
}
}
}

public RestartdHudPos1( id )
{
Yv[ id ] = 0.50
}

public RestartdHudPos2( id )
{
Ya[ id ] = 0.55
}

public client_putinserver( id )
{
Ya[ id ] = 0.45
Yv[ id ] = 0.50
}

public Event_DeathMsg( )
{
new iKiller = read_data( 1 )
new iVictim = read_data( 2 )
new HeadShot = read_data( 3 )

if( get_user_team( iKiller ) == get_user_team( iVictim ) )
return

if( iKiller && iVictim != iKiller && get_user_flags(iKiller) & VIP )
{
static maxhp, hp
maxhp = get_pcvar_num( g_pHp[ 2 ] )
hp = get_user_health( iKiller )

if( hp != maxhp )
{
new BonusHp;
if( HeadShot ) BonusHp = get_pcvar_num( g_pHp[ 1 ] )
else BonusHp = get_pcvar_num( g_pHp[ 0 ] )

if( hp + BonusHp > maxhp )
{
set_user_health( iKiller, maxhp )

if(get_pcvar_num(chat_message) == 1)
ChatColor(iKiller, "%L", iKiller, "HP_BONUS", maxhp - hp )

else if(get_pcvar_num(chat_message) == 2)
{
set_dhudmessage( 0,255,0, -1.0, 0.15, 1, 1.0, 1.0, 0.1, 0.2)
show_dhudmessage(iKiller, "%L", iKiller, "HP_BONUS", maxhp - hp )
}
}
else
{
set_user_health( iKiller, hp + BonusHp )

if(get_pcvar_num(chat_message) == 1)
ChatColor(iKiller, "%L", iKiller, "HP_BONUS", BonusHp )

else if(get_pcvar_num(chat_message) == 2)
{
set_dhudmessage( 0,255,0, -1.0, 0.15, 1, 1.0, 1.0, 0.1, 0.2)
show_dhudmessage(iKiller, "%L", iKiller, "HP_BONUS", BonusHp )
}
}
}
}
}

public event_CurWeapon(id)
{
new szMapname[64]
get_mapname(szMapname, 63)

if( containi(szMapname, "cs_max") != -1 || containi(szMapname, "2x2") != -1 || containi(szMapname, "fy_") != -1 || containi(szMapname, "aim_") != -1 || containi(szMapname, "mini") != -1)
gAwpBlock = true

if(containi(szMapname, "awp"))
{
switch(read_data(2))
{
case CSW_AWP, CSW_SG550, CSW_G3SG1:
{
if(get_pcvar_num(awp_block) == 1 && gAwpBlock)
{
client_cmd(id, "drop")
ChatColor(id, "%L", id, "AWP_BLOCK" )
}

if(get_pcvar_num(awp_limit) == 1 && get_playersnum() < get_pcvar_num(cvar_player)) // psychical code
{
client_cmd(id, "drop")
ChatColor(id, "%L", id, "AWP_LIMIT", get_pcvar_num(cvar_player) )
}

if(get_pcvar_num(awp_vip) == 1 && (!(get_user_flags(id) & VIP)))
{
client_cmd(id, "drop")
ChatColor(id, "%L", id, "AWP_DROP" )
}
}
}
}
}

public handle_say(id)
{
new said[192]
read_args(said,192)

if(get_pcvar_num(vip_check) == 1)
{
if(containi(said, "/vip") != -1 )
show_vip(id)
}

return PLUGIN_CONTINUE
}

public show_vip(user)
{
new adminnames[32][33]
new message[256]
new id, count, x, len

new players[32], playersnum
get_players(players, playersnum, "ch")
for(--playersnum; playersnum >= 0; playersnum--)
{
id = players[playersnum]
if(get_user_flags(id) & VIP)
{
get_user_name(id, adminnames[count++], charsmax(adminnames[]))
}
}

len = formatex(message, charsmax(message), "^3Prisijunge VIP:^4 ", user)
if(count > 0)
{
for(x = 0 ; x < count ; x++)
{
len += formatex(message[len], charsmax(message)-len, "^1%s%s", adminnames[x], x < (count-1) ? ", ":".")
if(len > 96)
{
ChatColor(user, message)
len = format(message, 255, "^4")
}
}
ChatColor(user, message)
}
else
{
len += copy(message[len], charsmax(message)-len, "^3Nera prisijungusiu^4 VIP")
ChatColor(user, message)
}
}

public OnCBasePlayer_TakeDamage( id, iInflictor, iAttacker, Float:flDamage, bitsDamageType )
{
if( bitsDamageType & DMG_FALL )
{
if(get_pcvar_num(fall_damage) == 1)
{
if( get_user_flags(id) & VIP )
{
return HAM_SUPERCEDE
}
}

else if(get_pcvar_num(fall_damage) == 2)
{
return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}

stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[192]
vformat(msg, 191, input, 3)

replace_all(msg, 191, "!g", "^4") // Green Color
replace_all(msg, 191, "!y", "^1") // Default Color
replace_all(msg, 191, "!t", "^3") // Team Color

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();
}
}
}
}
EKOLOGA90 is offline
Send a message via Skype™ to EKOLOGA90
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:48.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode