Raised This Month: $ Target: $400
 0% 

Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nesq
Junior Member
Join Date: Jan 2024
Old 02-22-2024 , 15:28   Menu
Reply With Quote #1

hello, Please help me, I want a plugin to give weapons to simple players. Players who do not have vip. It should not be necessary to have a flag.
The menu should contain:
Ts (1.Ak47 + deagle+ grenades,
2. M4a1+deagle+grenades)

to ct: ( 1. M4a1+deagle+grenades
2. Ak47+deagle+grenades)

I tried to modify a menu plugin for vip and I didn't succeed... I searched on the net and nothing. Please, if someone can help me, I will leave here the plugin intended for vip and which I want to modify to protect this menu for simple players who do not have a flag.
PHP Code:
#include amxmodx
#include amxmisc
#include cstrike
#include fun
#include hamsandwich
#include engine
#include fakemeta
#include csx
#if AMXX_VERSION_NUM < 183
#include colorchat
#endif

#define p. "VIP Clasic"
#define v. "9.0-c"
#define a. "Jicƒ Mƒcelaru'"

#define VIP_FLAG "r"

new const Floatg_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 }
};

new const 
g_szBeginning[] = "Membrii VIP";

new 
g_Cvar[30],
    
g_Round[33] = 0,
    
g_JumpNum[33], bool:g_DoJump[33],
    
g_iPosition[33], g_iSize,
    
g_szMessage[256], SyncHudMessage,
    
g_VipConfig[] = "vipConfig.cfg",
    
g_VipMaps[] = "vipMaps.ini",
    
g_File1[128], g_File2[128], 
    
bool:g_Use[33],
    
bool:g_Menu[33],
    
oms;

enum
{
    
Primary 1,
    
Secondary,
    
Knife,
    
Grenades,
    
C4
};

public 
plugin_init()
{
    
register_plugin p., v., a.;

    
register_clcmd "say""sayCommand";
    
register_clcmd "say_team""sayCommand";
    
    
g_Cvar[0] = register_cvar("vip_mode""2");
    
g_Cvar[1] = register_cvar("vip_tag""VIP");
    
g_Cvar[2] = register_cvar("vip_start_hp""150");
    
g_Cvar[3] = register_cvar("vip_start_ap""150");
    
g_Cvar[4] = register_cvar("vip_start_money""1000");
    
g_Cvar[5] = register_cvar("vip_jump""1");
    
g_Cvar[6] = register_cvar("vip_hp_kill""5");
    
g_Cvar[7] = register_cvar("vip_ap_kill""5");
    
g_Cvar[8] = register_cvar("vip_hp_hs""10");    
    
g_Cvar[9] = register_cvar("vip_ap_hs""10");
    
g_Cvar[10] = register_cvar("vip_hp_kill_knife""15");    
    
g_Cvar[11] = register_cvar("vip_ap_kill_knife""15");
    
g_Cvar[12] = register_cvar("vip_hp_hs_knife""20");
    
g_Cvar[13] = register_cvar("vip_ap_hs_knife""20");
    
g_Cvar[14] = register_cvar("vip_bulletdmg""1");
    
g_Cvar[16] = register_cvar("vip_in_out""1");
    
g_Cvar[17] = register_cvar("vip_show_chat""1");
    
g_Cvar[18] = register_cvar("vip_show_hud""1");
    
g_Cvar[19] = register_cvar("vip_max_hp""200");
    
g_Cvar[20] = register_cvar("vip_max_ap""200");
    
g_Cvar[21] = register_cvar("vip_parachute""1");
    
g_Cvar[22] = register_cvar("vip_money_kill""400");
    
g_Cvar[23] = register_cvar("vip_money_hs""600");
    
g_Cvar[24] = register_cvar("vip_bulletdmg_mode""1");
    
g_Cvar[25] = register_cvar("vip_tab""1");
    
g_Cvar[26] = register_cvar("vip_defusekit""1");
    
g_Cvar[27] = register_cvar("vip_free""1");
    
g_Cvar[28] = register_cvar("vip_free_start""22");
    
g_Cvar[29] = register_cvar("vip_free_end""08");

    
set_task 300.0"msgInfo"___"b";
    
set_task 1.0"showVipsH"___"b"0;
    
set_task 1.0"GiveVIP" ,_,_,_"b";
    
    
RegisterHam Ham_Spawn"player""Spawn"1;
    
    
SyncHudMessage CreateHudSyncObj();
    
g_iSize sizeof(g_flCoords);
    
    
register_event "HLTV""newRound""a""1=0""2=0";
    
register_event "ResetHUD""resetModel""b";
    
register_event "ResetHUD""vipTab""be";
}

public 
plugin_cfg()
{    
    new 
File[64];
    
    
get_configsdir Filecharsmax(File);
    
formatex g_File1charsmax(g_File1), "%s/%s"Fileg_VipConfig;
    
formatex g_File2charsmax(g_File2), "%s/%s"Fileg_VipMaps;
    
    if(!
file_exists(g_File1))
    {
        
write_file(g_File1"; Plugin VIP creat de Jicƒ Mƒcelaru' (aka. StefaN@CS, Devil., joker`)");
        
write_file(g_File1"; Plugin publicat pe www.indungi.ro/forum");
        
write_file(g_File1"; https://www.indungi.ro/forum/topic/829508-vip-clasic-90-vip_clasicamxx/");
        
write_file(g_File1"; Suport Counter-Strike 1.6 contra-cost");
        
write_file(g_File1"; Contact");
        
write_file(g_File1"; PM forum: https://www.indungi.ro/forum/profile/349550-jicƒ-mƒcelaru/");
        
write_file(g_File1"; Steam: https://steamcommunity.com/id/baulesscs161/");
        
write_file(g_File1"; Paypal: paypal.me/sacotia");
        
write_file(g_File1"; Cine considera ca l-am ajutat si ca merit. Multumesc!");
        
write_file(g_File1"");
        
write_file(g_File1"");
        
write_file(g_File1"");
        
write_file(g_File1"/////// Vip Configuration File");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Mode");
        
write_file(g_File1"// Setati modul de aparitie al meniului");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - meniu prin comanda /vmenu");
        
write_file(g_File1"// 2 - meniu din a 3-a runda");
        
write_file(g_File1"// Default: '1'");
        
write_file(g_File1"vip_mode ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Tag");
        
write_file(g_File1"// Setati tagul ce va aparea in chat in mesaje");
        
write_file(g_File1"// Default: 'VIP'");
        
write_file(g_File1"vip_tag ^"VIP^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Start");
        
write_file(g_File1"// Setati viata, armura si banii cu care va incepe vipul fiecare runda");
        
write_file(g_File1"// La bani setati cu cati bani in plus va incepe");
        
write_file(g_File1"// EX: VIP-ul are 800 bani si la spawn i se vor mai adauga inca 1000");
        
write_file(g_File1"// Default: 150, 150, 1000");
        
write_file(g_File1"vip_start_hp ^"150^"");
        
write_file(g_File1"vip_start_ap ^"150^"");
        
write_file(g_File1"vip_start_money ^"1000^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP HP/AP/BANI per kill/hs");
        
write_file(g_File1"// Setati cat hp/ap/bani sa primeasca vip-ul pe fiecare kill/hs facut in functie de cum este facut kill-ul/hs-ul");
        
write_file(g_File1"// Default: 5, 5, 10, 10, 15, 15, 20, 20, 400, 600");
        
write_file(g_File1"vip_hp_kill ^"5^"");
        
write_file(g_File1"vip_ap_kill ^"5^"");
        
write_file(g_File1"vip_hp_hs ^"10^"");
        
write_file(g_File1"vip_ap_hs ^"10^"");
        
write_file(g_File1"vip_hp_kill_knife ^"15^"");
        
write_file(g_File1"vip_ap_kill_knife ^"15^"");
        
write_file(g_File1"vip_hp_hs_knife ^"20^"");
        
write_file(g_File1"vip_ap_hs_knife ^"20^"");
        
write_file(g_File1"vip_money_kill ^"400^"");
        
write_file(g_File1"vip_money_hs ^"600^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Max HP/AP");
        
write_file(g_File1"// Setati maximul de hp/ap pe care il poate avea vipul");
        
write_file(g_File1"// Default: 200, 200");
        
write_file(g_File1"vip_max_hp ^"200^"");
        
write_file(g_File1"vip_max_ap ^"200^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Jump");
        
write_file(g_File1"// Setati cat poate sari vipul");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - 2x jump");
        
write_file(g_File1"// 2 - 3x jump");
        
write_file(g_File1"// 3 - 4x jump");
        
write_file(g_File1"// ...");
        
write_file(g_File1"// z - yx jump");
        
write_file(g_File1"Default: 1");
        
write_file(g_File1"vip_jump ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Parachute");
        
write_file(g_File1"// Setati daca vip-ul va avea sau nu parasuta");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_parachute ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Defuse Kit (Only CT)");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_defusekit ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Show");
        
write_file(g_File1"// Setati momentele in care vor fi afisati vipii");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Cand intra/iese de pe server cu mesaj in chat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_in_out ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Cand tastezi comanda /vips apare in chat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_show_chat ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Afisare in hud in coltul stang, sus");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_show_hud ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Afisare in TAB (ScoreBoard)");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_tab ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Bulletdamage + mode");
        
write_file(g_File1"// Setati daca vipul va avea bulletdamage");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_bulletdmg ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Setati modul de aparitie al bulletdamageului");
        
write_file(g_File1"// vip_bulletdmg trebuie sa fie setat pe 1");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - cerc multi color pentru ambele echipe");
        
write_file(g_File1"// 2 - cerc albastru/rosu (CT - albastru / T - rosu)");
        
write_file(g_File1"// 3 - centru multi color pentru ambele echipe");
        
write_file(g_File1"// 4 - centru albastru/rosu (CT - albastru / T - rosu)");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_bulletdmg_mode ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Model");
        
write_file(g_File1"// Setati daca vip-ul va avea model sau nu");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Daca doriti sa activati modelul, setati valoarea 1 si schimbati mapa de 2 ori ca sa se descarce modelele");
        
write_file(g_File1"// Daca doriti sa dezactivati modelul, setati valoarea 0 si schimbati mapa de 2 ori ca sa nu se mai descarce modelele");
        
write_file(g_File1"Default: 1");
        
write_file(g_File1"vip_model ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Free");
        
write_file(g_File1"// Setati daca va fi vip free sau nu pe server");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"vip_free ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Setati orele intre care va fi vip free");
        
write_file(g_File1"// Ore disponibile");
        
write_file(g_File1"// 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12");
        
write_file(g_File1"// 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 00");
        
write_file(g_File1"// Default: 22, 08");
        
write_file(g_File1"vip_free_start ^"22^"");
        
write_file(g_File1"vip_free_end ^"08^"");
    }
    
    
server_cmd "exec %s"g_File1;
    
    if(!
file_exists(g_File2))
    {
        
write_file(g_File2";--------------- | Lista hartilor pe care meniul vipului este restrictionat | ---------------");
        
write_file(g_File2"");
        
write_file(g_File2";Adaugati mapele una sub alta");
        
write_file(g_File2"");
        
write_file(g_File2"35hp");
        
write_file(g_File2"awp_india");
    }
}

public 
sayCommand(id)
{
    new 
Said[10];
    
read_args Saidcharsmax(Said);
    
remove_quotes(Said);
    
    if(
equal(Said"/vips")) showVipsC(id);
    else if(
equal(Said"/vip")) vipInfo(id);
    else if(
equal(Said"/vmenu"))
        if(
get_pcvar_num(g_Cvar[0]) == 1)
            if(
g_Menu[id] == true)
                
vipMenu(id);

    return 
0;
}

public 
client_putinserver(id)
{
    if(!(
get_user_flags(id) & read_flags(VIP_FLAG)))
        return 
1;
        
    
set_task 2.0"vipIn"id;
    
    
g_JumpNum[id] = 0;
    
g_DoJump[id] = false;
    
g_Round[id] = 0;
    
g_Use[id] = false;
    
g_Menu[id] = true;
    return 
1;
}

    
#if AMXX_VERSION_NUM < 183
public client_disconnect(id)
    
#else
public client_disconnected(id)
    
#endif
{
    if(!(
get_user_flags(id) & read_flags(VIP_FLAG)))
        return 
1;
        
    
set_task 2.0"vipOut"id;
    
    
g_JumpNum[id] = 0;
    
g_DoJump[id] = false;
    
g_Round[id] = 0;
    
g_Use[id] = false;
    
    return 
1;
}

public 
vipInfo(idshow_motd(id"/addons/amxmodx/configs/vipInfo.txt");

public 
msgInfo()
{
    new 
tag[32];
    
get_pcvar_string g_Cvar[1], tagcharsmax(tag);

        
#if AMXX_VERSION_NUM < 183
    
ColorChat 0GREEN"^3[%s] ^1Tastati in chat ^4/vip ^1pentru a vedea beneficiile si pretul vip-ului."tag;
        
#else
    
client_print_color 0print_team_default"^3[%s] ^1Tasta›i în chat ^4/vip ^1pentru a vedea beneficiile ™i pre›ul vip-ului."tag;
        
#endif
}

public 
plugin_precache()
{
    
g_Cvar[15] = register_cvar("vip_model""1");
    
    if(
get_pcvar_num(g_Cvar[15]) == 0)
        return 
1;

    
precache_model "models/player/vip_tero/vip_tero.mdl";
    
precache_model "models/player/vip_ct/vip_ct.mdl";

    return 
1;
}

public 
newRound()
    for(new 
032i++)
        
g_Use[i] = false;

public 
vipMenu(id)
{
    if(!
is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG)) || g_Use[id])
        return 
1;
    
    new 
menu;
    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_T:
        {
            
menu menu_create("\r[\dVIP-Menu\r] \yTerrorists""Ammunition");
            
menu_additem menu"Ak47+Deagle+Set grenade""1";
            
menu_additem menu"M4a1+Deagle+Set grenade""2";
        }

        case 
CS_TEAM_CT:
        {
            
menu menu_create("\r[\dVIP-Menu\r] \yCounter-Terorists""Ammunition");
            
menu_additem menu"M4a1+Deagle+Set grenade""1";
            
menu_additem menu"Ak47+Deagle+Set grenade""2";
        }
    }
    
menu_display idmenu0;
    return 
1;
}

public 
Ammunition(idmenuitem)
{
    if(
item == MENU_EXIT)
        return 
1;

    new 
accesscallbackdata[6], szName[64], tag[32];
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), szNamecharsmax(szName), callback);
    
get_pcvar_string g_Cvar[1], tagcharsmax(tag);
    new 
key str_to_num(data);
        
    if(
cs_get_user_team(id) == CS_TEAM_T)
    {
        switch(
key)
        {
            case 
1:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_ak47";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_AK4790;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
            
            case 
2:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_m4a1";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";                    cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_M4A190;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
    }
    
    if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        switch(
key)
        {
            case 
1:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_m4a1";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_M4A190;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
            
            case 
2:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_ak47";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_AK4790;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }     
", tag;
            }
    }
    
    menu_destroy(menu);
    return 1;  
}

public Spawn(id)

    if(!is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[0]) == 2)
    {
        if(g_Menu[id] == true)
            if(g_Round[id] > 2)
                vipMenu(id);
        
        g_Round[id]++;    
    }

    if(get_pcvar_num(g_Cvar[26]) == 1) if(cs_get_user_team(id) == CS_TEAM_CT) give_item id, "
