Raised This Month: $51 Target: $400
 12% 

Add event free VIP to plugins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AlexandruODT
Member
Join Date: May 2020
Old 06-09-2020 , 07:32   Add event free VIP to plugins
Reply With Quote #1

Can anyone help me to add free vip event from this VIP plugin to it?

This is plugin with EVENT FREE VIP - "ADMIN_LEVEL_H"

PHP Code:
/*
*    ___________
*
*    Simple Public VIP v1.0
*        
*    Author: ALGHTRYER 
*    e: [email protected] w: alghtryer.github.io     
*    ___________
*    
*          VIP Player ( flag t ) have several privileges, which will not give much advantage over other players. 
*    You can adjust everything with cvar.
*
*    Features:
*    - Free he, smoke and flash bomb.
*    - Kevlar and Helmet 
*    - Defuse for CT 
*    - Menu with free weapon    ( ak47/m4a1 + deagle ). Menu will be remove after 15 ( cvar ) seconds.  
*    - Only VIP can buy AWP. 
*    - Show damage.
*    - Happy Hour.
*
*    How set VIP?
*     - Put flag "t" on player STEAM ID, IP or NAME.
*
*    Cvars : 
*    // 0 = off / 1 = on 
*    - spv_menu 1 = Show Menu
*    - spv_awp 1 = Only VIP can buy Awp
*    - spv_menuremove 15 = Remove Menu after seconds
*    - spv_he 1 = Give He
*    - spv_smoke 1 = Give Smoke
*    - spv_fb 1 = Give flash
*    - spv_fb2 1 = Give flash
*    - spv_armor 1 = Give Armor ( Kevlar and Helmet )
*    - spv_def 1 = Give defuse fot ct player
*    - spv_damage 1 = Show damage
*    - spv_hh 1 = Happy Hour
*    - spv_infohud 1 = Show hud about happy hour 
*    - spv_start 23 = When Start Happy Hour 2 = 2 am and 14 = 2 pm
*    - spv_end 9 = When End Happy Hour 2 = 2 am and 14 = 2 pm    
*    - spv_roundsmenu 3 = Menu with free weapon will be show on third ( cvar ) round
*
*    
*    Changelog:
*    - v1.0 [13. Apr 2020] : First release.
*
*/

#include < amxmodx >
#include < cstrike >
#include < fun >
#include < engine >
#include < fakemeta >
#include < hamsandwich >


new const
// _________________________________________
    
    
PLUGIN [ ] = "Simple Public VIP",
       
VERSION[ ] = "1.0",
    
AUTHOR [ ] = "ALGHTRYER";
// _________________________________________


new bool:bHappyHour;

new 
CvarMenu;
new 
CvarAwp;
new 
CvarMenuRemove;
new 
CvarHe;
new 
CvarSmoke;
new 
CvarFb;
new 
CvarFb2;
new 
CvarArmor;
new 
CvarDef;
new 
CvarHappyHour;
new 
CvarInfoHud;
new 
CvarStart;
new 
CvarEnd
new 
CvarDamage;
new 
CvarRoundsMenu;

new 
gRounds;

new 
SyncInfoHud;
new 
SyncDamage;

enum /* Weapon types */
{
    
Primary 1
    
Secondary
    
Knife
    
Grenades
    
C4
};

public 
plugin_init( ) 
{
    
register_plugin
    
(
        
PLUGIN,        //: Simple Public VIP 
        
VERSION,    //: 1.0
        
AUTHOR        //: ALGHTRYER <alghtryer.github.io>
    
);

    
register_cvar"spv_version"VERSIONFCVAR_SERVER|FCVAR_UNLOGGED );

    
CvarMenu            register_cvar"spv_menu""1" );
    
CvarAwp                register_cvar"spv_awp""1" );
    
CvarMenuRemove            register_cvar"spv_menuremove""15" );
    
CvarHe                register_cvar"spv_he""1" );
    
CvarSmoke            register_cvar"spv_smoke""1" );
    
CvarFb                register_cvar"spv_fb""1" );
    
CvarFb2                register_cvar"spv_fb2""1" );
    