item_thighpack";
    give_item id, "
item_assaultsuit";
    set_user_health id, get_pcvar_num(g_Cvar[2]);
    set_user_armor id, get_pcvar_num(g_Cvar[3]);
    cs_set_user_money id, clamp(cs_get_user_money(id) + get_pcvar_num(g_Cvar[4]), 0, 16000);    
    
    new MapName[32],
        szLine[128],
        iLen;
    new Size = file_size(g_File2, 1)    

    get_mapname(MapName, sizeof(MapName));
    for(new i = 0; i < Size; i ++)
    {
        read_file(g_File2, i, szLine, charsmax(szLine), iLen);
        if(equali(MapName, szLine))
            g_Menu[id] = false;
    }
    
    return 1;
}

public GiveVIP()
{
    if(get_pcvar_num(g_Cvar[27]) == 1)
    {
        time(o, m, s);
        
        if(o >= get_pcvar_num(g_Cvar[28]) && o < 24 || o >= 00 && o < get_pcvar_num(g_Cvar[29]))
        {
            for(new i = 1; i <= get_maxplayers(); i++)
                if(is_user_connected(i) || !is_user_bot(i) || !is_user_hltv(i) || !(get_user_flags(i) & read_flags(VIP_FLAG)))
                    set_user_flags i, read_flags(VIP_FLAG)

            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.02, 0, 1.0, 1.0;
            show_hudmessage 0, "", get_pcvar_num(g_Cvar[28]), get_pcvar_num(g_Cvar[29]);
        }
        
        if(o == get_pcvar_num(g_Cvar[29]) && m == 00 && s == 00) server_cmd("
amx_reloadadmins");
    }
}

public vipIn(id)
{
    if(!(get_user_flags(id) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[16]) == 1)
    {
        new tag[32], name[32];

        get_pcvar_string g_Cvar[1], tag, charsmax(tag); 
        get_user_name id, name, charsmax(name);

            #if AMXX_VERSION_NUM < 183
        ColorChat 0, GREEN, "
^3[%s] ^4%^1s-a conectat pe server.", tag, name;
            #else
        client_print_color 0, print_team_default, "
^3[%s] ^4%^1s-a conectat pe server.", tag, name;
            #endif
    }
    
    return 1;
}    

public vipOut(id)
{
    if(!(get_user_flags(id) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[16]) == 1)
    {
        new tag[32], name[32];

        get_pcvar_string g_Cvar[1], tag, charsmax(tag); 
        get_user_name id, name, charsmax(name);
        
            #if AMXX_VERSION_NUM < 183
        ColorChat 0, GREEN, "
^3[%s] ^4%^1s-a deconectat de pe server.", tag, name;
            #else
        client_print_color 0, print_team_default, "
^3[%s] ^4%^1s-a deconectat de pe server.", tag, name;
            #endif 
    }
    
    return 1;
}

public client_PreThink(id)
{
    if(!is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG))) 
        return 1;
        
    new Float:fallspeed = 100.0 * -1.0;
    new BUTTON = get_user_button(id);
    new OLDBUTON = get_user_oldbutton(id);
    new JUMP_VIP = get_pcvar_num(g_Cvar[5]);

    if((BUTTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
    {
        if(g_JumpNum[id] < JUMP_VIP)
        {
            g_DoJump[id] = true;
            g_JumpNum[id]++
        }
    }

    if((BUTTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
        g_JumpNum[id] = 0;
    
    if(get_pcvar_num(g_Cvar[21]) == 1)
    {
        if(BUTTON & IN_USE) 
        {
            new Float:velocity[3];
            entity_get_vector(id, EV_VEC_velocity, velocity);
        
            if(velocity[2] < 0.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;

                velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed;
                entity_set_vector id, EV_VEC_velocity, velocity;
            }
        }
    }
    
    return 0;
}

public client_PostThink(id)
{
    if(!is_user_alive(id)) 
        return 1;
        
    if(g_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;
        g_DoJump[id] = false;
    }

    return 0;
}

public client_death(killer, victim, weapon, hitplace)
{
    if(!(get_user_flags(killer) & read_flags(VIP_FLAG))) 
        return 1;
        
    new VIP_MAXHP = get_pcvar_num(g_Cvar[19]);
    new VIP_HP = get_user_health(killer);
    new VIP_MAXAP = get_pcvar_num(g_Cvar[20]);
    new VIP_AP = get_user_armor(killer);
    
    if(!(hitplace == HIT_HEAD) && !(weapon == CSW_KNIFE))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[6]) >= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[6]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[7]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[7]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[22]), 0, 16000);
    }
    
    if(hitplace == HIT_HEAD && !(weapon == CSW_KNIFE))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[8])>= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[8]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[9]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[9]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[23]), 0, 16000);
    }
    
    if(weapon == CSW_KNIFE && !(hitplace == HIT_HEAD))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[10]) >= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[10]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[11]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[11]);

        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[22]), 0, 16000);
    }
    
    if(weapon == CSW_KNIFE && (hitplace == HIT_HEAD))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[12]) >= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[12]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[13]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[13]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[23]), 0, 16000);
    }

    return 1;
}

public client_damage(iAttacker, iVictim, iDamage)
{
    if(!(get_user_flags(iAttacker) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[14]) == 1)
    {
        if(get_pcvar_num(g_Cvar[24]) == 1)
        {
            if(++g_iPosition[iAttacker] == g_iSize)
                g_iPosition[iAttacker] = 0;

            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
            show_hudmessage iAttacker, "
%i", iDamage;
        }
        
        else if(get_pcvar_num(g_Cvar[24]) == 2)
        {
            if(++g_iPosition[iAttacker] == g_iSize)
                g_iPosition[iAttacker] = 0;
            
            if(cs_get_user_team(iAttacker) == CS_TEAM_CT)
            {
                set_hudmessage 42, 170, 255, Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
            
            else if(cs_get_user_team(iAttacker) == CS_TEAM_T)
            {
                set_hudmessage 200, 0, 0, Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
        }
        
        else if(get_pcvar_num(g_Cvar[24]) == 3)
        {
            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
            show_hudmessage iAttacker, "
%i", iDamage;
        }

        else if(get_pcvar_num(g_Cvar[24]) == 4)
        {
            if(cs_get_user_team(iAttacker) == CS_TEAM_CT)
            {
                set_hudmessage 42, 170, 255, -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
            
            else if(cs_get_user_team(iAttacker) == CS_TEAM_T)
            {
                set_hudmessage 200, 0, 0, -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
        }
    }
    
    return 1;
}

public showVipsC(user)
{
    if(get_pcvar_num(g_Cvar[17]) == 1)
    {
        new tag[32];
        get_pcvar_string g_Cvar[1], tag, charsmax(tag);
    
        new vipNames[33][32];
        new message[256];
        new id, count, x, len;

        for(id = 0 ; id <= get_maxplayers() ; id++)
            if(is_user_connected(id))
                if(get_user_flags(id) & read_flags(VIP_FLAG))
                    get_user_name id, vipNames[count++], charsmax(vipNames[]);
    
        len = format(message, 255, "
^3[%s] ^1VIP-ii online sunt:^", tag);
        if(count > 0)
        {
            for(x = 0 ; x < count ; x++)
            {
                len += format(message[len], 255-len, "
%s%", vipNames[x], x < (count-1) ? "":"");
                if(len > 96)
                {
                    print_message(user, message);
                    len = format(message, 255, " ");
                }
            }
            
            print_message(user, message);
        }
        
        else
        {
                #if AMXX_VERSION_NUM < 183
            ColorChat user, GREEN, "
^3[%s] ^1Nu sunt ^4VIP^1-i online.", tag;
                #else
            client_print_color user, print_team_default, "
^3[%s] ^1Nu sunt ^4VIP^1-i online.", tag;
                #endif
        }            
    }
    return 0;  
}

print_message(id, msg[])
{
    message_begin(MSG_ONE, get_user_msgid("
SayText"), {0,0,0}, id);
    write_byte(id);
    write_string(msg);
    message_end();
}

public showVipsH()
{
    if(get_pcvar_num(g_Cvar[18]) == 1)
    {
        static iPlayers[32];
        static iPlayersNum;
    
        get_players(iPlayers, iPlayersNum, "
ch");
        if(!iPlayersNum)
            return 1;
    
        static iVipsConnected, szVipsNames[128], szName[32];
        formatex(szVipsNames, sizeof (szVipsNames) -1, "");
        iVipsConnected = 0;
    
        static id, i;
        for(i = 0; i < iPlayersNum; i++)
        {
            id = iPlayers[i];
            if(get_user_flags(id) & read_flags(VIP_FLAG))
            {
                get_user_name(id, szName, sizeof(szName) -1);
                
                add(szVipsNames, sizeof(szVipsNames) -1, szName);
                add(szVipsNames, sizeof(szVipsNames) -1, "
^n");
                
                iVipsConnected++;
            }    
        }
    
        formatex(g_szMessage, sizeof(g_szMessage) -1, "
%(%i)^n%s", g_szBeginning, iVipsConnected, szVipsNames);
        
        set_hudmessage 25, 255, 25, 0.01, 0.15, 0, 0.0, 1.0, 0.1, 0.1, -1;
        ShowSyncHudMsg 0, SyncHudMessage, g_szMessage;
    }
    return 0;    
}

public resetModel(id, level, cid)
{
    if(!is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG)) || get_pcvar_num(g_Cvar[15]) == 0)
       return 1;    

    new CsTeams:userTeam = cs_get_user_team(id)
    if(userTeam == CS_TEAM_T)
        cs_set_user_model id, "
vip_tero";
    else if(userTeam == CS_TEAM_CT)
        cs_set_user_model id, "
vip_ct";
    else
        cs_reset_user_model(id);

    return 0;
}

public vipTab(id) 
    if(get_pcvar_num(g_Cvar[25]) == 1)
        set_task 0.5, "
setVipTab", id + 6910;

public setVipTab(TaskID)
{
    new id = TaskID - 6910;
    
    if(get_user_flags(id) & read_flags(VIP_FLAG))
    {
        message_begin(MSG_ALL, get_user_msgid("
ScoreAttrib"));
        write_byte(id);
        write_byte(4);
        message_end();
    }
    
    return 1;


stock StripWeapons(id, Type, bool: bSwitchIfActive = true)
{
    new iReturn;
   
    if(is_user_alive(id))
    {
        new iEntity, iWeapon;
        while((iWeapon = GetWeaponFromSlot(id, Type, iEntity)) > 0)
            iReturn = ham_strip_user_weapon(id, iWeapon, Type, bSwitchIfActive);
    }
   
    return iReturn;
}

stock GetWeaponFromSlot( id , iSlot , &iEntity )
{
    if ( !( 1 <= iSlot <= 5 ) )
        return 0;
   
    iEntity = 0;
    const m_rgpPlayerItems_Slot0 = 367;
    const m_iId = 43;
    const XO_WEAPONS = 4;
    const XO_PLAYER = 5;
       
    iEntity = get_pdata_cbase( id , m_rgpPlayerItems_Slot0 + iSlot , XO_PLAYER );
   
    return ( iEntity > 0 ) ? get_pdata_int( iEntity , m_iId , XO_WEAPONS ) : 0;
}  
 
stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool: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
            1 //CSW_P90
        }
        iSlot = iWeaponsSlots[iCswId]
    }
 
    const XTRA_OFS_PLAYER = 5
    const m_rgpPlayerItems_Slot0 = 367
 
    iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER)
 
    const XTRA_OFS_WEAPON = 4
    const m_pNext = 42
    const m_iId = 43
 
    while( iWeapon > 0 )
    {
        if( get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId )
        {
            break
        }
        iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON)
    }
 
    if( iWeapon > 0 )
    {
        const m_pActiveItem = 373
        if( bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon )
        {
            ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon)
        }
 
        if( ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon) )
        {
            user_has_weapon(id, iCswId, 0)
            ExecuteHamB(Ham_Item_Kill, iWeapon)
            return 1
        }
    }
 
    return 0

-not to work on maps like fy_ awp_
-To give the menu from the 3rd round.
-Let the player still have the parachute.
-And keep the bullet damage.
That's it, maybe someone can help me, please, I'm so dumb

Last edited by nesq; 02-22-2024 at 15:30.
nesq is offline
nesq
Junior Member
Join Date: Jan 2024
Old 02-25-2024 , 14:50   Re: Menu
Reply With Quote #2

Quote:
Originally Posted by nesq View Post
hello, Please help me, I want a plugin to give weapons to simple players. Players who do not have vip. It should not be necessary to have a flag.
The menu should contain:
Ts (1.Ak47 + deagle+ grenades,
2. M4a1+deagle+grenades)

to ct: ( 1. M4a1+deagle+grenades
2. Ak47+deagle+grenades)

I tried to modify a menu plugin for vip and I didn't succeed... I searched on the net and nothing. Please, if someone can help me, I will leave here the plugin intended for vip and which I want to modify to protect this menu for simple players who do not have a flag.
PHP Code:
#include amxmodx
#include amxmisc
#include cstrike
#include fun
#include hamsandwich
#include engine
#include fakemeta
#include csx
#if AMXX_VERSION_NUM < 183
#include colorchat
#endif

#define p. "VIP Clasic"
#define v. "9.0-c"
#define a. "Jică Măcelaru'"

#define VIP_FLAG "r"

new const Floatg_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 }
};

new const 
g_szBeginning[] = "Membrii VIP";

new 
g_Cvar[30],
    
g_Round[33] = 0,
    
g_JumpNum[33], bool:g_DoJump[33],
    
g_iPosition[33], g_iSize,
    
g_szMessage[256], SyncHudMessage,
    
g_VipConfig[] = "vipConfig.cfg",
    
g_VipMaps[] = "vipMaps.ini",
    
g_File1[128], g_File2[128], 
    
bool:g_Use[33],
    
bool:g_Menu[33],
    
oms;

enum
{
    
Primary 1,
    
Secondary,
    
Knife,
    
Grenades,
    
C4
};

public 
plugin_init()
{
    
register_plugin p., v., a.;

    
register_clcmd "say""sayCommand";
    
register_clcmd "say_team""sayCommand";
    
    
g_Cvar[0] = register_cvar("vip_mode""2");
    
g_Cvar[1] = register_cvar("vip_tag""VIP");
    
g_Cvar[2] = register_cvar("vip_start_hp""150");
    
g_Cvar[3] = register_cvar("vip_start_ap""150");
    
g_Cvar[4] = register_cvar("vip_start_money""1000");
    
g_Cvar[5] = register_cvar("vip_jump""1");
    
g_Cvar[6] = register_cvar("vip_hp_kill""5");
    
g_Cvar[7] = register_cvar("vip_ap_kill""5");
    
g_Cvar[8] = register_cvar("vip_hp_hs""10");    
    
g_Cvar[9] = register_cvar("vip_ap_hs""10");
    
g_Cvar[10] = register_cvar("vip_hp_kill_knife""15");    
    
g_Cvar[11] = register_cvar("vip_ap_kill_knife""15");
    
g_Cvar[12] = register_cvar("vip_hp_hs_knife""20");
    
g_Cvar[13] = register_cvar("vip_ap_hs_knife""20");
    
g_Cvar[14] = register_cvar("vip_bulletdmg""1");
    
g_Cvar[16] = register_cvar("vip_in_out""1");
    
g_Cvar[17] = register_cvar("vip_show_chat""1");
    
g_Cvar[18] = register_cvar("vip_show_hud""1");
    
g_Cvar[19] = register_cvar("vip_max_hp""200");
    
g_Cvar[20] = register_cvar("vip_max_ap""200");
    
g_Cvar[21] = register_cvar("vip_parachute""1");
    
g_Cvar[22] = register_cvar("vip_money_kill""400");
    
g_Cvar[23] = register_cvar("vip_money_hs""600");
    
g_Cvar[24] = register_cvar("vip_bulletdmg_mode""1");
    
g_Cvar[25] = register_cvar("vip_tab""1");
    
g_Cvar[26] = register_cvar("vip_defusekit""1");
    
g_Cvar[27] = register_cvar("vip_free""1");
    
g_Cvar[28] = register_cvar("vip_free_start""22");
    
g_Cvar[29] = register_cvar("vip_free_end""08");

    
set_task 300.0"msgInfo"___"b";
    
set_task 1.0"showVipsH"___"b"0;
    
set_task 1.0"GiveVIP" ,_,_,_"b";
    
    
RegisterHam Ham_Spawn"player""Spawn"1;
    
    
SyncHudMessage CreateHudSyncObj();
    
g_iSize sizeof(g_flCoords);
    
    
register_event "HLTV""newRound""a""1=0""2=0";
    
register_event "ResetHUD""resetModel""b";
    
register_event "ResetHUD""vipTab""be";
}

public 
plugin_cfg()
{    
    new 
File[64];
    
    
get_configsdir Filecharsmax(File);
    
formatex g_File1charsmax(g_File1), "%s/%s"Fileg_VipConfig;
    
formatex g_File2charsmax(g_File2), "%s/%s"Fileg_VipMaps;
    
    if(!
file_exists(g_File1))
    {
        
write_file(g_File1"; Plugin VIP creat de Jică Măcelaru' (aka. StefaN@CS, Devil., joker`)");
        
write_file(g_File1"; Plugin publicat pe www.indungi.ro/forum");
        
write_file(g_File1"; https://www.indungi.ro/forum/topic/829508-vip-clasic-90-vip_clasicamxx/");
        
write_file(g_File1"; Suport Counter-Strike 1.6 contra-cost");
        
write_file(g_File1"; Contact");
        
write_file(g_File1"; PM forum: https://www.indungi.ro/forum/profile/349550-jică-măcelaru/");
        
write_file(g_File1"; Steam: https://steamcommunity.com/id/baulesscs161/");
        
write_file(g_File1"; Paypal: paypal.me/sacotia");
        
write_file(g_File1"; Cine considera ca l-am ajutat si ca merit. Multumesc!");
        
write_file(g_File1"");
        
write_file(g_File1"");
        
write_file(g_File1"");
        
write_file(g_File1"/////// Vip Configuration File");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Mode");
        
write_file(g_File1"// Setati modul de aparitie al meniului");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - meniu prin comanda /vmenu");
        
write_file(g_File1"// 2 - meniu din a 3-a runda");
        
write_file(g_File1"// Default: '1'");
        
write_file(g_File1"vip_mode ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Tag");
        
write_file(g_File1"// Setati tagul ce va aparea in chat in mesaje");
        
write_file(g_File1"// Default: 'VIP'");
        
write_file(g_File1"vip_tag ^"VIP^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Start");
        
write_file(g_File1"// Setati viata, armura si banii cu care va incepe vipul fiecare runda");
        
write_file(g_File1"// La bani setati cu cati bani in plus va incepe");
        
write_file(g_File1"// EX: VIP-ul are 800 bani si la spawn i se vor mai adauga inca 1000");
        
write_file(g_File1"// Default: 150, 150, 1000");
        
write_file(g_File1"vip_start_hp ^"150^"");
        
write_file(g_File1"vip_start_ap ^"150^"");
        
write_file(g_File1"vip_start_money ^"1000^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP HP/AP/BANI per kill/hs");
        
write_file(g_File1"// Setati cat hp/ap/bani sa primeasca vip-ul pe fiecare kill/hs facut in functie de cum este facut kill-ul/hs-ul");
        
write_file(g_File1"// Default: 5, 5, 10, 10, 15, 15, 20, 20, 400, 600");
        
write_file(g_File1"vip_hp_kill ^"5^"");
        
write_file(g_File1"vip_ap_kill ^"5^"");
        
write_file(g_File1"vip_hp_hs ^"10^"");
        
write_file(g_File1"vip_ap_hs ^"10^"");
        
write_file(g_File1"vip_hp_kill_knife ^"15^"");
        
write_file(g_File1"vip_ap_kill_knife ^"15^"");
        
write_file(g_File1"vip_hp_hs_knife ^"20^"");
        
write_file(g_File1"vip_ap_hs_knife ^"20^"");
        
write_file(g_File1"vip_money_kill ^"400^"");
        
write_file(g_File1"vip_money_hs ^"600^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Max HP/AP");
        
write_file(g_File1"// Setati maximul de hp/ap pe care il poate avea vipul");
        
write_file(g_File1"// Default: 200, 200");
        
write_file(g_File1"vip_max_hp ^"200^"");
        
write_file(g_File1"vip_max_ap ^"200^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Jump");
        
write_file(g_File1"// Setati cat poate sari vipul");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - 2x jump");
        
write_file(g_File1"// 2 - 3x jump");
        
write_file(g_File1"// 3 - 4x jump");
        
write_file(g_File1"// ...");
        
write_file(g_File1"// z - yx jump");
        
write_file(g_File1"Default: 1");
        
write_file(g_File1"vip_jump ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Parachute");
        
write_file(g_File1"// Setati daca vip-ul va avea sau nu parasuta");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_parachute ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Defuse Kit (Only CT)");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_defusekit ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Show");
        
write_file(g_File1"// Setati momentele in care vor fi afisati vipii");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Cand intra/iese de pe server cu mesaj in chat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_in_out ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Cand tastezi comanda /vips apare in chat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_show_chat ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Afisare in hud in coltul stang, sus");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_show_hud ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Afisare in TAB (ScoreBoard)");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_tab ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Bulletdamage + mode");
        
write_file(g_File1"// Setati daca vipul va avea bulletdamage");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_bulletdmg ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Setati modul de aparitie al bulletdamageului");
        
write_file(g_File1"// vip_bulletdmg trebuie sa fie setat pe 1");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - cerc multi color pentru ambele echipe");
        
write_file(g_File1"// 2 - cerc albastru/rosu (CT - albastru / T - rosu)");
        
write_file(g_File1"// 3 - centru multi color pentru ambele echipe");
        
write_file(g_File1"// 4 - centru albastru/rosu (CT - albastru / T - rosu)");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_bulletdmg_mode ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Model");
        
write_file(g_File1"// Setati daca vip-ul va avea model sau nu");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Daca doriti sa activati modelul, setati valoarea 1 si schimbati mapa de 2 ori ca sa se descarce modelele");
        
write_file(g_File1"// Daca doriti sa dezactivati modelul, setati valoarea 0 si schimbati mapa de 2 ori ca sa nu se mai descarce modelele");
        
write_file(g_File1"Default: 1");
        
write_file(g_File1"vip_model ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Free");
        
write_file(g_File1"// Setati daca va fi vip free sau nu pe server");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"vip_free ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Setati orele intre care va fi vip free");
        
write_file(g_File1"// Ore disponibile");
        
write_file(g_File1"// 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12");
        
write_file(g_File1"// 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 00");
        
write_file(g_File1"// Default: 22, 08");
        
write_file(g_File1"vip_free_start ^"22^"");
        
write_file(g_File1"vip_free_end ^"08^"");
    }
    
    
server_cmd "exec %s"g_File1;
    
    if(!
file_exists(g_File2))
    {
        
write_file(g_File2";--------------- | Lista hartilor pe care meniul vipului este restrictionat | ---------------");
        
write_file(g_File2"");
        
write_file(g_File2";Adaugati mapele una sub alta");
        
write_file(g_File2"");
        
write_file(g_File2"35hp");
        
write_file(g_File2"awp_india");
    }
}

public 
sayCommand(id)
{
    new 
Said[10];
    
read_args Saidcharsmax(Said);
    
remove_quotes(Said);
    
    if(
equal(Said"/vips")) showVipsC(id);
    else if(
equal(Said"/vip")) vipInfo(id);
    else if(
equal(Said"/vmenu"))
        if(
get_pcvar_num(g_Cvar[0]) == 1)
            if(
g_Menu[id] == true)
                
vipMenu(id);

    return 
0;
}

public 
client_putinserver(id)
{
    if(!(
get_user_flags(id) & read_flags(VIP_FLAG)))
        return 
1;
        
    
set_task 2.0"vipIn"id;
    
    
g_JumpNum[id] = 0;
    
g_DoJump[id] = false;
    
g_Round[id] = 0;
    
g_Use[id] = false;
    
g_Menu[id] = true;
    return 
1;
}

    
#if AMXX_VERSION_NUM < 183
public client_disconnect(id)
    
#else
public client_disconnected(id)
    
#endif
{
    if(!(
get_user_flags(id) & read_flags(VIP_FLAG)))
        return 
1;
        
    
set_task 2.0"vipOut"id;
    
    
g_JumpNum[id] = 0;
    
g_DoJump[id] = false;
    
g_Round[id] = 0;
    
g_Use[id] = false;
    
    return 
1;
}

public 
vipInfo(idshow_motd(id"/addons/amxmodx/configs/vipInfo.txt");

public 
msgInfo()
{
    new 
tag[32];
    
get_pcvar_string g_Cvar[1], tagcharsmax(tag);

        
#if AMXX_VERSION_NUM < 183
    
ColorChat 0GREEN"^3[%s] ^1Tastati in chat ^4/vip ^1pentru a vedea beneficiile si pretul vip-ului."tag;
        
#else
    
client_print_color 0print_team_default"^3[%s] ^1Tastați în chat ^4/vip ^1pentru a vedea beneficiile și prețul vip-ului."tag;
        
#endif
}

public 
plugin_precache()
{
    
g_Cvar[15] = register_cvar("vip_model""1");
    
    if(
get_pcvar_num(g_Cvar[15]) == 0)
        return 
1;

    
precache_model "models/player/vip_tero/vip_tero.mdl";
    
precache_model "models/player/vip_ct/vip_ct.mdl";

    return 
1;
}

public 
newRound()
    for(new 
032i++)
        
g_Use[i] = false;

public 
vipMenu(id)
{
    if(!
is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG)) || g_Use[id])
        return 
1;
    
    new 
menu;
    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_T:
        {
            
menu menu_create("\r[\dVIP-Menu\r] \yTerrorists""Ammunition");
            
menu_additem menu"Ak47+Deagle+Set grenade""1";
            
menu_additem menu"M4a1+Deagle+Set grenade""2";
        }

        case 
CS_TEAM_CT:
        {
            
menu menu_create("\r[\dVIP-Menu\r] \yCounter-Terorists""Ammunition");
            
menu_additem menu"M4a1+Deagle+Set grenade""1";
            
menu_additem menu"Ak47+Deagle+Set grenade""2";
        }
    }
    
menu_display idmenu0;
    return 
1;
}

public 
Ammunition(idmenuitem)
{
    if(
item == MENU_EXIT)
        return 
1;

    new 
accesscallbackdata[6], szName[64], tag[32];
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), szNamecharsmax(szName), callback);
    
get_pcvar_string g_Cvar[1], tagcharsmax(tag);
    new 
key str_to_num(data);
        
    if(
cs_get_user_team(id) == CS_TEAM_T)
    {
        switch(
key)
        {
            case 
1:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_ak47";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_AK4790;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
            
            case 
2:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_m4a1";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";                    cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_M4A190;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
    }
    
    if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        switch(
key)
        {
            case 
1:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_m4a1";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_M4A190;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
            
            case 
2:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_ak47";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_AK4790;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }     
", tag;
            }
    }
    
    menu_destroy(menu);
    return 1;  
}

public Spawn(id)

    if(!is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[0]) == 2)
    {
        if(g_Menu[id] == true)
            if(g_Round[id] > 2)
                vipMenu(id);
        
        g_Round[id]++;    
    }

    if(get_pcvar_num(g_Cvar[26]) == 1) if(cs_get_user_team(id) == CS_TEAM_CT) give_item id, "
item_thighpack";
    give_item id, "
item_assaultsuit";
    set_user_health id, get_pcvar_num(g_Cvar[2]);
    set_user_armor id, get_pcvar_num(g_Cvar[3]);
    cs_set_user_money id, clamp(cs_get_user_money(id) + get_pcvar_num(g_Cvar[4]), 0, 16000);    
    
    new MapName[32],
        szLine[128],
        iLen;
    new Size = file_size(g_File2, 1)    

    get_mapname(MapName, sizeof(MapName));
    for(new i = 0; i < Size; i ++)
    {
        read_file(g_File2, i, szLine, charsmax(szLine), iLen);
        if(equali(MapName, szLine))
            g_Menu[id] = false;
    }
    
    return 1;
}

public GiveVIP()
{
    if(get_pcvar_num(g_Cvar[27]) == 1)
    {
        time(o, m, s);
        
        if(o >= get_pcvar_num(g_Cvar[28]) && o < 24 || o >= 00 && o < get_pcvar_num(g_Cvar[29]))
        {
            for(new i = 1; i <= get_maxplayers(); i++)
                if(is_user_connected(i) || !is_user_bot(i) || !is_user_hltv(i) || !(get_user_flags(i) & read_flags(VIP_FLAG)))
                    set_user_flags i, read_flags(VIP_FLAG)

            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.02, 0, 1.0, 1.0;
            show_hudmessage 0, "", get_pcvar_num(g_Cvar[28]), get_pcvar_num(g_Cvar[29]);
        }
        
        if(o == get_pcvar_num(g_Cvar[29]) && m == 00 && s == 00) server_cmd("
amx_reloadadmins");
    }
}

public vipIn(id)
{
    if(!(get_user_flags(id) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[16]) == 1)
    {
        new tag[32], name[32];

        get_pcvar_string g_Cvar[1], tag, charsmax(tag); 
        get_user_name id, name, charsmax(name);

            #if AMXX_VERSION_NUM < 183
        ColorChat 0, GREEN, "
^3[%s] ^4%^1s-a conectat pe server.", tag, name;
            #else
        client_print_color 0, print_team_default, "
^3[%s] ^4%^1s-a conectat pe server.", tag, name;
            #endif
    }
    
    return 1;
}    

public vipOut(id)
{
    if(!(get_user_flags(id) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[16]) == 1)
    {
        new tag[32], name[32];

        get_pcvar_string g_Cvar[1], tag, charsmax(tag); 
        get_user_name id, name, charsmax(name);
        
            #if AMXX_VERSION_NUM < 183
        ColorChat 0, GREEN, "
^3[%s] ^4%^1s-a deconectat de pe server.", tag, name;
            #else
        client_print_color 0, print_team_default, "
^3[%s] ^4%^1s-a deconectat de pe server.", tag, name;
            #endif 
    }
    
    return 1;
}

public client_PreThink(id)
{
    if(!is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG))) 
        return 1;
        
    new Float:fallspeed = 100.0 * -1.0;
    new BUTTON = get_user_button(id);
    new OLDBUTON = get_user_oldbutton(id);
    new JUMP_VIP = get_pcvar_num(g_Cvar[5]);

    if((BUTTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
    {
        if(g_JumpNum[id] < JUMP_VIP)
        {
            g_DoJump[id] = true;
            g_JumpNum[id]++
        }
    }

    if((BUTTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
        g_JumpNum[id] = 0;
    
    if(get_pcvar_num(g_Cvar[21]) == 1)
    {
        if(BUTTON & IN_USE) 
        {
            new Float:velocity[3];
            entity_get_vector(id, EV_VEC_velocity, velocity);
        
            if(velocity[2] < 0.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;

                velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed;
                entity_set_vector id, EV_VEC_velocity, velocity;
            }
        }
    }
    
    return 0;
}

public client_PostThink(id)
{
    if(!is_user_alive(id)) 
        return 1;
        
    if(g_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;
        g_DoJump[id] = false;
    }

    return 0;
}

public client_death(killer, victim, weapon, hitplace)
{
    if(!(get_user_flags(killer) & read_flags(VIP_FLAG))) 
        return 1;
        
    new VIP_MAXHP = get_pcvar_num(g_Cvar[19]);
    new VIP_HP = get_user_health(killer);
    new VIP_MAXAP = get_pcvar_num(g_Cvar[20]);
    new VIP_AP = get_user_armor(killer);
    
    if(!(hitplace == HIT_HEAD) && !(weapon == CSW_KNIFE))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[6]) >= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[6]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[7]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[7]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[22]), 0, 16000);
    }
    
    if(hitplace == HIT_HEAD && !(weapon == CSW_KNIFE))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[8])>= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[8]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[9]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[9]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[23]), 0, 16000);
    }
    
    if(weapon == CSW_KNIFE && !(hitplace == HIT_HEAD))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[10]) >= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[10]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[11]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[11]);

        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[22]), 0, 16000);
    }
    
    if(weapon == CSW_KNIFE && (hitplace == HIT_HEAD))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[12]) >= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[12]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[13]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[13]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[23]), 0, 16000);
    }

    return 1;
}