CvarArmor            register_cvar"spv_armor""1" );
    
CvarDef                register_cvar"spv_def""1" );
    
CvarDamage            register_cvar"spv_damage""1" );
    
CvarHappyHour            register_cvar"spv_hh""1" );
    
CvarInfoHud            register_cvar"spv_infohud""1" );
    
CvarStart             register_cvar"spv_start""23" );
    
CvarEnd             register_cvar"spv_end""9" );
    
CvarRoundsMenu            register_cvar"spv_roundsmenu""3" );

    
SyncInfoHud            CreateHudSyncObj( );
    
SyncDamage            CreateHudSyncObj( );

        
register_logevent"OnRoundStart"2"1=Round_Start" ); 
    
register_event("HLTV""CheckHappyHour""a""1=0""2=0"

    
register_event"TextMsg""RestartGame""a""2&#Game_C","2&#Game_w" );

    
register_event"Damage""Event_Damage""b""2>0""3=0" );

    
register_clcmd"awp""BuyAwp" );
    
register_clcmd"magnum" ,"BuyAwp" );

}

public 
plugin_cfg( ) 

    if( 
get_pcvar_numCvarInfoHud ) )
        
set_task1.0"InfoHud"___"b" );

}

public 
InfoHud( )
{
    
set_hudmessage4325500.450.03__1.0__);
    
ShowSyncHudMsg0SyncInfoHud"[ FREE VIP EVENT ] [ START ]: [%dh] - [ END ] [%dh]"get_pcvar_numCvarStart ), get_pcvar_numCvarEnd ) );
}

public 
OnRoundStart( )
{
    
gRounds ++

    new 
iPlayers32 ] , iNumid;
    
get_playersiPlayers iNum  );

    for ( new 
iNum i++ )
    {
        
id iPlayers];

            if( 
get_user_flags(id) & ADMIN_LEVEL_H || bHappyHour )
        {
            if( 
get_pcvar_numCvarMenu ) && gRounds >= get_pcvar_numCvarRoundsMenu ) )
            {
                
CreateWeaponMenuid );

                if( 
task_existsid ) )
                {
                    
remove_taskid );
                }

                
set_taskget_pcvar_floatCvarMenuRemove ), "RemoveMenu"id );
            }
            
            if( 
get_pcvar_numCvarHe ) )
                
give_itemid"weapon_hegrenade" );

            if( 
get_pcvar_numCvarSmoke ) )
                
give_itemid"weapon_smokegrenade" );

            if( 
get_pcvar_numCvarFb ) )
                
give_itemid"weapon_flashbang" );

            if( 
get_pcvar_numCvarFb2 ) )
                
give_itemid"weapon_flashbang" );

            if( 
get_pcvar_numCvarArmor ) )
                
cs_set_user_armorid100CS_ARMOR_VESTHELM );

            if ( 
get_pcvar_numCvarDef ) && cs_get_user_team(id) == CS_TEAM_CT )
                
cs_set_user_defuseid);
        }
    }
}

public 
CreateWeaponMenuid )
{
    new 
menu menu_create"\rWeapon Menu:""weapon_menu" );
    
menu_additemmenu"\wAK47 + Deagle""");
    
menu_additemmenu"\wM4A1 + Deagle""");
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);
    
}

public 
weapon_menuidmenuitem )
{
    switch( 
item )
    {
        case 
0:
        {
            if( !
user_has_weaponidCSW_AK47))
            { 
                
StripWeaponsidPrimary );
                
give_itemid"weapon_ak47" ); 
            }
            else
                
cs_set_weapon_ammofind_ent_by_owner( -1"weapon_ak47"id ), 30 );

            if( !
user_has_weaponidCSW_DEAGLE))
                {     
                
StripWeaponsidSecondary );
                
give_itemid"weapon_deagle" ); 
            }
            else
                
cs_set_weapon_ammofind_ent_by_owner( -1"weapon_deagle"id ), );

            
cs_set_user_bpammoidCSW_AK4790 );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
               }

            case 
1:
            {
            if( !
user_has_weaponidCSW_M4A1))
                { 
                
StripWeaponsidPrimary );
                