public client_damage(iAttacker, iVictim, iDamage)
{
    if(!(get_user_flags(iAttacker) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[14]) == 1)
    {
        if(get_pcvar_num(g_Cvar[24]) == 1)
        {
            if(++g_iPosition[iAttacker] == g_iSize)
                g_iPosition[iAttacker] = 0;

            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
            show_hudmessage iAttacker, "
%i", iDamage;
        }
        
        else if(get_pcvar_num(g_Cvar[24]) == 2)
        {
            if(++g_iPosition[iAttacker] == g_iSize)
                g_iPosition[iAttacker] = 0;
            
            if(cs_get_user_team(iAttacker) == CS_TEAM_CT)
            {
                set_hudmessage 42, 170, 255, Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
            
            else if(cs_get_user_team(iAttacker) == CS_TEAM_T)
            {
                set_hudmessage 200, 0, 0, Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
        }
        
        else if(get_pcvar_num(g_Cvar[24]) == 3)
        {
            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
            show_hudmessage iAttacker, "
%i", iDamage;
        }

        else if(get_pcvar_num(g_Cvar[24]) == 4)
        {
            if(cs_get_user_team(iAttacker) == CS_TEAM_CT)
            {
                set_hudmessage 42, 170, 255, -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
            
            else if(cs_get_user_team(iAttacker) == CS_TEAM_T)
            {
                set_hudmessage 200, 0, 0, -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
        }
    }
    
    return 1;
}

public showVipsC(user)
{
    if(get_pcvar_num(g_Cvar[17]) == 1)
    {
        new tag[32];
        get_pcvar_string g_Cvar[1], tag, charsmax(tag);
    
        new vipNames[33][32];
        new message[256];
        new id, count, x, len;

        for(id = 0 ; id <= get_maxplayers() ; id++)
            if(is_user_connected(id))
                if(get_user_flags(id) & read_flags(VIP_FLAG))
                    get_user_name id, vipNames[count++], charsmax(vipNames[]);
    
        len = format(message, 255, "
^3[%s] ^1VIP-ii online sunt:^", tag);
        if(count > 0)
        {
            for(x = 0 ; x < count ; x++)
            {
                len += format(message[len], 255-len, "
%s%", vipNames[x], x < (count-1) ? "":"");
                if(len > 96)
                {
                    print_message(user, message);
                    len = format(message, 255, " ");
                }
            }
            
            print_message(user, message);
        }
        
        else
        {
                #if AMXX_VERSION_NUM < 183
            ColorChat user, GREEN, "
^3[%s] ^1Nu sunt ^4VIP^1-i online.", tag;
                #else
            client_print_color user, print_team_default, "
^3[%s] ^1Nu sunt ^4VIP^1-i online.", tag;
                #endif
        }            
    }
    return 0;  
}

print_message(id, msg[])
{
    message_begin(MSG_ONE, get_user_msgid("
SayText"), {0,0,0}, id);
    write_byte(id);
    write_string(msg);
    message_end();
}

public showVipsH()
{
    if(get_pcvar_num(g_Cvar[18]) == 1)
    {
        static iPlayers[32];
        static iPlayersNum;
    
        get_players(iPlayers, iPlayersNum, "
ch");
        if(!iPlayersNum)
            return 1;
    
        static iVipsConnected, szVipsNames[128], szName[32];
        formatex(szVipsNames, sizeof (szVipsNames) -1, "");
        iVipsConnected = 0;
    
        static id, i;
        for(i = 0; i < iPlayersNum; i++)
        {
            id = iPlayers[i];
            if(get_user_flags(id) & read_flags(VIP_FLAG))
            {
                get_user_name(id, szName, sizeof(szName) -1);
                
                add(szVipsNames, sizeof(szVipsNames) -1, szName);
                add(szVipsNames, sizeof(szVipsNames) -1, "
^n");
                
                iVipsConnected++;
            }    
        }
    
        formatex(g_szMessage, sizeof(g_szMessage) -1, "
%(%i)^n%s", g_szBeginning, iVipsConnected, szVipsNames);
        
        set_hudmessage 25, 255, 25, 0.01, 0.15, 0, 0.0, 1.0, 0.1, 0.1, -1;
        ShowSyncHudMsg 0, SyncHudMessage, g_szMessage;
    }
    return 0;    
}

public resetModel(id, level, cid)
{
    if(!is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG)) || get_pcvar_num(g_Cvar[15]) == 0)
       return 1;    

    new CsTeams:userTeam = cs_get_user_team(id)
    if(userTeam == CS_TEAM_T)
        cs_set_user_model id, "
vip_tero";
    else if(userTeam == CS_TEAM_CT)
        cs_set_user_model id, "
vip_ct";
    else
        cs_reset_user_model(id);

    return 0;
}

public vipTab(id) 
    if(get_pcvar_num(g_Cvar[25]) == 1)
        set_task 0.5, "
setVipTab", id + 6910;

public setVipTab(TaskID)
{
    new id = TaskID - 6910;
    
    if(get_user_flags(id) & read_flags(VIP_FLAG))
    {
        message_begin(MSG_ALL, get_user_msgid("
ScoreAttrib"));
        write_byte(id);
        write_byte(4);
        message_end();
    }
    
    return 1;


stock StripWeapons(id, Type, bool: bSwitchIfActive = true)
{
    new iReturn;
   
    if(is_user_alive(id))
    {
        new iEntity, iWeapon;
        while((iWeapon = GetWeaponFromSlot(id, Type, iEntity)) > 0)
            iReturn = ham_strip_user_weapon(id, iWeapon, Type, bSwitchIfActive);
    }
   
    return iReturn;
}

stock GetWeaponFromSlot( id , iSlot , &iEntity )
{
    if ( !( 1 <= iSlot <= 5 ) )
        return 0;
   
    iEntity = 0;
    const m_rgpPlayerItems_Slot0 = 367;
    const m_iId = 43;
    const XO_WEAPONS = 4;
    const XO_PLAYER = 5;
       
    iEntity = get_pdata_cbase( id , m_rgpPlayerItems_Slot0 + iSlot , XO_PLAYER );
   
    return ( iEntity > 0 ) ? get_pdata_int( iEntity , m_iId , XO_WEAPONS ) : 0;
}  
 
stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool: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
            1 //CSW_P90
        }
        iSlot = iWeaponsSlots[iCswId]
    }
 
    const XTRA_OFS_PLAYER = 5
    const m_rgpPlayerItems_Slot0 = 367
 
    iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER)
 
    const XTRA_OFS_WEAPON = 4
    const m_pNext = 42
    const m_iId = 43
 
    while( iWeapon > 0 )
    {
        if( get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId )
        {
            break
        }
        iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON)
    }
 
    if( iWeapon > 0 )
    {
        const m_pActiveItem = 373
        if( bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon )
        {
            ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon)
        }
 
        if( ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon) )
        {
            user_has_weapon(id, iCswId, 0)
            ExecuteHamB(Ham_Item_Kill, iWeapon)
            return 1
        }
    }
 
    return 0

-not to work on maps like fy_ awp_
-To give the menu from the 3rd round.
-Let the player still have the parachute.
-And keep the bullet damage.
That's it, maybe someone can help me, please, I'm so dumb




I found this plugin, maybe it can be modified here please, thanks

PHP Code:
/* Plugin generated by AMXX-Studio */

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

#define PLUGIN "ANTI-FURIEN Weapons CLASIC"
#define VERSION "1.0"
#define AUTHOR "50Cent # HackeR"

new bool:AidejaChoosen[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
register_clcmd("say /weapons","ClcmdWeapons");
    
    
RegisterHam(Ham_Spawn"player""Inceput_runda"1);
}

public 
ClcmdWeapons(id) {
    if(
AidejaChoosen[id] ) {
        
ChatColor(id"!t[Weapons] Ai ales aceasta runda arma");
        return 
PLUGIN_HANDLED;
    }
    if( 
get_user_teamid ) == ) {
        
WeaponMenu(id)
    }
    if( 
get_user_teamid ) == ) {
        
WeaponMenu(id)
    }
    return 
PLUGIN_HANDLED;
}

     

public 
Inceput_runda(id) {
    if(
is_user_alive(id)) {
        
give_item(id"weapon_knife");
        
AidejaChoosen[id] = false;
        
        if(
get_user_team(id) == 2) {
            
WeaponMenu(id);
        }
        if(
get_user_team(id) == 1) {
            
WeaponMenu(id);
        }
    }
}

public 
WeaponMenu(id) {
    if(
is_user_alive(id)) {
        new 
menu menu_create ("Weapons Menu Clasic \r[Clasic Weapon]""CaseWeaponMenu");
        
        
menu_additem(menu"Ak47""1");
        
menu_additem(menu"M4a1""2");
        
menu_additem(menu"MP5 Navy""3");
        
menu_additem(menu"XM1014""4");
        
menu_additem(menu"M3""5");
        
menu_additem(menu"M249""6");
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
menu_display(idmenu);
    }
    else
    {
        
ChatColor(id"!g[Weapons] !nNu. poti alege arma cand esti mort");
    }
}


public 
CaseWeaponMenu(idmenuitem) {
    if(
item == MENU_EXIT || !is_user_alive(id) ) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data [6], szName [64];
    new 
accesscallback;
    
menu_item_getinfo (menuitemaccessdata,charsmax (data), szName,charsmax (szName), callback);
    new 
key str_to_num (data);
    
    switch (
key)
    {
        case 
1:
        {
            
give_item(id"weapon_ak47");
            
cs_set_user_bpammo(idCSW_AK47,250);
            
ChatColor(id"!g[Weapons] !nAi ales Ak47");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
        case 
2:
        {
            
give_item(id"weapon_m4a1");
            
cs_set_user_bpammo(idCSW_M4A1,250);
            
ChatColor(id"!g[Weapons] !nAi ales M4a1");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
        case 
3:
        {
            
give_item(id"weapon_mp5navy");
            
cs_set_user_bpammo(idCSW_MP5NAVY,250);
            
ChatColor(id"!g[Weapons] !nAi ales Mp5Navy");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
        case 
4:
        {
            
give_item(id"weapon_xm1014");
            
cs_set_user_bpammo(idCSW_XM1014,250);
            
ChatColor(id"!g[Weapons] !nAi ales Xm1014");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
        case 
5:
        {
            
give_item(id"weapon_m3");
            
cs_set_user_bpammo(idCSW_M3,250);
            
ChatColor(id"!g[Weapons] !nAi ales M3");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
        case 
6:
        {
            
give_item(id"weapon_m249");
            
cs_set_user_bpammo(idCSW_M249,250);
            
ChatColor(id"!g[Weapons] !nAi Ales M249");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
    }
    
    
menu_destroy (menu);
    return 
PLUGIN_HANDLED;
}


public 
PistolSpawn(id) {
    if(
is_user_alive(id) && get_user_team(id) == 2) {
        new 
menu menu_create ("Secundary \rWeapon""CaseWeaponSecundar");
        
        
menu_additem(menu"Deagle""1");
        
menu_additem(menu"Fiveseven""2");
        
menu_additem(menu"Usp""3");
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
menu_display(idmenu);
    }
}

public 
CaseWeaponSecundar(idmenuitem) {
    if(
item == MENU_EXIT || !is_user_alive(id)) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data [6], szName [64];
    new 
accesscallback;
    
menu_item_getinfo (menuitemaccessdata,charsmax (data), szName,charsmax (szName), callback);
    new 
key str_to_num (data);
    
    switch (
key)
    {
        case 
1:
        {
            
give_item(id"weapon_deagle");
            
cs_set_user_bpammo(idCSW_DEAGLE50);
            
AidejaChoosenid ] = true;
        }
        case 
2:
        {
            
give_item(id"weapon_fiveseven");
            
cs_set_user_bpammo(idCSW_FIVESEVEN50);
            
AidejaChoosenid ] = true;
        }
        case 
3:
        {
            
give_item(id"weapon_usp");
            
cs_set_user_bpammo(idCSW_USP50);
            
AidejaChoosenid ] = true;
        }
    }
    
    
menu_destroy (menu);
    return 
PLUGIN_HANDLED;
}

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

nesq is offline
Tote
Senior Member
Join Date: Jul 2023
Old 02-26-2024 , 14:01   Re: Menu
Reply With Quote #3

Quote:
Originally Posted by nesq View Post
I found this plugin, maybe it can be modified here please, thanks

PHP Code:
/* Plugin generated by AMXX-Studio */

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

#define PLUGIN "ANTI-FURIEN Weapons CLASIC"
#define VERSION "1.0"
#define AUTHOR "50Cent # HackeR"

new bool:AidejaChoosen[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
register_clcmd("say /weapons","ClcmdWeapons");
    
    
RegisterHam(Ham_Spawn"player""Inceput_runda"1);
}

public 
ClcmdWeapons(id) {
    if(
AidejaChoosen[id] ) {
        
ChatColor(id"!t[Weapons] Ai ales aceasta runda arma");
        return 
PLUGIN_HANDLED;
    }
    if( 
get_user_teamid ) == ) {
        
WeaponMenu(id)
    }
    if( 
get_user_teamid ) == ) {
        
WeaponMenu(id)
    }
    return 
PLUGIN_HANDLED;
}

     

public 
Inceput_runda(id) {
    if(
is_user_alive(id)) {
        
give_item(id"weapon_knife");
        
AidejaChoosen[id] = false;
        
        if(
get_user_team(id) == 2) {
            
WeaponMenu(id);
        }
        if(
get_user_team(id) == 1) {
            
WeaponMenu(id);
        }
    }
}

public 
WeaponMenu(id) {
    if(
is_user_alive(id)) {
        new 
menu menu_create ("Weapons Menu Clasic \r[Clasic Weapon]""CaseWeaponMenu");
        
        
menu_additem(menu"Ak47""1");
        
menu_additem(menu"M4a1""2");
        
menu_additem(menu"MP5 Navy""3");
        
menu_additem(menu"XM1014""4");
        
menu_additem(menu"M3""5");
        
menu_additem(menu"M249""6");
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
menu_display(idmenu);
    }
    else
    {
        
ChatColor(id"!g[Weapons] !nNu. poti alege arma cand esti mort");
    }
}


public 
CaseWeaponMenu(idmenuitem) {
    if(
item == MENU_EXIT || !is_user_alive(id) ) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data [6], szName [64];
    new 
accesscallback;
    
menu_item_getinfo (menuitemaccessdata,charsmax (data), szName,charsmax (szName), callback);
    new 
key str_to_num (data);
    
    switch (
key)
    {
        case 
1:
        {
            
give_item(id"weapon_ak47");
            
cs_set_user_bpammo(idCSW_AK47,250);
            
ChatColor(id"!g[Weapons] !nAi ales Ak47");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
        case 
2:
        {
            
give_item(id"weapon_m4a1");
            
cs_set_user_bpammo(idCSW_M4A1,250);
            
ChatColor(id"!g[Weapons] !nAi ales M4a1");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
        case 
3:
        {
            
give_item(id"weapon_mp5navy");
            
cs_set_user_bpammo(idCSW_MP5NAVY,250);
            
ChatColor(id"!g[Weapons] !nAi ales Mp5Navy");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
        case 
4:
        {
            
give_item(id"weapon_xm1014");
            
cs_set_user_bpammo(idCSW_XM1014,250);
            
ChatColor(id"!g[Weapons] !nAi ales Xm1014");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
        case 
5:
        {
            
give_item(id"weapon_m3");
            
cs_set_user_bpammo(idCSW_M3,250);
            
ChatColor(id"!g[Weapons] !nAi ales M3");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
        case 
6:
        {
            
give_item(id"weapon_m249");
            
cs_set_user_bpammo(idCSW_M249,250);
            
ChatColor(id"!g[Weapons] !nAi Ales M249");
            
set_task0.1"PistolSpawn"id )
            
AidejaChoosenid ] = true;
        }
    }
    
    
menu_destroy (menu);
    return 
PLUGIN_HANDLED;
}


public 
PistolSpawn(id) {
    if(
is_user_alive(id) && get_user_team(id) == 2) {
        new 
menu menu_create ("Secundary \rWeapon""CaseWeaponSecundar");
        
        
menu_additem(menu"Deagle""1");
        
menu_additem(menu"Fiveseven""2");
        
menu_additem(menu"Usp""3");
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
menu_display(idmenu);
    }
}

public 
CaseWeaponSecundar(idmenuitem) {
    if(
item == MENU_EXIT || !is_user_alive(id)) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data [6], szName [64];
    new 
accesscallback;
    
menu_item_getinfo (menuitemaccessdata,charsmax (data), szName,charsmax (szName), callback);
    new 
key str_to_num (data);
    
    switch (
key)
    {
        case 
1:
        {
            
give_item(id"weapon_deagle");
            
cs_set_user_bpammo(idCSW_DEAGLE50);
            
AidejaChoosenid ] = true;
        }
        case 
2:
        {
            
give_item(id"weapon_fiveseven");
            
cs_set_user_bpammo(idCSW_FIVESEVEN50);
            
AidejaChoosenid ] = true;
        }
        case 
3:
        {
            
give_item(id"weapon_usp");
            
cs_set_user_bpammo(idCSW_USP50);
            
AidejaChoosenid ] = true;
        }
    }
    
    
menu_destroy (menu);
    return 
PLUGIN_HANDLED;
}

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

You can do it by using cs_get_user_team(id)
ex: if(cs_get_user_team(id) == CS_TEAM_CT)
{
show the menu with the ct order
}

same in the handler of menu
Tote is offline
nesq
Junior Member
Join Date: Jan 2024
Old 02-26-2024 , 16:04   Re: Menu
Reply With Quote #4

I tried to modify the first plugin because it is more complete and closer to what I need, but it gives me errors and I don't know how to solve it, I put the code and the picture with the error here

PHP Code:
#include amxmodx
#include amxmisc
#include cstrike
#include fun
#include hamsandwich
#include engine
#include fakemeta
#include csx
#if AMXX_VERSION_NUM < 183
#include colorchat
#endif

#define p. "player Menu Clasic"
#define v. "99"
#define a. "AlliedMods"
#pragma unused Symbol


new const Floatg_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 }
};

new const 
g_szBeginning[] = "Membrii PLAYER";

new 
g_Cvar[30],
    
g_Round[33] = 0,
    
g_JumpNum[33], bool:g_DoJump[33],
    
g_iPosition[33], g_iSize,
    
g_playerConfig[] = "playerConfig.cfg",
    
g_playerMaps[] = "playerMaps.ini",
    
g_File1[128], g_File2[128], 
    
bool:g_Use[33],
    
bool:g_Menu[33],
    
oms;

enum
{
    
Primary 1,
    
Secondary,
    
Knife,
    
Grenades,
    
C4
};

public 
plugin_init()
{
    
register_plugin p., v., a.;

    
register_clcmd "say""sayCommand";
    
register_clcmd "say_team""sayCommand";
    
    
g_Cvar[0] = register_cvar("player_mode""2");
    
g_Cvar[1] = register_cvar("player_tag""Player");
    
g_Cvar[2] = register_cvar("player_start_hp""");
    
g_Cvar[3] = register_cvar("player_start_ap""");
    
g_Cvar[4] = register_cvar("player_start_money""1000");
    
g_Cvar[5] = register_cvar("player_jump""1");
    
g_Cvar[6] = register_cvar("player_hp_kill""5");
    
g_Cvar[7] = register_cvar("player_ap_kill""5");
    
g_Cvar[8] = register_cvar("player_hp_hs""10");    
    
g_Cvar[9] = register_cvar("player_ap_hs""10");
    
g_Cvar[10] = register_cvar("player_hp_kill_knife""15");
    
g_Cvar[11] = register_cvar("player_ap_kill_knife""15");
    
g_Cvar[12] = register_cvar("player_hp_hs_knife""20");
    
g_Cvar[13] = register_cvar("player_ap_hs_knife""20");
    
g_Cvar[14] = register_cvar("player_bulletdmg""1");
    
g_Cvar[16] = register_cvar("player_in_out""1");
    
g_Cvar[17] = register_cvar("player_show_chat""1");
    
g_Cvar[18] = register_cvar("player_show_hud""1");
    
g_Cvar[19] = register_cvar("player_max_hp""200");
    
g_Cvar[20] = register_cvar("player_max_ap""200");
    
g_Cvar[21] = register_cvar("player_parachute""1");
    
g_Cvar[22] = register_cvar("player_money_kill""400");
    
g_Cvar[23] = register_cvar("player_money_hs""600");
    
g_Cvar[24] = register_cvar("player_bulletdmg_mode""1");
    
g_Cvar[25] = register_cvar("player_tab""1");
    
g_Cvar[26] = register_cvar("player_defusekit""1");
    
g_Cvar[27] = register_cvar("player_free""1");
    
g_Cvar[28] = register_cvar("player_free_start""22");
    
g_Cvar[29] = register_cvar("player_free_end""08");

    
set_task 300.0"msgInfo"___"b";
    
set_task 1.0"showplayersH"___"b"0;
    
set_task 1.0"Giveplayer" ,_,_,_"b";
    
    
RegisterHam Ham_Spawn"player""Spawn"1;
    
    
    
register_event "HLTV""newRound""a""1=0""2=0";
    
register_event "ResetHUD""resetModel""b";
    
register_event "ResetHUD""playerTab""be";
}

public 
plugin_cfg()
{    
    new 
File[64];
    
    
get_configsdir Filecharsmax(File);
    
formatex g_File1charsmax(g_File1), "%s/%s"Fileg_playerConfig;
    
formatex g_File2charsmax(g_File2), "%s/%s"Fileg_playerMaps;
    
        if(!
file_exists(g_File2))
    {
        
write_file(g_File2";--------------- | Lista hartilor pe care meniul vipului este restrictionat | ---------------");
        
write_file(g_File2"");
        
write_file(g_File2";Adaugati mapele una sub alta");
        
write_file(g_File2"");
        
write_file(g_File2"35hp");
        
write_file(g_File2"awp_india");
    }
}

public 
client_putinserver(id)
{
    if(!(
get_user_flags(id)))
        return 
1;
        
    
set_task 2.0"playerIn"id;
    
    
g_JumpNum[id] = 0;
    
g_DoJump[id] = false;
    
g_Round[id] = 0;
    
g_Use[id] = false;
    
g_Menu[id] = true;
    return 
1;
}

    
#if AMXX_VERSION_NUM < 183
public client_disconnect(id)
    
#else
public client_disconnected(id)
    
#endif
{
    if(!(
get_user_flags(id)))
        return 
1;
        
    
set_task 2.0"playerOut"id;
    
    
g_JumpNum[id] = 0;
    
g_DoJump[id] = false;
    
g_Round[id] = 0;
    
g_Use[id] = false;
    
    return 
1;
}

public 
newRound()
    for(new 
032i++)
        
g_Use[i] = false;

public 
playerMenu(id)
{
    if(!
is_user_alive(id) || !(get_user_flags(id)) || g_Use[id])
        return 
1;
    
    new 
menu;
    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_T:
        {
            
menu menu_create("\r[\dPlayer-Menu\r] \yTerrorists""Ammunition");
            
menu_additem menu"Ak47+Deagle+Set grenade""1";
            
menu_additem menu"M4a1+Deagle+Set grenade""2";
        }

        case 
CS_TEAM_CT:
        {
            
menu menu_create("\r[\dPlayer-Menu\r] \yCounter-Terorists""Ammunition");
            
menu_additem menu"M4a1+Deagle+Set grenade""1";
            
menu_additem menu"Ak47+Deagle+Set grenade""2";
        }
    }
    
menu_display idmenu0;
    return 
1;
}

public 
Ammunition(idmenuitem)
{
    if(
item == MENU_EXIT)
        return 
1;

    new 
accesscallbackdata[6], szName[64], tag[32];
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), szNamecharsmax(szName), callback);
    
get_pcvar_string g_Cvar[1], tagcharsmax(tag);
    new 
key str_to_num(data);
        
    if(
cs_get_user_team(id) == CS_TEAM_T)
    {
        switch(
key)
        {
            case 
1:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_ak47";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_AK4790;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
            
            case 
2:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_m4a1";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";                    cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_M4A190;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
    }
    
    if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        switch(
key)
        {
            case 
1:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_m4a1";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_M4A190;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
            
            case 
2:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_ak47";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_AK4790;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }     
", tag;
            }
    }
    
    menu_destroy(menu);
    return 1;  
}

public Spawn(id)

    if(!is_user_alive(id) || !(get_user_flags(id)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[0]) == 2)
    {
        if(g_Menu[id] == true)
            if(g_Round[id] > 2)
                playerMenu(id);
        
        g_Round[id]++;    
    }

    if(get_pcvar_num(g_Cvar[26]) == 1) if(cs_get_user_team(id) == CS_TEAM_CT) give_item id, "
item_thighpack";
    give_item id, "
item_assaultsuit";
    set_user_health id, get_pcvar_num(g_Cvar[2]);
    set_user_armor id, get_pcvar_num(g_Cvar[3]);
    cs_set_user_money id, clamp(cs_get_user_money(id) + get_pcvar_num(g_Cvar[4]), 0, 16000);    
    
    new MapName[32],
        szLine[128],
        iLen;
    new Size = file_size(g_File2, 1)    

    get_mapname(MapName, sizeof(MapName));
    for(new i = 0; i < Size; i ++)
    {
        read_file(g_File2, i, szLine, charsmax(szLine), iLen);
        if(equali(MapName, szLine))
            g_Menu[id] = false;
    }
    
    return 1;
}

public Giveplayer()
{
    if(get_pcvar_num(g_Cvar[27]) == 1)
    {
        time(o, m, s);
        
        if(o >= get_pcvar_num(g_Cvar[28]) && o < 24 || o >= 00 && o < get_pcvar_num(g_Cvar[29]))
        {
            for(new i = 1; i <= get_maxplayers(); i++)
                if(is_user_connected(i) || !is_user_bot(i) || !is_user_hltv(i) || !(get_user_flags(i)))
                    set_user_flags i

            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.02, 0, 1.0, 1.0;
            show_hudmessage 0, "", get_pcvar_num(g_Cvar[28]), get_pcvar_num(g_Cvar[29]);
        }
        
        if(o == get_pcvar_num(g_Cvar[29]) && m == 00 && s == 00) server_cmd("
amx_reloadadmins");
    }
}

public playerIn(id)
{
    if(!(get_user_flags(id)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[16]) == 1)
    {
        new tag[32], name[32];

        get_pcvar_string g_Cvar[1], tag, charsmax(tag); 
        get_user_name id, name, charsmax(name);

            #if AMXX_VERSION_NUM < 183
        ColorChat 0, GREEN, "
^3[%s] ^4%^1s-a conectat pe server.", tag, name;
            #else
        client_print_color 0, print_team_default, "
^3[%s] ^4%^1s-a conectat pe server.", tag, name;
            #endif
    }
    
    return 1;
}    

public playerOut(id)
{
    if(!(get_user_flags(id)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[16]) == 1)
    {
        new tag[32], name[32];

        get_pcvar_string g_Cvar[1], tag, charsmax(tag); 
        get_user_name id, name, charsmax(name);
        
            #if AMXX_VERSION_NUM < 183
        ColorChat 0, GREEN, "
^3[%s] ^4%^1s-a deconectat de pe server.", tag, name;
            #else
        client_print_color 0, print_team_default, "
^3[%s] ^4%^1s-a deconectat de pe server.", tag, name;
            #endif 
    }
    
    return 1;
}

public client_PreThink(id)
{
    if(!is_user_alive(id) || !(get_user_flags(id))) 
        return 1;
        
    new Float:fallspeed = 100.0 * -1.0;
    new BUTTON = get_user_button(id);
    new OLDBUTON = get_user_oldbutton(id);
    new JUMP_PLAYER = get_pcvar_num(g_Cvar[5]);

    if((BUTTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
    {
        if(g_JumpNum[id] < JUMP_PLAYER)
        {
            g_DoJump[id] = true;
            g_JumpNum[id]++
        }
    }

    if((BUTTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
        g_JumpNum[id] = 0;
    
    if(get_pcvar_num(g_Cvar[21]) == 1)
    {
        if(BUTTON & IN_USE) 
        {
            new Float:velocity[3];
            entity_get_vector(id, EV_VEC_velocity, velocity);
        
            if(velocity[2] < 0.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;

                velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed;
                entity_set_vector id, EV_VEC_velocity, velocity;
            }
        }
    }
    
    return 0;
}

public client_PostThink(id)
{
    if(!is_user_alive(id)) 
        return 1;
        
    if(g_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;
        g_DoJump[id] = false;
    }

    return 0;
}

public client_death(killer, victim, weapon, hitplace)
{
    if(!(get_user_flags(killer))) 
        return 1;
        
    new player_MAXHP = get_pcvar_num(g_Cvar[19]);
    new player_HP = get_user_health(killer);
    new player_MAXAP = get_pcvar_num(g_Cvar[20]);
    new player_AP = get_user_armor(killer);
    
    if(!(hitplace == HIT_HEAD) && !(weapon == CSW_KNIFE))
    {
        if(player_HP + get_pcvar_num(g_Cvar[6]) >= player_MAXHP) set_user_health killer, player_MAXHP;
        else set_user_health killer, player_HP + get_pcvar_num(g_Cvar[6]);
    
        if(player_AP + get_pcvar_num(g_Cvar[7]) >= player_MAXAP) set_user_armor killer, player_MAXAP;
        else set_user_armor killer, player_AP + get_pcvar_num(g_Cvar[7]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[22]), 0, 16000);
    }
    
    if(hitplace == HIT_HEAD && !(weapon == CSW_KNIFE))
    {
        if(player_HP + get_pcvar_num(g_Cvar[8])>= player_MAXHP) set_user_health killer, player_MAXHP;
        else set_user_health killer, player_HP + get_pcvar_num(g_Cvar[8]);
    
        if(player_AP + get_pcvar_num(g_Cvar[9]) >= player_MAXAP) set_user_armor killer, player_MAXAP;
        else set_user_armor killer, player_AP + get_pcvar_num(g_Cvar[9]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[23]), 0, 16000);
    }
    
    if(weapon == CSW_KNIFE && !(hitplace == HIT_HEAD))
    {
        if(player_HP + get_pcvar_num(g_Cvar[10]) >= player_MAXHP) set_user_health killer, player_MAXHP;
        else set_user_health killer, player_HP + get_pcvar_num(g_Cvar[10]);
    
        if(player_AP + get_pcvar_num(g_Cvar[11]) >= player_MAXAP) set_user_armor killer, player_MAXAP;
        else set_user_armor killer, player_AP + get_pcvar_num(g_Cvar[11]);

        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[22]), 0, 16000);
    }
    
    if(weapon == CSW_KNIFE && (hitplace == HIT_HEAD))
    {
        if(player_HP + get_pcvar_num(g_Cvar[12]) >= player_MAXHP) set_user_health killer, player_MAXHP;
        else set_user_health killer, player_HP + get_pcvar_num(g_Cvar[12]);
    
        if(player_AP + get_pcvar_num(g_Cvar[13]) >= player_MAXAP) set_user_armor killer, player_MAXAP;
        else set_user_armor killer, player_AP + get_pcvar_num(g_Cvar[13]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[23]), 0, 16000);
    }

    return 1;
}