give_itemid"weapon_m4a1" ); 
            }
            else
                
cs_set_weapon_ammofind_ent_by_owner( -1"weapon_m4a1"id ), 30 );

            if( !
user_has_weaponidCSW_DEAGLE))
                { 
                
StripWeaponsidSecondary );
                
give_itemid"weapon_deagle" ); 
            }
            else
                
cs_set_weapon_ammofind_ent_by_owner( -1"weapon_deagle"id ), );

            
cs_set_user_bpammoidCSW_M4A190 );
            
cs_set_user_bpammoidCSW_DEAGLE35 );
        }
            
        case 
MENU_EXIT:
            {
                    
client_printidprint_chat"You exited the menu..." );
         }
    }

        
menu_destroymenu );
        return 
PLUGIN_HANDLED;


public 
RemoveMenuid )
{
    
show_menuid0"^n");
}

public 
BuyAwpid )
{
    if( 
get_pcvar_numCvarAwp ) )
    {
    
        if( 
get_user_flags(id) & ADMIN_LEVEL_H || bHappyHour  )    
            return 
PLUGIN_CONTINUE;
        
            
client_printidprint_center"#Cstrike_TitlesTXT_Cannot_Buy_This" );
            return 
PLUGIN_HANDLED;
     }
    return 
PLUGIN_CONTINUE;            
}

public 
Event_DamageiVictim )
{
    if( 
get_pcvar_numCvarDamage) )
    {
        new 
id get_user_attackeriVictim );
        
        if( 
is_user_connectedid ) && get_user_flags(id) & ADMIN_LEVEL_H )
        {
            
set_hudmessage0100200, -1.00.5520.14.00.020.02, -);
            
ShowSyncHudMsgidSyncDamage"%d^n"read_data) );
        }
    }
}

public 
CheckHappyHour( )
{
    if( 
get_pcvar_numCvarHappyHour ) )
    {
        static 
hour_str], get_hourget_startget_end;
    
        
get_time"%H"hour_str);
    
        
get_hour    str_to_numhour_str );
    
        
get_start    get_pcvar_numCvarStart );
        
get_end        get_pcvar_numCvarEnd );

        if( 
get_start get_end ? ( get_start <= get_hour && get_hour get_end ) : ( get_start <= get_hour || get_hour get_end ) )
            
bHappyHour true;
        else
            
bHappyHour false;
    }
}

public 
RestartGame( )
{
    
gRounds 0;
}

public 
client_disconnectid )
{
    if( 
task_existsid ) )
    {
        
remove_taskid );
    }
}

// ***
// Start "stripsweapons.inc" <https://forums.alliedmods.net/showpost.php?p=1585138&postcount=9>