public client_damage(iAttacker, iVictim, iDamage)
{
    if(!(get_user_flags(iAttacker)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[14]) == 1)
    {
        if(get_pcvar_num(g_Cvar[24]) == 1)
        {
            if(++g_iPosition[iAttacker] == g_iSize)
                g_iPosition[iAttacker] = 0;

            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
            show_hudmessage iAttacker, "
%i", iDamage;
        }
        
        else if(get_pcvar_num(g_Cvar[24]) == 2)
        {
            if(++g_iPosition[iAttacker] == g_iSize)
                g_iPosition[iAttacker] = 0;
            
            if(cs_get_user_team(iAttacker) == CS_TEAM_CT)
            {
                set_hudmessage 42, 170, 255, Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
            
            else if(cs_get_user_team(iAttacker) == CS_TEAM_T)
            {
                set_hudmessage 200, 0, 0, Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
        }
        
        else if(get_pcvar_num(g_Cvar[24]) == 3)
        {
            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
            show_hudmessage iAttacker, "
%i", iDamage;
        }

        else if(get_pcvar_num(g_Cvar[24]) == 4)
        {
            if(cs_get_user_team(iAttacker) == CS_TEAM_CT)
            {
                set_hudmessage 42, 170, 255, -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
            
            else if(cs_get_user_team(iAttacker) == CS_TEAM_T)
            {
                set_hudmessage 200, 0, 0, -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
        }
    }
    
    return 1;
}

public showplayerC(user)
{
    if(get_pcvar_num(g_Cvar[17]) == 1)
    {
        new tag[32];
        get_pcvar_string g_Cvar[1], tag, charsmax(tag);
    
        new playerNames[33][32];
        new message[256];
        new id, count, x, len;

        for(id = 0 ; id <= get_maxplayers() ; id++)
            if(is_user_connected(id))
                if(get_user_flags(id))
                    get_user_name id, playerNames[count++], charsmax(playerNames[]);
    
        len = format(message, 255, "
^3[%s] ^1player-ii online sunt:^", tag);
        if(count > 0)
        {
            for(x = 0 ; x < count ; x++)
            {
                len += format(message[len], 255-len, "
%s%", playerNames[x], x < (count-1) ? "":"");
                if(len > 96)
                {
                    print_message(user, message);
                    len = format(message, 255, " ");
                }
            }
            
            print_message(user, message);
        }
        
        else
        {
                #if AMXX_VERSION_NUM < 183
            ColorChat user, GREEN, "
^3[%s] ^1Nu sunt ^4VIP^1-i online.", tag;
                #else
            client_print_color user, print_team_default, "
^3[%s] ^1Nu sunt ^4VIP^1-i online.", tag;
                #endif
        }            
    }
    return 0;  
}

print_message(id, msg[])
{
    message_begin(MSG_ONE, get_user_msgid("
SayText"), {0,0,0}, id);
    write_byte(id);
    write_string(msg);
    message_end();
}
    
public playerTab(id) 
    if(get_pcvar_num(g_Cvar[25]) == 1)
        set_task 0.5, "
setplayerTab", id + 6910;

public setplayerTab(TaskID)
{
    new id = TaskID - 6910;
    
    if(get_user_flags(id))
    {
        message_begin(MSG_ALL, get_user_msgid("
ScoreAttrib"));
        write_byte(id);
        write_byte(4);
        message_end();
    }
    
    return 1;


stock StripWeapons(id, Type, bool: bSwitchIfActive = true)
{
    new iReturn;
   
    if(is_user_alive(id))
    {
        new iEntity, iWeapon;
        while((iWeapon = GetWeaponFromSlot(id, Type, iEntity)) > 0)
            iReturn = ham_strip_user_weapon(id, iWeapon, Type, bSwitchIfActive);
    }
   
    return iReturn;
}

stock GetWeaponFromSlot( id , iSlot , &iEntity )
{
    if ( !( 1 <= iSlot <= 5 ) )
        return 0;
   
    iEntity = 0;
    const m_rgpPlayerItems_Slot0 = 367;
    const m_iId = 43;
    const XO_WEAPONS = 4;
    const XO_PLAYER = 5;
       
    iEntity = get_pdata_cbase( id , m_rgpPlayerItems_Slot0 + iSlot , XO_PLAYER );
   
    return ( iEntity > 0 ) ? get_pdata_int( iEntity , m_iId , XO_WEAPONS ) : 0;
}  
 
stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool: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
            1 //CSW_P90
        }
        iSlot = iWeaponsSlots[iCswId]
    }
 
    const XTRA_OFS_PLAYER = 5
    const m_rgpPlayerItems_Slot0 = 367
 
    iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER)
 
    const XTRA_OFS_WEAPON = 4
    const m_pNext = 42
    const m_iId = 43
 
    while( iWeapon > 0 )
    {
        if( get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId )
        {
            break
        }
        iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON)
    }
 
    if( iWeapon > 0 )
    {
        const m_pActiveItem = 373
        if( bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon )
        {
            ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon)
        }
 
        if( ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon) )
        {
            user_has_weapon(id, iCswId, 0)
            ExecuteHamB(Ham_Item_Kill, iWeapon)
            return 1
        }
    }
 
    return 0


Last edited by nesq; 02-26-2024 at 16:05.
nesq is offline
Tote
Senior Member
Join Date: Jul 2023
Old 02-28-2024 , 04:41   Re: Menu
Reply With Quote #5

u are missing many things where are the brackets ( ) ??
Tote is offline
nesq
Junior Member
Join Date: Jan 2024
Old 02-28-2024 , 12:36   Re: Menu
Reply With Quote #6

Quote:
Originally Posted by Tote View Post
u are missing many things where are the brackets ( ) ??
where exactly should I put the brackets, i don't know how to do it here
nesq is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 02-28-2024 , 13:56   Re: Menu
Reply With Quote #7

Quote:
Originally Posted by nesq View Post
where exactly should I put the brackets, i don't know how to do it here
Better if you share the original source file.
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
nesq
Junior Member
Join Date: Jan 2024
Old 02-28-2024 , 15:30   Re: Menu
Reply With Quote #8

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
Better if you share the original source file.
this is the original source. But I tried to remove the "r" flag, the menu should be for simple players. In the post above, I removed the vip model, I also removed and modified the names of the vip in the player, the name of the menu, the hud message so that it no longer appears and others. So I wanted to change this plugin dedicated to vip, into a plugin for a simple player respecting cvars but not completely but it gave me an error

PHP Code:
#include amxmodx
#include amxmisc
#include cstrike
#include fun
#include hamsandwich
#include engine
#include fakemeta
#include csx
#if AMXX_VERSION_NUM < 183
#include colorchat
#endif

#define p. "VIP Clasic"
#define v. "9.0-c"
#define a. "Jică Măcelaru'"

#define VIP_FLAG "r"

new const Floatg_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 }
};

new const 
g_szBeginning[] = "Membrii VIP";

new 
g_Cvar[30],
    
g_Round[33] = 0,
    
g_JumpNum[33], bool:g_DoJump[33],
    
g_iPosition[33], g_iSize,
    
g_szMessage[256], SyncHudMessage,
    
g_VipConfig[] = "vipConfig.cfg",
    
g_VipMaps[] = "vipMaps.ini",
    
g_File1[128], g_File2[128], 
    
bool:g_Use[33],
    
bool:g_Menu[33],
    
oms;

enum
{
    
Primary 1,
    
Secondary,
    
Knife,
    
Grenades,
    
C4
};

public 
plugin_init()
{
    
register_plugin p., v., a.;

    
register_clcmd "say""sayCommand";
    
register_clcmd "say_team""sayCommand";
    
    
g_Cvar[0] = register_cvar("vip_mode""2");
    
g_Cvar[1] = register_cvar("vip_tag""VIP");
    
g_Cvar[2] = register_cvar("vip_start_hp""150");
    
g_Cvar[3] = register_cvar("vip_start_ap""150");
    
g_Cvar[4] = register_cvar("vip_start_money""1000");
    
g_Cvar[5] = register_cvar("vip_jump""1");
    
g_Cvar[6] = register_cvar("vip_hp_kill""5");
    
g_Cvar[7] = register_cvar("vip_ap_kill""5");
    
g_Cvar[8] = register_cvar("vip_hp_hs""10");    
    
g_Cvar[9] = register_cvar("vip_ap_hs""10");
    
g_Cvar[10] = register_cvar("vip_hp_kill_knife""15");    
    
g_Cvar[11] = register_cvar("vip_ap_kill_knife""15");
    
g_Cvar[12] = register_cvar("vip_hp_hs_knife""20");
    
g_Cvar[13] = register_cvar("vip_ap_hs_knife""20");
    
g_Cvar[14] = register_cvar("vip_bulletdmg""1");
    
g_Cvar[16] = register_cvar("vip_in_out""1");
    
g_Cvar[17] = register_cvar("vip_show_chat""1");
    
g_Cvar[18] = register_cvar("vip_show_hud""1");
    
g_Cvar[19] = register_cvar("vip_max_hp""200");
    
g_Cvar[20] = register_cvar("vip_max_ap""200");
    
g_Cvar[21] = register_cvar("vip_parachute""1");
    
g_Cvar[22] = register_cvar("vip_money_kill""400");
    
g_Cvar[23] = register_cvar("vip_money_hs""600");
    
g_Cvar[24] = register_cvar("vip_bulletdmg_mode""1");
    
g_Cvar[25] = register_cvar("vip_tab""1");
    
g_Cvar[26] = register_cvar("vip_defusekit""1");
    
g_Cvar[27] = register_cvar("vip_free""1");
    
g_Cvar[28] = register_cvar("vip_free_start""22");
    
g_Cvar[29] = register_cvar("vip_free_end""08");

    
set_task 300.0"msgInfo"___"b";
    
set_task 1.0"showVipsH"___"b"0;
    
set_task 1.0"GiveVIP" ,_,_,_"b";
    
    
RegisterHam Ham_Spawn"player""Spawn"1;
    
    
SyncHudMessage CreateHudSyncObj();
    
g_iSize sizeof(g_flCoords);
    
    
register_event "HLTV""newRound""a""1=0""2=0";
    
register_event "ResetHUD""resetModel""b";
    
register_event "ResetHUD""vipTab""be";
}

public 
plugin_cfg()
{    
    new 
File[64];
    
    
get_configsdir Filecharsmax(File);
    
formatex g_File1charsmax(g_File1), "%s/%s"Fileg_VipConfig;
    
formatex g_File2charsmax(g_File2), "%s/%s"Fileg_VipMaps;
    
    if(!
file_exists(g_File1))
    {
        
write_file(g_File1"; Plugin VIP creat de Jică Măcelaru' (aka. StefaN@CS, Devil., joker`)");
        
write_file(g_File1"; Plugin publicat pe www.indungi.ro/forum");
        
write_file(g_File1"; https://www.indungi.ro/forum/topic/829508-vip-clasic-90-vip_clasicamxx/");
        
write_file(g_File1"; Suport Counter-Strike 1.6 contra-cost");
        
write_file(g_File1"; Contact");
        
write_file(g_File1"; PM forum: https://www.indungi.ro/forum/profile/349550-jică-măcelaru/");
        
write_file(g_File1"; Steam: https://steamcommunity.com/id/baulesscs161/");
        
write_file(g_File1"; Paypal: paypal.me/sacotia");
        
write_file(g_File1"; Cine considera ca l-am ajutat si ca merit. Multumesc!");
        
write_file(g_File1"");
        
write_file(g_File1"");
        
write_file(g_File1"");
        
write_file(g_File1"/////// Vip Configuration File");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Mode");
        
write_file(g_File1"// Setati modul de aparitie al meniului");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - meniu prin comanda /vmenu");
        
write_file(g_File1"// 2 - meniu din a 3-a runda");
        
write_file(g_File1"// Default: '1'");
        
write_file(g_File1"vip_mode ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Tag");
        
write_file(g_File1"// Setati tagul ce va aparea in chat in mesaje");
        
write_file(g_File1"// Default: 'VIP'");
        
write_file(g_File1"vip_tag ^"VIP^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Start");
        
write_file(g_File1"// Setati viata, armura si banii cu care va incepe vipul fiecare runda");
        
write_file(g_File1"// La bani setati cu cati bani in plus va incepe");
        
write_file(g_File1"// EX: VIP-ul are 800 bani si la spawn i se vor mai adauga inca 1000");
        
write_file(g_File1"// Default: 150, 150, 1000");
        
write_file(g_File1"vip_start_hp ^"150^"");
        
write_file(g_File1"vip_start_ap ^"150^"");
        
write_file(g_File1"vip_start_money ^"1000^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP HP/AP/BANI per kill/hs");
        
write_file(g_File1"// Setati cat hp/ap/bani sa primeasca vip-ul pe fiecare kill/hs facut in functie de cum este facut kill-ul/hs-ul");
        
write_file(g_File1"// Default: 5, 5, 10, 10, 15, 15, 20, 20, 400, 600");
        
write_file(g_File1"vip_hp_kill ^"5^"");
        
write_file(g_File1"vip_ap_kill ^"5^"");
        
write_file(g_File1"vip_hp_hs ^"10^"");
        
write_file(g_File1"vip_ap_hs ^"10^"");
        
write_file(g_File1"vip_hp_kill_knife ^"15^"");
        
write_file(g_File1"vip_ap_kill_knife ^"15^"");
        
write_file(g_File1"vip_hp_hs_knife ^"20^"");
        
write_file(g_File1"vip_ap_hs_knife ^"20^"");
        
write_file(g_File1"vip_money_kill ^"400^"");
        
write_file(g_File1"vip_money_hs ^"600^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Max HP/AP");
        
write_file(g_File1"// Setati maximul de hp/ap pe care il poate avea vipul");
        
write_file(g_File1"// Default: 200, 200");
        
write_file(g_File1"vip_max_hp ^"200^"");
        
write_file(g_File1"vip_max_ap ^"200^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Jump");
        
write_file(g_File1"// Setati cat poate sari vipul");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - 2x jump");
        
write_file(g_File1"// 2 - 3x jump");
        
write_file(g_File1"// 3 - 4x jump");
        
write_file(g_File1"// ...");
        
write_file(g_File1"// z - yx jump");
        
write_file(g_File1"Default: 1");
        
write_file(g_File1"vip_jump ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Parachute");
        
write_file(g_File1"// Setati daca vip-ul va avea sau nu parasuta");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_parachute ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Defuse Kit (Only CT)");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_defusekit ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Show");
        
write_file(g_File1"// Setati momentele in care vor fi afisati vipii");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Cand intra/iese de pe server cu mesaj in chat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_in_out ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Cand tastezi comanda /vips apare in chat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_show_chat ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Afisare in hud in coltul stang, sus");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_show_hud ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Afisare in TAB (ScoreBoard)");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_tab ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Bulletdamage + mode");
        
write_file(g_File1"// Setati daca vipul va avea bulletdamage");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_bulletdmg ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Setati modul de aparitie al bulletdamageului");
        
write_file(g_File1"// vip_bulletdmg trebuie sa fie setat pe 1");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - cerc multi color pentru ambele echipe");
        
write_file(g_File1"// 2 - cerc albastru/rosu (CT - albastru / T - rosu)");
        
write_file(g_File1"// 3 - centru multi color pentru ambele echipe");
        
write_file(g_File1"// 4 - centru albastru/rosu (CT - albastru / T - rosu)");
        
write_file(g_File1"// Default: 1");
        
write_file(g_File1"vip_bulletdmg_mode ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Model");
        
write_file(g_File1"// Setati daca vip-ul va avea model sau nu");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"// Daca doriti sa activati modelul, setati valoarea 1 si schimbati mapa de 2 ori ca sa se descarce modelele");
        
write_file(g_File1"// Daca doriti sa dezactivati modelul, setati valoarea 0 si schimbati mapa de 2 ori ca sa nu se mai descarce modelele");
        
write_file(g_File1"Default: 1");
        
write_file(g_File1"vip_model ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"//// VIP Free");
        
write_file(g_File1"// Setati daca va fi vip free sau nu pe server");
        
write_file(g_File1"// 0 - dezactivat");
        
write_file(g_File1"// 1 - activat");
        
write_file(g_File1"vip_free ^"1^"");
        
write_file(g_File1"");
        
write_file(g_File1"// Setati orele intre care va fi vip free");
        
write_file(g_File1"// Ore disponibile");
        
write_file(g_File1"// 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12");
        
write_file(g_File1"// 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 00");
        
write_file(g_File1"// Default: 22, 08");
        
write_file(g_File1"vip_free_start ^"22^"");
        
write_file(g_File1"vip_free_end ^"08^"");
    }
    
    
server_cmd "exec %s"g_File1;
    
    if(!
file_exists(g_File2))
    {
        
write_file(g_File2";--------------- | Lista hartilor pe care meniul vipului este restrictionat | ---------------");
        
write_file(g_File2"");
        
write_file(g_File2";Adaugati mapele una sub alta");
        
write_file(g_File2"");
        
write_file(g_File2"35hp");
        
write_file(g_File2"awp_india");
    }
}

public 
sayCommand(id)
{
    new 
Said[10];
    
read_args Saidcharsmax(Said);
    
remove_quotes(Said);
    
    if(
equal(Said"/vips")) showVipsC(id);
    else if(
equal(Said"/vip")) vipInfo(id);
    else if(
equal(Said"/vmenu"))
        if(
get_pcvar_num(g_Cvar[0]) == 1)
            if(
g_Menu[id] == true)
                
vipMenu(id);

    return 
0;
}

public 
client_putinserver(id)
{
    if(!(
get_user_flags(id) & read_flags(VIP_FLAG)))
        return 
1;
        
    
set_task 2.0"vipIn"id;
    
    
g_JumpNum[id] = 0;
    
g_DoJump[id] = false;
    
g_Round[id] = 0;
    
g_Use[id] = false;
    
g_Menu[id] = true;
    return 
1;
}

    
#if AMXX_VERSION_NUM < 183
public client_disconnect(id)
    
#else
public client_disconnected(id)
    
#endif
{
    if(!(
get_user_flags(id) & read_flags(VIP_FLAG)))
        return 
1;
        
    
set_task 2.0"vipOut"id;
    
    
g_JumpNum[id] = 0;
    
g_DoJump[id] = false;
    
g_Round[id] = 0;
    
g_Use[id] = false;
    
    return 
1;
}

public 
vipInfo(idshow_motd(id"/addons/amxmodx/configs/vipInfo.txt");

public 
msgInfo()
{
    new 
tag[32];
    
get_pcvar_string g_Cvar[1], tagcharsmax(tag);

        
#if AMXX_VERSION_NUM < 183
    
ColorChat 0GREEN"^3[%s] ^1Tastati in chat ^4/vip ^1pentru a vedea beneficiile si pretul vip-ului."tag;
        
#else
    
client_print_color 0print_team_default"^3[%s] ^1Tastați în chat ^4/vip ^1pentru a vedea beneficiile și prețul vip-ului."tag;
        
#endif
}

public 
plugin_precache()
{
    
g_Cvar[15] = register_cvar("vip_model""1");
    
    if(
get_pcvar_num(g_Cvar[15]) == 0)
        return 
1;

    
precache_model "models/player/vip_tero/vip_tero.mdl";
    
precache_model "models/player/vip_ct/vip_ct.mdl";

    return 
1;
}

public 
newRound()
    for(new 
032i++)
        
g_Use[i] = false;

public 
vipMenu(id)
{
    if(!
is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG)) || g_Use[id])
        return 
1;
    
    new 
menu;
    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_T:
        {
            
menu menu_create("\r[\dVIP-Menu\r] \yTerrorists""Ammunition");
            
menu_additem menu"Ak47+Deagle+Set grenade""1";
            
menu_additem menu"M4a1+Deagle+Set grenade""2";
        }

        case 
CS_TEAM_CT:
        {
            
menu menu_create("\r[\dVIP-Menu\r] \yCounter-Terorists""Ammunition");
            
menu_additem menu"M4a1+Deagle+Set grenade""1";
            
menu_additem menu"Ak47+Deagle+Set grenade""2";
        }
    }
    
menu_display idmenu0;
    return 
1;
}

public 
Ammunition(idmenuitem)
{
    if(
item == MENU_EXIT)
        return 
1;

    new 
accesscallbackdata[6], szName[64], tag[32];
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), szNamecharsmax(szName), callback);
    
get_pcvar_string g_Cvar[1], tagcharsmax(tag);
    new 
key str_to_num(data);
        
    if(
cs_get_user_team(id) == CS_TEAM_T)
    {
        switch(
key)
        {
            case 
1:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_ak47";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_AK4790;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
            
            case 
2:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_m4a1";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";                    cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_M4A190;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
    }
    
    if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        switch(
key)
        {
            case 
1:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_m4a1";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_M4A190;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }
            
            case 
2:
            {
                
StripWeapons idPrimary;
                
StripWeapons idSecondary;
                
give_item id"weapon_knife";
                
give_item id"weapon_ak47";
                
give_item id"weapon_deagle";
                
give_item id"weapon_hegrenade";
                
give_item id"weapon_flashbang";
                
cs_set_user_bpammo idCSW_FLASHBANG2;
                
cs_set_user_bpammo idCSW_AK4790;
                
cs_set_user_bpammo idCSW_DEAGLE35;
                    
#if AMXX_VERSION_NUM < 183
                
ColorChat idGREEN"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#else
                
client_print_color idprint_team_default"^3[%s] ^1Ai ales ^Ak47^1+^4Deagle^1+^4Set grenade^1."tag;
                    
#endif
                
g_Use[id] = true;
            }     
", tag;
            }
    }
    
    menu_destroy(menu);
    return 1;  
}

public Spawn(id)

    if(!is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[0]) == 2)
    {
        if(g_Menu[id] == true)
            if(g_Round[id] > 2)
                vipMenu(id);
        
        g_Round[id]++;    
    }

    if(get_pcvar_num(g_Cvar[26]) == 1) if(cs_get_user_team(id) == CS_TEAM_CT) give_item id, "
item_thighpack";
    give_item id, "
item_assaultsuit";
    set_user_health id, get_pcvar_num(g_Cvar[2]);
    set_user_armor id, get_pcvar_num(g_Cvar[3]);
    cs_set_user_money id, clamp(cs_get_user_money(id) + get_pcvar_num(g_Cvar[4]), 0, 16000);    
    
    new MapName[32],
        szLine[128],
        iLen;
    new Size = file_size(g_File2, 1)    

    get_mapname(MapName, sizeof(MapName));
    for(new i = 0; i < Size; i ++)
    {
        read_file(g_File2, i, szLine, charsmax(szLine), iLen);
        if(equali(MapName, szLine))
            g_Menu[id] = false;
    }
    
    return 1;
}

public GiveVIP()
{
    if(get_pcvar_num(g_Cvar[27]) == 1)
    {
        time(o, m, s);
        
        if(o >= get_pcvar_num(g_Cvar[28]) && o < 24 || o >= 00 && o < get_pcvar_num(g_Cvar[29]))
        {
            for(new i = 1; i <= get_maxplayers(); i++)
                if(is_user_connected(i) || !is_user_bot(i) || !is_user_hltv(i) || !(get_user_flags(i) & read_flags(VIP_FLAG)))
                    set_user_flags i, read_flags(VIP_FLAG)

            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.02, 0, 1.0, 1.0;
            show_hudmessage 0, "", get_pcvar_num(g_Cvar[28]), get_pcvar_num(g_Cvar[29]);
        }
        
        if(o == get_pcvar_num(g_Cvar[29]) && m == 00 && s == 00) server_cmd("
amx_reloadadmins");
    }
}

public vipIn(id)
{
    if(!(get_user_flags(id) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[16]) == 1)
    {
        new tag[32], name[32];

        get_pcvar_string g_Cvar[1], tag, charsmax(tag); 
        get_user_name id, name, charsmax(name);

            #if AMXX_VERSION_NUM < 183
        ColorChat 0, GREEN, "
^3[%s] ^4%^1s-a conectat pe server.", tag, name;
            #else
        client_print_color 0, print_team_default, "
^3[%s] ^4%^1s-a conectat pe server.", tag, name;
            #endif
    }
    
    return 1;
}    

public vipOut(id)
{
    if(!(get_user_flags(id) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[16]) == 1)
    {
        new tag[32], name[32];

        get_pcvar_string g_Cvar[1], tag, charsmax(tag); 
        get_user_name id, name, charsmax(name);
        
            #if AMXX_VERSION_NUM < 183
        ColorChat 0, GREEN, "
^3[%s] ^4%^1s-a deconectat de pe server.", tag, name;
            #else
        client_print_color 0, print_team_default, "
^3[%s] ^4%^1s-a deconectat de pe server.", tag, name;
            #endif 
    }
    
    return 1;
}

public client_PreThink(id)
{
    if(!is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG))) 
        return 1;
        
    new Float:fallspeed = 100.0 * -1.0;
    new BUTTON = get_user_button(id);
    new OLDBUTON = get_user_oldbutton(id);
    new JUMP_VIP = get_pcvar_num(g_Cvar[5]);

    if((BUTTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
    {
        if(g_JumpNum[id] < JUMP_VIP)
        {
            g_DoJump[id] = true;
            g_JumpNum[id]++
        }
    }

    if((BUTTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
        g_JumpNum[id] = 0;
    
    if(get_pcvar_num(g_Cvar[21]) == 1)
    {
        if(BUTTON & IN_USE) 
        {
            new Float:velocity[3];
            entity_get_vector(id, EV_VEC_velocity, velocity);
        
            if(velocity[2] < 0.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;

                velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed;
                entity_set_vector id, EV_VEC_velocity, velocity;
            }
        }
    }
    
    return 0;
}

public client_PostThink(id)
{
    if(!is_user_alive(id)) 
        return 1;
        
    if(g_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;
        g_DoJump[id] = false;
    }

    return 0;
}

public client_death(killer, victim, weapon, hitplace)
{
    if(!(get_user_flags(killer) & read_flags(VIP_FLAG))) 
        return 1;
        
    new VIP_MAXHP = get_pcvar_num(g_Cvar[19]);
    new VIP_HP = get_user_health(killer);
    new VIP_MAXAP = get_pcvar_num(g_Cvar[20]);
    new VIP_AP = get_user_armor(killer);
    
    if(!(hitplace == HIT_HEAD) && !(weapon == CSW_KNIFE))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[6]) >= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[6]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[7]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[7]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[22]), 0, 16000);
    }
    
    if(hitplace == HIT_HEAD && !(weapon == CSW_KNIFE))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[8])>= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[8]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[9]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[9]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[23]), 0, 16000);
    }
    
    if(weapon == CSW_KNIFE && !(hitplace == HIT_HEAD))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[10]) >= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[10]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[11]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[11]);

        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[22]), 0, 16000);
    }
    
    if(weapon == CSW_KNIFE && (hitplace == HIT_HEAD))
    {
        if(VIP_HP + get_pcvar_num(g_Cvar[12]) >= VIP_MAXHP) set_user_health killer, VIP_MAXHP;
        else set_user_health killer, VIP_HP + get_pcvar_num(g_Cvar[12]);
    
        if(VIP_AP + get_pcvar_num(g_Cvar[13]) >= VIP_MAXAP) set_user_armor killer, VIP_MAXAP;
        else set_user_armor killer, VIP_AP + get_pcvar_num(g_Cvar[13]);
        
        cs_set_user_money killer, clamp(cs_get_user_money(killer) - 300 + get_pcvar_num(g_Cvar[23]), 0, 16000);
    }

    return 1;
}