stock StripWeapons(idTypeboolbSwitchIfActive true)
{
    new 
iReturn;
    
    if(
is_user_alive(id))
    {
        new 
iEntityiWeapon;
        while((
iWeapon GetWeaponFromSlot(idTypeiEntity)) > 0)
            
iReturn ham_strip_user_weapon(idiWeaponTypebSwitchIfActive);
    }
    
    return 
iReturn;
}
stock GetWeaponFromSlotid iSlot , &iEntity )
{
    if ( !( 
<= iSlot <= ) )
        return 
0;
    
    
iEntity 0;
    const 
m_rgpPlayerItems_Slot0 367;
    const 
m_iId 43;
    const 
XO_WEAPONS 4;
    const 
XO_PLAYER 5;
        
    
iEntity get_pdata_cbaseid m_rgpPlayerItems_Slot0 iSlot XO_PLAYER );
    
    return ( 
iEntity ) ? get_pdata_intiEntity m_iId XO_WEAPONS ) : 0;
}  
stock ham_strip_user_weapon(idiCswIdiSlot 0bool:bSwitchIfActive true)
{
    new 
iWeapon
    
if( !iSlot )
    {
        static const 
iWeaponsSlots[] = {
            -
1,
            
2//CSW_P228
            
-1,
            
1//CSW_SCOUT
            
4//CSW_HEGRENADE
            
1//CSW_XM1014
            
5//CSW_C4
            
1//CSW_MAC10
            
1//CSW_AUG
            
4//CSW_SMOKEGRENADE
            
2//CSW_ELITE
            
2//CSW_FIVESEVEN
            
1//CSW_UMP45
            
1//CSW_SG550
            
1//CSW_GALIL
            
1//CSW_FAMAS
            
2//CSW_USP
            
2//CSW_GLOCK18
            
1//CSW_AWP
            
1//CSW_MP5NAVY
            
1//CSW_M249
            
1//CSW_M3
            
1//CSW_M4A1
            
1//CSW_TMP
            
1//CSW_G3SG1
            
4//CSW_FLASHBANG
            
2//CSW_DEAGLE
            
1//CSW_SG552
            
1//CSW_AK47
            
3//CSW_KNIFE
            
//CSW_P90
        
}
        
iSlot iWeaponsSlots[iCswId]
    }

    const 
XTRA_OFS_PLAYER 5
    
const m_rgpPlayerItems_Slot0 367

    iWeapon 
get_pdata_cbase(idm_rgpPlayerItems_Slot0 iSlotXTRA_OFS_PLAYER)

    const 
XTRA_OFS_WEAPON 4
    
const m_pNext 42
    
const m_iId 43

    
while( iWeapon )
    {
        if( 
get_pdata_int(iWeaponm_iIdXTRA_OFS_WEAPON) == iCswId )
        {
            break
        }
        
iWeapon get_pdata_cbase(iWeaponm_pNextXTRA_OFS_WEAPON)
    }

    if( 
iWeapon )
    {
        const 
m_pActiveItem 373
        
if( bSwitchIfActive && get_pdata_cbase(idm_pActiveItemXTRA_OFS_PLAYER) == iWeapon )
        {
            
ExecuteHamB(Ham_Weapon_RetireWeaponiWeapon)
        }

        if( 
ExecuteHamB(Ham_RemovePlayerItemidiWeapon) )
        {
            
user_has_weapon(idiCswId0)
            
ExecuteHamB(Ham_Item_KilliWeapon)
            return 
1
        
}
    }

    return 
0


// End "stripsweapons.inc" <https://forums.alliedmods.net/showpost.php?p=1585138&postcount=9>
// ***

/* 
    MADE BY ALGHTRYER.
*/ 
The plugin I use has the flag "x"

PHP Code:
/*
CREDITE:
ConnorMcLeod - pentru bullet damage
twistedeuphoria - pentru multi jump
cheap_suit - cateva bucati de cod extrase din biohazard
*/
 
 
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#include <fun>
#include <fakemeta>
 
// --------------------------------------------
//   ------------- DE EDITAT ---------------
// --------------------------------------------
new const TAG[] = "[V.I.P]";     // TAGUL IN CHAT CARE APARE
new const CONTACT[] = "KnockOut";
 
#define is_user_vip(%1) (get_user_flags(%1) & read_flags("x"))
// --------------------------------------------
//   ------------- DE EDITAT ---------------
// --------------------------------------------
 
#define PLUGIN_NAME "VIP System"
#define PLUGIN_NAME_PAUSED "VIP System [OPRIT]"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "YONTU"
 
#define is_user_valid(%1) (1 <= %1 <= max_players)
 
enum cvars
{
    
hp_spawn 0,
    
ap_spawn,
    
money_spawn,
    
hp_kill,
    
hp_hs,
    
ap_kill,
    
ap_hs,
    
hp_max,
    
money_kill,
    
money_hs,
    
show_vip_tab,
    
show_bullet_dmg,
    
multi_jump,
    
parachute
}
 
new 
cvar[cvars], rounds 1;
new 
max_players;
new 
bool:g_bJump[33] = falseg_JumpNum[33] = 0;
new 
g_iPlayerPos[33], g_iPlayerCol[33];
 
// NU SCHIMBA
new const Float:g_flCoords[][] =  
{
    {
0.500.40},
    {
0.560.44},
    {
0.600.50},
    {
0.560.56},
    {
0.500.60},
    {
0.440.56},
    {
0.400.50},
    {
0.440.44}
}
 
// NU SCHIMBA VALORILE DEJA EXISTENTE. Poti adauga mai multe culori, respectand matricea
new const g_iColors[][] =
{
    {
0127255}, // blue
    
{2551270}, // orange
    
{1270255}, // purple
    
{25500}, // red
    
{255100150}, // pink
    
{02550// green
}
 
public 
plugin_init()
{  
    new 
path[64];
    
get_localinfo("amxx_configsdir"pathcharsmax(path));
    
formatex(pathcharsmax(path), "%s/vip_maps.ini"path);
   
    new 
file fopen(path"r+");
   
    if(!
file_exists(path))
    {
        
write_file(path"; VIP-UL ESTE DEZACTIVAT PE URMATOARELE HARTI: ");
        
write_file(path"; Exemplu de adaugare HARTA:^n; ^"harta^"^n^nfy_snow^ncss_bycastor");
    }
   
    new 
mapname[32];
    
get_mapname(mapnamecharsmax(mapname));
   
    new 
text[121], maptext[32], bool:remove_vip false;
    while(!
feof(file))
    {
        
fgets(filetextcharsmax(text));
        
trim(text);
       
        if(
text[0] == ';' || !strlen(text))
        {
            continue;
        }
       
        
parse(textmaptextcharsmax(maptext));
       
        if(
equal(maptextmapname))
        {
            
log_amx("Am dezactivat pluginul 'VIP' pe harta %s."maptext);
            
remove_vip true;
            break;
        }
       
    }
    
fclose(file);
   
    if(!
remove_vip)
    {
        
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
 
        
register_event("DeathMsg""event_DeathMsg""a");
        
register_event("Damage""event_Damage""b""2>0""3=0");
        
register_event("HLTV""event_NewRound""a""1=0""2=0");
        
register_event("TextMsg""event_textmsg""a""2=#Game_will_restart_in")
 
        
RegisterHam(Ham_Spawn"player""fw_PlayerSpawnPost"1);
 
        
register_message(get_user_msgid("ScoreAttrib"), "msg_ScoreAttrib");
 
        
register_clcmd("say /vips""CmdVipsOnline");
        
register_clcmd("say_team /vips""CmdVipsOnline");
        
register_clcmd("say vips""CmdVipsOnline");
        
register_clcmd("say_team vips""CmdVipsOnline");
       
        
register_clcmd("say buyvip""CmdPrintAttributes");
        
register_clcmd("say_team buyvip""CmdPrintAttributes");
        
register_clcmd("say /buyvip""CmdPrintAttributes");
        
register_clcmd("say_team /buyvip""CmdPrintAttributes");
 
        
register_clcmd("say /rd""CmdResetDeaths");
        
register_clcmd("say_team /rd""CmdResetDeaths");
        
register_clcmd("say rd""CmdResetDeaths");
        
register_clcmd("say_team rd""CmdResetDeaths");

        
cvar[hp_spawn] = register_cvar("vip_hp_spawn""100");          // 0 = dezactivat
        
cvar[ap_spawn] = register_cvar("vip_ap_spawn""100");          // 0 = dezactivat
        
cvar[money_spawn] = register_cvar("vip_money_spawn""0");       // 0 = dezactivat
        
cvar[show_vip_tab] = register_cvar("vip_show_tab""1");            // 0 = dezactivat
        
cvar[show_bullet_dmg] = register_cvar("vip_show_bullet_dmg""1");      // 0 = dezactivat
        
cvar[multi_jump] = register_cvar("vip_multijump""0");         // 0 = dezactivat. Daca valoarea cvar-ului este 1, vei sari de 2 ori. Orice valoare pui, va fi +1 jump
        
cvar[hp_kill] = register_cvar("vip_hp_kill""5");              // 0 = dezactivat
        
cvar[hp_hs] = register_cvar("vip_hp_hs""10");             // 0 = dezactivat
        
cvar[ap_kill] = register_cvar("vip_ap_kill""5");              // 0 = dezactivat
        
cvar[ap_hs] = register_cvar("vip_ap_hs""10");             // 0 = dezactivat
        
cvar[hp_max] = register_cvar("vip_hp_max""120");          // 0 = viata infinita
        
cvar[money_kill] = register_cvar("vip_money_kill""350");          // 0 = dezactivat
        
cvar[money_hs] = register_cvar("vip_money_hs""450");          // 0 = dezactivat
        
cvar[parachute] = register_cvar("vip_parachute""0");          // 0 = dezactivat
 
        
max_players get_maxplayers();
    }
    else
    {
        
register_plugin(PLUGIN_NAME_PAUSEDPLUGIN_VERSIONPLUGIN_AUTHOR);
        
pause("ade");
    }
   
    
register_cvar("vip_"PLUGIN_VERSIONFCVAR_SPONLY|FCVAR_SERVER);
    
set_cvar_string("vip_"PLUGIN_VERSION);
}
 
public 
client_putinserver(id)
{
    
g_JumpNum[id] = 0;
    
g_bJump[id] = false;
}
 
public 
CmdVipsOnline(id)
{
    if(!
is_user_connected(id))
        return 
PLUGIN_CONTINUE;
 
    new 
adminnames[33][32], message[256], icountlen;
    
len format(messagecharsmax(message), "!4%s!3 VIPS ONLINE: "TAG);
    for(
<= max_playersi++)
    {
        if(
is_user_connected(i) && is_user_vip(i))
            
get_user_name(iadminnames[count++], charsmax(adminnames[]));
    }
   
    if(
count 0)
    {
        for(
0counti++)
        {
            
len += format(message[len], 255 -len"!4%s!1%s "adminnames[i], < (count -1) ? " | " "");
        }
        
ColorChat(idmessage);
    }
    else
    {
        
len += format(message[len], 255 -len"!4No one !")
        
ColorChat(idmessage);
    }
 
    return 
PLUGIN_CONTINUE;
}
 
public 
CmdPrintAttributes(id)
{
    if(!
is_user_connected(id)) return;
    
show_motd(id"vip.txt""Beneficii VIP");
}
 
public 
CmdResetDeaths(id)
{
    if(!
is_user_vip(id))
    {
        
ColorChat(id"!4%s!1 Doar membri!3 VIP!1 isi pot reseta decesele."TAG);
        return;
    }
    
cs_set_user_deaths(id0);
    
cs_set_user_deaths(id0);
    
ColorChat(id"!4%s!1 Ti-ai resetat cu succes toate decesele."TAG);
}

 
public 
client_PreThink(id)
{
    new 
cache get_pcvar_num(cvar[multi_jump]);
    if(
is_user_alive(id) && !is_user_vip(id))
        return 
PLUGIN_CONTINUE;
 
    new 
nbut get_user_button(id);
    new 
obut get_user_oldbutton(id);
 
    if(
cache != 0)
    {  
        if((
nbut IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut IN_JUMP))
        {
            if(
g_JumpNum[id] < cache)
            {
                
g_bJump[id] = true;
                
g_JumpNum[id]++;
                return 
PLUGIN_CONTINUE;
            }
        }
   
        if((
nbut IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
        {
            
g_JumpNum[id] = 0;
            return 
PLUGIN_CONTINUE;
        }
    }
 
    if(
get_pcvar_num(cvar[parachute]))
    {
        new 
Float:fallspeed 100.0 * -1.0;
        if(
nbut IN_USE)
        {
            new 
Float:velocity[3];
            
entity_get_vector(idEV_VEC_velocityvelocity);
            if(
velocity[2] < 0.0)
            {
                
entity_set_int(idEV_INT_sequence3);
                
entity_set_int(idEV_INT_gaitsequence1);
                
entity_set_float(idEV_FL_frame1.0);
                
entity_set_float(idEV_FL_framerate1.0);
 
                
velocity[2] = (velocity[2] + 40.0 fallspeed) ? velocity[2] + 40.0 fallspeed;
                
entity_set_vector(idEV_VEC_velocityvelocity);
            }
        }
    }
    return 
PLUGIN_CONTINUE;
}
 
public 
client_PostThink(id)
{
    new 
jump_num get_pcvar_num(cvar[multi_jump]);
    if(!
jump_num)
        return 
PLUGIN_CONTINUE;
       
    if(
is_user_alive(id) && !is_user_vip(id))
        return 
PLUGIN_CONTINUE;
   
    if(
g_bJump[id])
    {
        new 
Float:fVelocity[3];
        
entity_get_vector(idEV_VEC_velocityfVelocity);
        
fVelocity[2] = random_float(265.0285.0);
        
entity_set_vector(idEV_VEC_velocityfVelocity);
       
        
g_bJump[id] = false;
        return 
PLUGIN_CONTINUE;
    }
   
    return 
PLUGIN_CONTINUE;
}
 
public 
event_DeathMsg()
{
    new 
killer read_data(1), hs read_data(3);  
    if(
is_user_alive(killer) && is_user_vip(killer))
    {
        if(
killer == read_data(2)) return PLUGIN_HANDLED;
 
        if(
hs && !user_has_weapon(killerCSW_HEGRENADE)) give_item(killer"weapon_hegrenade");
 
        new 
cache hs get_pcvar_num(cvar[hp_hs]) : get_pcvar_num(cvar[hp_kill]);
        if(
cache != 0set_user_health(killermin(get_user_health(killer) + cacheget_pcvar_num(cvar[hp_max])));
 
        
cache hs get_pcvar_num(cvar[ap_hs]) : get_pcvar_num(cvar[ap_kill]);
        if(
cache != 0set_user_armor(killermin(get_user_armor(killer) + cacheget_pcvar_num(cvar[hp_max])));
 
        
cache hs get_pcvar_num(cvar[money_hs]) : get_pcvar_num(cvar[money_kill]);
        if(
cache != 0cs_set_user_money(killermin(cs_get_user_money(killer) + cache16000));
    }
 
    return 
PLUGIN_CONTINUE;
}
 
public 
event_Damage(victim)
{
    if(!
get_pcvar_num(cvar[show_bullet_dmg]))
        return 
PLUGIN_CONTINUE;
       
    new 
id get_user_attacker(victim);
    if(
is_user_valid(id))
    {
        if(
is_user_alive(id) && !is_user_vip(id))
            return 
PLUGIN_HANDLED;
       
        if(
read_data(4) || read_data(5) || read_data(6))
        {      
            new 
iPos = ++g_iPlayerPos[id];
            if(
iPos == sizeof(g_flCoords))
                
iPos g_iPlayerPos[id] = 0;
           
            new 
iCol = ++g_iPlayerCol[id];
            if(
iCol == sizeof(g_iColors))
                
iCol g_iPlayerCol[id] = 0;
           
            
set_hudmessage(g_iColors[iCol][0], g_iColors[iCol][1], g_iColors[iCol][2], Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 00.12.50.020.02, -1);
            
show_hudmessage(id"%d"read_data(2));
        }
    }
   
    return 
PLUGIN_CONTINUE;
}

public 
event_NewRound()
{
    
rounds++;
}
 
public 
event_textmsg()
{
    
rounds 1;
}
 
public 
fw_PlayerSpawnPost(id)
{
    if(
is_user_vip(id) && is_user_alive(id))
    {
        
set_task(0.25"give_items"id 212);
        return 
HAM_IGNORED;
    }
   
    return 
HAM_IGNORED;
}
 
public 
give_items(taskid)
{
    new 
id taskid 212;
    if(!
is_user_alive(id))
        return;
 
    new 
cache get_pcvar_num(cvar[hp_spawn])
    if(
cache != 0set_user_health(idcache);
 
    
cache get_pcvar_num(cvar[ap_spawn]);
    if(
cache != 0cs_set_user_armor(idcacheCS_ARMOR_VESTHELM);
 
    
cache get_pcvar_num(cvar[money_spawn]);
    if(
cache != 0cs_set_user_money(idmin(cs_get_user_money(id) + cache16000));
 
    if(
rounds >= 3ShowVipMenu(id);
}
 
public 
msg_ScoreAttrib(msgiddestid)
{
    if(!
get_pcvar_num(cvar[show_vip_tab]))
        return 
PLUGIN_CONTINUE;
       
    new 
id get_msg_arg_int(1);
    if(
is_user_connected(id) && is_user_vip(id))
        
set_msg_arg_int(2ARG_BYTEis_user_alive(id) ? (1<<2) : (1<<0));
   
    return 
PLUGIN_CONTINUE;
}
 
public 
ShowVipMenu(id)
{
    if(!
is_user_connected(id))
        return 
PLUGIN_HANDLED;
 
    if(!
is_user_vip(id))
    {
        
ColorChat(id"!4%s!1 Imi pare rau, dar nu ai acces la meniul pentru!3 membrii VIP!1."TAG);
        
ColorChat(id"!4%s!1 Poti cumpara VIP, contactand adresa Y!M:!3 %s!1."TAGCONTACT);
        return 
PLUGIN_HANDLED;
    }
 
    
give_item(id"weapon_hegrenade");
    
give_item(id"weapon_flashbang");
    
give_item(id"weapon_flashbang");
    
drop_weapons(id2);
    
give_item(id"weapon_deagle");
    
cs_set_user_bpammo(idCSW_DEAGLE35);
 
    new 
menu menu_create("[V.I.P MENU]""VipMenuHandler");
    
menu_additem(menu"M4A1 + Echipament""1");
    
menu_additem(menu"AK-47 + Echipament""2");
    
menu_additem(menu"AWP + Echipament""3");
   
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
   
    return 
PLUGIN_CONTINUE;
}
 
public 
VipMenuHandler(idmenuitem)
{
    if(!
is_user_connected(id) || item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
 
    new 
data[6], namei[64], accessCallBack;
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), nameicharsmax(namei), CallBack);
    new 
key str_to_num(data);
 
    switch(
key)
    {
        case 
1:
        {
            
drop_weapons(id1);
            
give_item(id"weapon_m4a1");
            
cs_set_user_bpammo(idCSW_M4A1120);
           
            
ColorChat(id"!4%s!1 Ai ales!3 M4A1!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1)."TAG);
        }
 
        case 
2:
        {
            
drop_weapons(id1);
            
give_item(id"weapon_ak47");
            
cs_set_user_bpammo(idCSW_AK47120);
           
            
ColorChat(id"!4%s!1 Ai ales!3 AK47!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1)."TAG);
        }
 
        case 
3:
        {
            
drop_weapons(id1);
            
give_item(id"weapon_awp");
            
cs_set_user_bpammo(idCSW_AWP30);
           
            
ColorChat(id"!4%s!1 Ai ales!3 AWP!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1)."TAG);
        }
    }
 
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}
 
const 
PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const 
SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
 
// Drop primary/secondary weapons
stock drop_weapons(iddropwhat)
{
    
// Get user weapons
    
static weapons[32], numiweaponidwname[32];
    
num 0// reset passed weapons count (bugfix)
    
get_user_weapons(idweaponsnum);
   
    
// Loop through them and drop primaries or secondaries
    
for (0numi++)
    {
        
// Prevent re-indexing the array
        
weaponid weapons[i];
       
        if((
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            
// Get weapon entity
            
get_weaponname(weaponidwnamecharsmax(wname));
            
engclient_cmd(id"drop"wname);
        }
    }
}
 
stock ColorChat(idString[], any:...)
{
    static 
szMesage[192];
    
vformat(szMesagecharsmax(szMesage), String3);
   
    
replace_all(szMesagecharsmax(szMesage), "!1""^1");
    
replace_all(szMesagecharsmax(szMesage), "!3""^3");
    
replace_all(szMesagecharsmax(szMesage), "!4""^4");
   
    static 
g_msg_SayText 0;
    if(!
g_msg_SayText)
        
g_msg_SayText get_user_msgid("SayText");
   
    new 
Players[32], iNum 1i;
 
    if(
idPlayers[0] = id;
    else 
get_players(PlayersiNum"ch");
   
    for(--
iNumiNum >= 0iNum--)
    {
        
Players[iNum];
       
        
message_begin(MSG_ONE_UNRELIABLEg_msg_SayText_i);
        
write_byte(i);
        
write_string(szMesage);
        
message_end();
    }

I want the "x" flag to remain but to add EVENT FREE VIP - at certain hours
AlexandruODT is offline
Reply



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 02:14.


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