public client_damage(iAttacker, iVictim, iDamage)
{
    if(!(get_user_flags(iAttacker) & read_flags(VIP_FLAG)))
        return 1;
        
    if(get_pcvar_num(g_Cvar[14]) == 1)
    {
        if(get_pcvar_num(g_Cvar[24]) == 1)
        {
            if(++g_iPosition[iAttacker] == g_iSize)
                g_iPosition[iAttacker] = 0;

            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
            show_hudmessage iAttacker, "
%i", iDamage;
        }
        
        else if(get_pcvar_num(g_Cvar[24]) == 2)
        {
            if(++g_iPosition[iAttacker] == g_iSize)
                g_iPosition[iAttacker] = 0;
            
            if(cs_get_user_team(iAttacker) == CS_TEAM_CT)
            {
                set_hudmessage 42, 170, 255, Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
            
            else if(cs_get_user_team(iAttacker) == CS_TEAM_T)
            {
                set_hudmessage 200, 0, 0, Float: g_flCoords[g_iPosition[iAttacker]][0], Float: g_flCoords[g_iPosition[iAttacker]][1], 0, 0.1, 2.5, 0.02, 0.02, -1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
        }
        
        else if(get_pcvar_num(g_Cvar[24]) == 3)
        {
            set_hudmessage random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
            show_hudmessage iAttacker, "
%i", iDamage;
        }

        else if(get_pcvar_num(g_Cvar[24]) == 4)
        {
            if(cs_get_user_team(iAttacker) == CS_TEAM_CT)
            {
                set_hudmessage 42, 170, 255, -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
            
            else if(cs_get_user_team(iAttacker) == CS_TEAM_T)
            {
                set_hudmessage 200, 0, 0, -1.0, 0.5, 0, 0.0, 0.1, 0.1, 0.1;
                show_hudmessage iAttacker, "
%i", iDamage;
            }
        }
    }
    
    return 1;
}

public showVipsC(user)
{
    if(get_pcvar_num(g_Cvar[17]) == 1)
    {
        new tag[32];
        get_pcvar_string g_Cvar[1], tag, charsmax(tag);
    
        new vipNames[33][32];
        new message[256];
        new id, count, x, len;

        for(id = 0 ; id <= get_maxplayers() ; id++)
            if(is_user_connected(id))
                if(get_user_flags(id) & read_flags(VIP_FLAG))
                    get_user_name id, vipNames[count++], charsmax(vipNames[]);
    
        len = format(message, 255, "
^3[%s] ^1VIP-ii online sunt:^", tag);
        if(count > 0)
        {
            for(x = 0 ; x < count ; x++)
            {
                len += format(message[len], 255-len, "
%s%", vipNames[x], x < (count-1) ? "":"");
                if(len > 96)
                {
                    print_message(user, message);
                    len = format(message, 255, " ");
                }
            }
            
            print_message(user, message);
        }
        
        else
        {
                #if AMXX_VERSION_NUM < 183
            ColorChat user, GREEN, "
^3[%s] ^1Nu sunt ^4VIP^1-i online.", tag;
                #else
            client_print_color user, print_team_default, "
^3[%s] ^1Nu sunt ^4VIP^1-i online.", tag;
                #endif
        }            
    }
    return 0;  
}

print_message(id, msg[])
{
    message_begin(MSG_ONE, get_user_msgid("
SayText"), {0,0,0}, id);
    write_byte(id);
    write_string(msg);
    message_end();
}

public showVipsH()
{
    if(get_pcvar_num(g_Cvar[18]) == 1)
    {
        static iPlayers[32];
        static iPlayersNum;
    
        get_players(iPlayers, iPlayersNum, "
ch");
        if(!iPlayersNum)
            return 1;
    
        static iVipsConnected, szVipsNames[128], szName[32];
        formatex(szVipsNames, sizeof (szVipsNames) -1, "");
        iVipsConnected = 0;
    
        static id, i;
        for(i = 0; i < iPlayersNum; i++)
        {
            id = iPlayers[i];
            if(get_user_flags(id) & read_flags(VIP_FLAG))
            {
                get_user_name(id, szName, sizeof(szName) -1);
                
                add(szVipsNames, sizeof(szVipsNames) -1, szName);
                add(szVipsNames, sizeof(szVipsNames) -1, "
^n");
                
                iVipsConnected++;
            }    
        }
    
        formatex(g_szMessage, sizeof(g_szMessage) -1, "
%(%i)^n%s", g_szBeginning, iVipsConnected, szVipsNames);
        
        set_hudmessage 25, 255, 25, 0.01, 0.15, 0, 0.0, 1.0, 0.1, 0.1, -1;
        ShowSyncHudMsg 0, SyncHudMessage, g_szMessage;
    }
    return 0;    
}

public resetModel(id, level, cid)
{
    if(!is_user_alive(id) || !(get_user_flags(id) & read_flags(VIP_FLAG)) || get_pcvar_num(g_Cvar[15]) == 0)
       return 1;    

    new CsTeams:userTeam = cs_get_user_team(id)
    if(userTeam == CS_TEAM_T)
        cs_set_user_model id, "
vip_tero";
    else if(userTeam == CS_TEAM_CT)
        cs_set_user_model id, "
vip_ct";
    else
        cs_reset_user_model(id);

    return 0;
}

public vipTab(id) 
    if(get_pcvar_num(g_Cvar[25]) == 1)
        set_task 0.5, "
setVipTab", id + 6910;

public setVipTab(TaskID)
{
    new id = TaskID - 6910;
    
    if(get_user_flags(id) & read_flags(VIP_FLAG))
    {
        message_begin(MSG_ALL, get_user_msgid("
ScoreAttrib"));
        write_byte(id);
        write_byte(4);
        message_end();
    }
    
    return 1;


stock StripWeapons(id, Type, bool: bSwitchIfActive = true)
{
    new iReturn;
   
    if(is_user_alive(id))
    {
        new iEntity, iWeapon;
        while((iWeapon = GetWeaponFromSlot(id, Type, iEntity)) > 0)
            iReturn = ham_strip_user_weapon(id, iWeapon, Type, bSwitchIfActive);
    }
   
    return iReturn;
}

stock GetWeaponFromSlot( id , iSlot , &iEntity )
{
    if ( !( 1 <= iSlot <= 5 ) )
        return 0;
   
    iEntity = 0;
    const m_rgpPlayerItems_Slot0 = 367;
    const m_iId = 43;
    const XO_WEAPONS = 4;
    const XO_PLAYER = 5;
       
    iEntity = get_pdata_cbase( id , m_rgpPlayerItems_Slot0 + iSlot , XO_PLAYER );
   
    return ( iEntity > 0 ) ? get_pdata_int( iEntity , m_iId , XO_WEAPONS ) : 0;
}  
 
stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool: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
            1 //CSW_P90
        }
        iSlot = iWeaponsSlots[iCswId]
    }
 
    const XTRA_OFS_PLAYER = 5
    const m_rgpPlayerItems_Slot0 = 367
 
    iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER)
 
    const XTRA_OFS_WEAPON = 4
    const m_pNext = 42
    const m_iId = 43
 
    while( iWeapon > 0 )
    {
        if( get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId )
        {
            break
        }
        iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON)
    }
 
    if( iWeapon > 0 )
    {
        const m_pActiveItem = 373
        if( bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon )
        {
            ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon)
        }
 
        if( ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon) )
        {
            user_has_weapon(id, iCswId, 0)
            ExecuteHamB(Ham_Item_Kill, iWeapon)
            return 1
        }
    }
 
    return 0


Last edited by nesq; 02-28-2024 at 15:33.
nesq is offline
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 02-29-2024 , 12:55   Re: Menu
Reply With Quote #9

Out of so many good VIP plugins, you chose the worst one, try this one I changed ADMIN_LEVEL_H to ADMIN_ALL.

PHP Code:
#define DAMAGE_RECIEVED
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
new maxplayers
new gmsgSayText
new mpdmkbmhb
new g_MsgSync
new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max
new g_awp_active
new g_menu_active
new CurrentRound
new bool:HasC4[33]
#define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
#if defined DAMAGE_RECIEVED
    
new g_MsgSync2
#endif

public plugin_init()
{
    
register_plugin("VIP Eng Version""3.0""Dunno")
    
mpd register_cvar("money_per_damage","3")
    
mkb register_cvar("money_kill_bonus","200")
    
mhb register_cvar("money_hs_bonus","500")
    
health_add register_cvar("amx_vip_hp""15")
    
health_hs_add register_cvar("amx_vip_hp_hs""30")
    
health_max register_cvar("amx_vip_max_hp""100")
    
g_awp_active register_cvar("awp_active""1")
    
g_menu_active register_cvar("menu_active""1")
    
register_event("Damage","Damage","b")
    
register_event("DeathMsg","death_msg","a")
    
register_menucmd(register_menuid("rod"), Keysrod"Pressedrod")
    
register_clcmd("awp","HandleCmd")
        
register_clcmd("sg550","HandleCmd")
        
register_clcmd("g3sg1","HandleCmd")
    
register_clcmd("say /wantvip","ShowMotd")
    
maxplayers get_maxplayers()
    
gmsgSayText get_user_msgid("SayText")
    
register_clcmd("say""handle_say")
    
register_cvar("amx_contactinfo"CONTACTFCVAR_SERVER)
    
register_logevent("LogEvent_RoundStart"2"1=Round_Start" );
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
    
register_event("DeathMsg""hook_death""a""1>0")
    
register_event("Damage""on_damage""b""2!0""3=0""4!0")
    
g_MsgSync CreateHudSyncObj()
#if defined DAMAGE_RECIEVED
    
g_MsgSync2 CreateHudSyncObj()
#endif    
}

public 
on_damage(id)
{
    new 
attacker get_user_attacker(id)

#if defined DAMAGE_RECIEVED
    // id should be connected if this message is sent, but lets check anyway
    
if ( is_user_connected(id) && is_user_connected(attacker) )
    if (
get_user_flags(attacker) & ADMIN_ALL)
    {
        new 
damage read_data(2)

        
set_hudmessage(255000.450.5020.14.00.10.1, -1)
        
ShowSyncHudMsg(idg_MsgSync2"%i^n"damage)
#else
    
if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_ALL) )
    {
        new 
damage read_data(2)
#endif
        
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
        
ShowSyncHudMsg(attackerg_MsgSync"%i^n"damage)
    }
}

public 
Damage(id)
{
    new 
weaponhitpointattacker get_user_attacker(id,weapon,hitpoint)
    if(
attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
    if (
get_user_flags(attacker) & ADMIN_ALL
    {
        new 
money read_data(2) * get_pcvar_num(mpd)
        if(
hitpoint==1money += get_pcvar_num(mhb)
        
cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
    }
}

public 
death_msg()
{
    if(
read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}

public 
LogEvent_RoundStart()
{
    
CurrentRound++;
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
is_user_alive(player) && get_user_flags(player) & ADMIN_ALL)
        {
            
give_item(player"weapon_hegrenade")
            
give_item(player"weapon_flashbang")
            
give_item(player"weapon_flashbang")
            
give_item(player"weapon_smokegrenade")
            
give_item(player"item_assaultsuit")
            
give_item(player"item_thighpack")
            
            if (!
get_pcvar_num(g_menu_active))
                return 
PLUGIN_CONTINUE
            
            
if(CurrentRound >= 3)
            {
                
Showrod(player);
            }
        }
    }
    return 
PLUGIN_HANDLED
}

public 
Event_RoundRestart()
{
    
CurrentRound=0;
}

public 
hook_death()
{
   
// Killer id
   
nKiller read_data(1)
   
   if ( (
read_data(3) == 1) && (read_data(5) == 0) )
   {
      
nHp_add get_pcvar_num (health_hs_add)
   }
   else
      
nHp_add get_pcvar_num (health_add)
   
nHp_max get_pcvar_num (health_max)
   
// Updating Killer HP
   
if(!(get_user_flags(nKiller) & ADMIN_ALL))
   return;

   
nKiller_hp get_user_health(nKiller)
   
nKiller_hp += nHp_add
   
// Maximum HP check
   
if (nKiller_hp nHp_maxnKiller_hp nHp_max
   set_user_health
(nKillernKiller_hp)
   
// Hud message "Healed +15/+30 hp"
   
set_hudmessage(02550, -1.00.1501.01.00.10.1, -1)
   
show_hudmessage(nKiller"Healed +%d hp"nHp_add)
   
// Screen fading
   
message_begin(MSG_ONEget_user_msgid("ScreenFade"), {0,0,0}, nKiller)
   
write_short(1<<10)
   
write_short(1<<10)
   
write_short(0x0000)
   
write_byte(0)
   
write_byte(0)
   
write_byte(200)
   
write_byte(75)
   
message_end()
 
}

public 
Showrod(id) {
    
show_menu(idKeysrod"Free VIP Guns^n\w1. Get M4A1+Deagle ^n\w2. Get AK47+Deagle^n0. Exit^n", -1"rod"// Display menu
}
public 
Pressedrod(idkey) {
    
/* Menu:
    * VIP Menu
    * 1. Get M4A1+Deagle
    * 2. Get AK47+Deagle
    * 0. Exit
    */
    
switch (key) {
        case 
0: { 
            if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
                
HasC4[id] = true;
            else
                
HasC4[id] = false;
            
            
strip_user_weapons (id)
            
give_item(id,"weapon_m4a1")
            
give_item(id,"ammo_556nato")
            
give_item(id,"ammo_556nato")
            
give_item(id,"ammo_556nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_knife")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang");
            
give_item(id"weapon_flashbang");
            
give_item(id"weapon_smokegrenade");
            
give_item(id"item_assaultsuit");
            
give_item(id"item_thighpack");
            
client_print(idprint_center"You Taked Free M4A1 and Deagle")
            
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plantid );
            }
            }
        case 
1: { 
            if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
                
HasC4[id] = true;
            else
                
HasC4[id] = false;
            
            
strip_user_weapons (id)
            
give_item(id,"weapon_ak47")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_knife")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang");
            
give_item(id"weapon_flashbang");
            
give_item(id"weapon_smokegrenade");
            
give_item(id"item_assaultsuit");
            
give_item(id"item_thighpack");
            
client_print(idprint_center"You Taked Free AK47 and Deagle")
            
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plantid );
            }
            }
        case 
9: {             
        }
    }
    return 
PLUGIN_CONTINUE
}

public 
HandleCmd(id){
    if (!
get_pcvar_num(g_awp_active))
      return 
PLUGIN_CONTINUE
    
if(get_user_flags(id) & ADMIN_ALL
        return 
PLUGIN_CONTINUE
    client_print
(idprint_center"Sniper's Only For VIP's")
    return 
PLUGIN_HANDLED
}

public 
ShowMotd(id)
{
 
show_motd(id"vip.txt")
}
public 
client_authorized(id)
{
 
set_task(30.0"PrintText" ,id)
}
public 
PrintText(id)
{
 
client_print(idprint_chat"[VIP] write /wantvip and u will see how get VIP and VIP privilegies.")
}

public 
handle_say(id) {
    new 
said[192]
    
read_args(said,192)
    if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/vips") != -)
        
set_task(0.1,"print_adminlist",id)
    return 
PLUGIN_CONTINUE
}

public 
print_adminlist(user
{
    new 
adminnames[33][32]
    new 
message[256]
    new 
contactinfo[256], contact[112]
    new 
idcountxlen
    
    
for(id id <= maxplayers id++)
        if(
is_user_connected(id))
            if(
get_user_flags(id) & ADMIN_ALL)
                
get_user_name(idadminnames[count++], 31)

    
len format(message255"%s VIP ONLINE: ",COLOR)
    if(
count 0) {
        for(
count x++) {
            
len += format(message[len], 255-len"%s%s "adminnames[x], < (count-1) ? ", ":"")
            if(
len 96 ) {
                
print_message(usermessage)
                
len format(message255"%s ",COLOR)
            }
        }
        
print_message(usermessage)
    }
    else {
        
len += format(message[len], 255-len"No VIP online.")
        
print_message(usermessage)
    }
    
    
get_cvar_string("amx_contactinfo"contact63)
    if(
contact[0])  {
        
format(contactinfo111"%s Contact Server Admin -- %s"COLORcontact)
        
print_message(usercontactinfo)
    }
}

print_message(idmsg[]) {
    
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)
    
write_byte(id)
    
write_string(msg)
    
message_end()

vip.txt
Uzviseni Bog is offline
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 17:57.


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