Raised This Month: $64 Target: $400
 16% 

ADMIN_LEVEL_H settings


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 11-07-2018 , 10:18   ADMIN_LEVEL_H settings
Reply With Quote #1

Hello, does someone know plugin, that ADMIN_LEVEL_H can turn on/off some settings, for example skins, hp for kill, hp for headshot and so on in MENU?..
TheBladerX is offline
SomewhereLost
Senior Member
Join Date: Mar 2014
Location: Georgia
Old 11-08-2018 , 08:10   Re: ADMIN_LEVEL_H settings
Reply With Quote #2

If you already have a menu plugin with such features, just define the admin access so only admin can access the menu and change those stuff.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 11-08-2018 , 12:19   Re: ADMIN_LEVEL_H settings
Reply With Quote #3

That is the problem, I am looking for the menu.
TheBladerX is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Rajasthan, India
Old 11-08-2018 , 12:44   Re: ADMIN_LEVEL_H settings
Reply With Quote #4

I didnt get your problem can you please explain more ...
If you are asking that if a player just got ADMIN_LEVEL_H flag and if he can open a menu and change any settings then ofcourse he can

Example :
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("PLUGIN""1.0""AUTHOR")
    
register_clcmd("say /open""createMenu")
}

public 
createMenu(id)
{
    if(!(
get_user_flags(id) & ADMIN_LEVEL_H)) return;
    new 
menu menu_create("My Menu""menu_handler")
    
menu_additem(menu"Hello")
    
menu_additem(menu"world")

    
menu_display(idmenu)
}

public 
menu_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_HANDLED

He can open this menu and can change anything mentioned in the menu
__________________
CSIndia The only Indian Scripters Community
instinctpt1 is offline
TheBladerX
Member
Join Date: Dec 2012
Location: Slovakia
Old 11-10-2018 , 19:03   Re: ADMIN_LEVEL_H settings
Reply With Quote #5

Okay, so this is the case.
I have some settings already done here:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <cstrike>

#define PLUGIN "VIP+Extra VIP"
#define VERSION "1.0"
#define AUTHOR "Pur3 A Robo-Skiller"
#define EDIT "FesikCZ"

#define EVIP ADMIN_LEVEL_G // Flaga pre EVIP
#define VIP ADMIN_LEVEL_H // Flaga pre VIP
#define VIPTXT "vip.txt" // V "*" je súbor v ktorom máš svojho VIP popis
#define EVIPTXT "evip.txt" // E "*" je súbor v ktorom máš svojho EVIP popis

static const START[ ] = "^1[^4Gamers-United^1]" // Čo sa hráčom ukáže pred textom

new player_t[ ] = "gdistrictxiah" // Tu si daj názov ** T ** skinu 
new player_ct[ ] = "gdistrictjoker" // Tu si daj názov ** CT ** skinu 

new precache_ct[ ] = "models/player/gdistrictjoker/gdistrictjoker.mdl"
new precache_t[ ] = "models/player/gdistrictxiah/gdistrictxiah.mdl"
new precache_tT[ ] = "models/player/gdistrictxiah/gdistrictxiahT.mdl"

/*new player_t1[ ] = "evip_t" // Tu si daj názov ** T ** skinu 
new player_ct1[ ] = "evip_ct" // Tu si daj názov ** CT ** skinu

new precache_ct1[ ] = "models/player/evip_ct/evip_ct.mdl"
new precache_t1[ ] = "models/player/evip_t/evip_t.mdl"*/


new Menu33 ], Round33 ], Weapon33 ], boolHasC433 ]

new 
g_iMaxPlayersg_iHudSync

new killHPhskillHPkillMoneyhskillMoneykillMoneyhrachskillMoneyhracmaxHP
new onoffhp133 ], onfoffhphs133 ], onoffmoney133 ]
new 
onoffmoneyonoffhponoffskinonoffnastavonoffhsonoffmenu

public plugin_init( ) {
    
    
RegisterHamHam_Spawn"player""hrac_spawn")
    
RegisterHamHam_Killed"player""hrac_killed" )
    
    
register_logevent"round_first"2"0=World triggered""1&Restart_Round_" )
    
register_logevent"round_first"2"0=World triggered""1=Game_Commencing" )
    
    
register_event"Damage""hrac_damage""b""2!0""3=0""4!0" )
    
    
//register_clcmd( "say /vmenu", "cmd_menu" )
    //register_clcmd( "say_team /vmenu", "cmd_menu" )
    //register_clcmd( "say /menu", "cmd_menu" )
    //register_clcmd( "say_team /menu", "cmd_menu" )
    
register_clcmd"say /nastavenia""cmd_nastaveni" )
    
register_clcmd"vipnastavenia""cmd_nastaveni" )
    
register_clcmd"say_team /nastavenia""cmd_nastaveni" )
    
register_clcmd"say /nastaveni""cmd_nastaveni" )
    
register_clcmd"say_team /nastaveni""cmd_nastaveni" )
    
register_clcmd"say /vips""print_vips" )
    
register_clcmd"say_team /vips""print_vips" )
    
register_clcmd"say /rs""cmd_resetscore" )
    
register_clcmd"say_team /rs""cmd_resetscore" )
    
register_clcmd"say /resetscore""cmd_resetscore" )
    
register_clcmd"say_team /resetscore""cmd_resetscore" )
    
register_clcmd"say /vip""cmd_motd" )
    
//register_clcmd( "say /evips", "print_vips" )
    //register_clcmd( "say /evip", "cmd_motd" )

    
onoffmoney    register_cvar("vip_OnOffMoney",    "1"// Zapne/Vypne Peniaze za KILL,HS( 0 = OFF, 1 = ON )
    
onoffhp        register_cvar("vip_OnOffHP",        "1"// Zapne/Vypne HP za Kill( 0 = OFF, 1 = ON )
    
onoffhs        register_cvar("vip_OnOffHPHS",    "1"// Zapne/Vypne HP za Head Shot ( 0 = OFF, 1 = ON )
    
onoffskin    register_cvar("vip_OnOffSkins",    "1"// Zapne/Vypne Skins Postav ( 0 = OFF, 1 = ON )
    
onoffnastav    register_cvar("vip_OnOffNastaveni",     "1"// Zapne/Vypne Nastavenia ( 0 = OFF, 1 = ON )
    
onoffmenu    register_cvar("vip_OnOffMenu",     "0"// Zapne/Vypne Menu ( 0 = OFF, 1 = ON )
    
    
killHP         register_cvar("vip_killHP",         "5"// Nastavuje hodnotu HP za KILL
    
hskillHP     register_cvar("vip_hskillHP",     "10"// Nastavuje hodnotu HP za HS
    
killMoney     register_cvar("vip_killMoney",     "5"// Nastavuje hodnotu Peniaze za KILL
    
hskillMoney     register_cvar("vip_hskillMoney",     "10"// Nastavuje hodnotu Peniaze za HS
    
killMoneyhrac     register_cvar("vip_killMoneyhrac",     "3"// Nastavuje hodnotu Peniaze za KILL
    
hskillMoneyhrac     register_cvar("vip_hskillMoneyhrac",     "6"// Nastavuje hodnotu Peniaze za HS
    
maxHP         register_cvar("vip_maxHP",         "150"// Nastavuje hodnotu MAX doplnených HP
    
    
g_iMaxPlayers get_maxplayers( )
    
g_iHudSync CreateHudSyncObj( )
    
//register_message(23, "spray_block")
}

public 
plugin_precache() 
{
    
precache_model(precache_ct)
    
precache_model(precache_t)
    
precache_model(precache_tT)
    
/*precache_model(precache_ct1)
    precache_model(precache_t1)*/

}

/*public spray_block(id) 
{
    if(~get_user_flags(id) & EVIP)
        return PLUGIN_CONTINUE
    return PLUGIN_HANDLED
}*/

public cmd_fade(id)
{
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("ScreenFade"), .player=id)
    {
        
write_short(1<<12)
        
write_short(1<<5)
        
write_short(0x0000)
        
write_byte(0)
        
write_byte(0)
        
write_byte(255)
        
write_byte(75)
    }
    
message_end()
                
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("ScreenShake"), .player=id)
    {
        
write_short(255<<5)
        
write_short(50<<5)
        
write_short(255<<5)
    }
    
message_end()
}

public 
cmd_motd(id)
{
    
show_motd(idVIPTXT)
        
//show_motd(id, EVIPTXT)
}

public 
cmd_resetscore(id)
{
    if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
set_user_frags(id0)
        
cs_set_user_deaths(id0)
        
        
ChatColor(id"%s Uspesne si si ^4zresetoval ^3skore^1!"START)
    }
    else
    {
        
ChatColor(id"%s Ak si chces ^4zresetovat ^3skore^1 zakup si ^4VIP^1!"START)
    }
}

public 
client_putinserver(id)
{
    
Weapon[id] = 0
    Round
[id] = 0
    Menu
[id] = 0
    
    onoffhp1
[id] = 1
    onfoffhphs1
[id] = 1
    onoffmoney1
[id] = 1
}

public 
round_first()
{
    for(new 
0g_iMaxPlayersi++)
    {
        
Round[i] = 0
    
}
}

public 
cmd_menu(id)
{
    if(
is_user_alive(id))
    {
        if(
get_pcvar_num(onoffmenu))
        {
            static 
item[64]
            
            
formatex(itemcharsmax(item), "\w[\yVIP\ Menu]")
            new 
menu menu_create(item"menu_handler")
            
            
formatex(itemcharsmax(item), "\yM\r4A1 \w+ \rD\yeagle \r[\yVIP\r]")
            
menu_additem(menuitem"1"0)
            
            
formatex(itemcharsmax(item), "\yA\rK47 \w+ \rD\yeagle \r[\yVIP\r]")
            
menu_additem(menuitem"2"0)
            
            
formatex(itemcharsmax(item), "\yA\rWP \w+ \rD\yeagle \r[\yEVIP\r]")
            
menu_additem(menuitem"3"0)

            
formatex(itemcharsmax(item), "\yF\rAMAS \w+ \rD\yeagle \r[\yEVIP\r]")
            
menu_additem(menuitem"4"0)

            
menu_addblank(menu0)
            
            
formatex(itemcharsmax(item), "\yNastavenia \yVyhod")
            
menu_additem(menuitem"5"0)
            
            
formatex(itemcharsmax(item), "\yZakupit \rVIP")
            
menu_additem(menuitem"6"0)
            
            
menu_addblank(menu0)
            
            if(
Menu[id]) {
                
formatex(itemcharsmax(item), "\w[\yNezobrazovat\w]")
                
menu_additem(menuitem"7"0)
            } else {
                
formatex(itemcharsmax(item), "\w[\yZobrazovat\w]")
                
menu_additem(menuitem"7"0)
            }
                
            
menu_setprop(menuMPROP_EXITNAME"\yUzavrit")
            
menu_setprop(menuMPROP_NUMBER_COLOR"\r" )
            
menu_display(idmenu0)
        }
        }else{
        
ChatColor(id"%s Nie si ^4VIP ^3hrac^1!"START)
    }
}

public 
menu_handler(idmenuitem)
{
    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    
    new 
key str_to_num(data)
    
    switch(
key)
    {
        case 
1:
        {
            if(
Round[id] >= 2)
            {
                if(!
Weapon[id])
                {
                    if(
user_has_weapon(idCSW_C4) && cs_get_user_team(id) & CS_TEAM_T)
                        
HasC4[id] = true
                    
else
                        
HasC4[id] = false
                        
                    Weapon
[id] = 1
                        
                    strip_user_weapons
(id)
                        
                    if(
HasC4[id]) {
                        
give_item(id"weapon_c4")
                        
cs_set_user_plant(id)
                    }
                        
                    
give_item(id"weapon_m4a1")
                    
give_item(id"weapon_deagle")
                    
give_item(id"weapon_knife")
                        
                    
give_item(id"weapon_hegrenade")
                    
give_item(id"weapon_smokegrenade")
                    
give_item(id"weapon_flashbang")
                    
give_item(id"weapon_flashbang")
                        
                    
give_item(id"item_thighpack")
                        
                    
cs_set_user_bpammo(idCSW_M4A190)
                    
cs_set_user_bpammo(idCSW_DEAGLE35)
                        
                    
ChatColor(id"%s Prave si dostal ^3M4A1 ^4s ^3Deaglom^1!"START)
                }
                else
                {
                    
ChatColor(id"%s Uz si si vybral ^3jednu ^4zbran^1!"START)
                }
            }
            else
            {
                
ChatColor(id"%s Zbran si mozes vybrat az po^4 1 ^3kole^1!"START)
            }
        }
        case 
2:
        {
            if(
Round[id] >= 2)
            {
                if(!
Weapon[id])
                {
                    if (
user_has_weapon(idCSW_C4) && cs_get_user_team(id) & CS_TEAM_T)
                        
HasC4[id] = true
                    
else
                        
HasC4[id] = false
                        
                    Weapon
[id] = 1
                        
                    strip_user_weapons
(id)
                        
                    if(
HasC4[id]) {
                        
give_item(id"weapon_c4")
                        
cs_set_user_plant(id)
                    }
                        
                    
give_item(id"weapon_ak47")
                    
give_item(id"weapon_deagle")
                    
give_item(id"weapon_knife")
                        
                    
give_item(id"weapon_hegrenade")
                    
give_item(id"weapon_smokegrenade")
                    
give_item(id"weapon_flashbang")
                    
give_item(id"weapon_flashbang")
                        
                    
give_item(id"item_thighpack")
                        
                    
cs_set_user_bpammo(idCSW_AK4790)
                    
cs_set_user_bpammo(idCSW_DEAGLE35)
                        
                    
ChatColor(id"%s Prave si dostal ^3AK47 ^4s ^3Deaglom^1!"START)
                }
                else
                {
                    
ChatColor(id"%s Uz si si vybral ^3jednu ^4zbran^1!"START)
                }
            }
            else
            {
                
ChatColor(id"%s Zbran si mozes vybrat az po^4 1 ^3kole^1!"START)
            }
        }
        case 
3:
        {
            if(
Round[id] >= 2)
            {
                if(
get_user_flags(id) & ADMIN_LEVEL_G)
                     {
                    if(!
Weapon[id])
                    {
                        if (
user_has_weapon(idCSW_C4) && cs_get_user_team(id) & CS_TEAM_T)
                            
HasC4[id] = true
                        
else
                            
HasC4[id] = false
                            
                        Weapon
[id] = 1
                        
                        strip_user_weapons
(id)
                        
                        if(
HasC4[id]) {
                            
give_item(id"weapon_c4")
                            
cs_set_user_plant(id)
                        }
                        
                        
give_item(id"weapon_awp")
                        
give_item(id"weapon_deagle")
                        
give_item(id"weapon_knife")
                        
                        
give_item(id"weapon_hegrenade")
                        
give_item(id"weapon_smokegrenade")
                        
give_item(id"weapon_flashbang")
                        
give_item(id"weapon_flashbang")
                        
                        
give_item(id"item_thighpack")
                        
                        
cs_set_user_bpammo(idCSW_AWP90)
                        
cs_set_user_bpammo(idCSW_DEAGLE35)
                        
                        
ChatColor(id"%s Prave si dostal ^3AWP ^4s ^3Deaglom^1!"START)
                    }
                    else
                    {
                        
ChatColor(id"%s Uz si si vybral ^3jednu ^4zbran^1!"START)
                    }
                }
                else
                {
                    
ChatColor(id"%s Musis ^3byt ^4EVIP^1!"START)
                }
            }
            else
            {
                
ChatColor(id"%s Zbran si mozes vybrat az po^4 1 ^3kole^1!"START)
            }
        }
        case 
4:
        {
            if(
Round[id] >= 2)
            {
                if(
get_user_flags(id) & ADMIN_LEVEL_G)
                     {
                    if(!
Weapon[id])
                    {
                        if(
user_has_weapon(idCSW_C4) && cs_get_user_team(id) & CS_TEAM_T)
                            
HasC4[id] = true
                        
else
                            
HasC4[id] = false
                        
                        Weapon
[id] = 1
                        
                        strip_user_weapons
(id)
                        
                        if(
HasC4[id]) {
                            
give_item(id"weapon_c4")
                            
cs_set_user_plant(id)
                        }
                        
give_item(id"weapon_famas")
                        
give_item(id"weapon_deagle")
                        
give_item(id"weapon_knife")
                        
                        
give_item(id"weapon_hegrenade")
                        
give_item(id"weapon_smokegrenade")
                        
give_item(id"weapon_flashbang")
                        
give_item(id"weapon_flashbang")
                        
                        
give_item(id"item_thighpack")
                        
                        
cs_set_user_bpammo(idCSW_FAMAS90)
                        
cs_set_user_bpammo(idCSW_DEAGLE35)
                        
                        
ChatColor(id"%s Prave si dostal ^3FAMAS ^4s ^3Deaglom^1!"START)
                    }
                    else
                    {
                        
ChatColor(id"%s Uz si si vybral ^3jednu ^4zbran^1!"START)
                    }
                }
                else
                {
                    
ChatColor(id"%s Musis ^3byt ^4EVIP^1!"START)
                }
            }
            else
            {
                
ChatColor(id"%s Zbran si mozes vybrat az po^4 1 ^3kole^1!"START)
            }
        }
        case 
5:
        {
            if(
get_pcvar_num(onoffnastav)) {
                
cmd_nastaveni(id)
            } else {
                
ChatColor(id"%s ^4Nastavenia^1 su na tomto ^4servery ^3vypnute^1!"START)
            }
        }
        case 
6:
        {
            
cmd_motd(id)
        }
        case 
7:
        {
            if(
Menu[id])
                
Menu[id] = 0
            
else
                
Menu[id] = 1
            cmd_menu
(id)
        }
        case 
8:
        {
            
//...
        
}
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}

public 
cmd_nastaveni(id)
{
    if(
get_user_flags(id) & VIP)
    {
        if(
get_pcvar_num(onoffnastav))
        {
            new 
hp get_pcvar_num(onoffhp)
            new 
hphs get_pcvar_num(onoffhs)
            new 
money get_pcvar_num(onoffmoney)
            
            static 
item[64]
            
            
formatex(itemcharsmax(item), "\yVip \rNastavenia")
            new 
menu menu_create(item"nastaveni_handler")
            
            if(
hp)
            {
                if(
onoffhp1[id]) {
                    
formatex(itemcharsmax(item), "\wBonusove HP za zabitie \y[ZAPNUTE]")
                    
menu_additem(menuitem"1"0)
                } else {
                    
formatex(itemcharsmax(item), "\wBonusove HP za zabitie \r[VYPNUTE]")
                    
menu_additem(menuitem"1"0)
                }
            }
            
            if(
hphs)
            {
                if(
onfoffhphs1[id]) {
                    
formatex(itemcharsmax(item), "\wBonusove HP za headshot \y[ZAPNUTE]")
                    
menu_additem(menuitem"2"0)    
                } else {
                    
formatex(itemcharsmax(item), "\wBonusove HP za headshot \r[VYPNUTE]")
                    
menu_additem(menuitem"2"0)    
                }
            }
            
            if(
money)
            {
                if(
onoffmoney1[id]) {
                    
formatex(itemcharsmax(item), "\wBonusove $ za zabitie \y[ZAPNUTE]")
                    
menu_additem(menuitem"3"0)    
                } else {
                    
formatex(itemcharsmax(item), "\wBonusove $ za zabitie \r[VYPNUTE]")
                    
menu_additem(menuitem"3"0)    
                }
            }
            
                        
            if(
hp || hphs || money
                
menu_addblank(menu0)
            
            
formatex(itemcharsmax(item), "\yHlavne menu")
            
menu_additem(menuitem"4"0)
            
            
formatex(itemcharsmax(item), "\wUzavriet")
            
menu_additem(menuitem"5"0)
            
            
menu_setprop(menuMPROP_EXITMEXIT_NEVER)
            
menu_setprop(menuMPROP_NUMBER_COLOR"\r" )
            
menu_display(idmenu0)
        }
        else
        {
            
ChatColor(id"%s ^4Nastavenia^1 su na tomto ^4servery ^3vypnute^1!"START)
        }
    }
    else
    {
        
ChatColor(id"%s Nie si ^4VIP ^3hrac^1!"START)
    }
    return 
PLUGIN_HANDLED
}

public 
nastaveni_handler(idmenuitem)
{
    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    
    new 
key str_to_num(data)
    
    switch(
key)
    {
        case 
1:
        {
            if(
onoffhp1[id]) {
                
ChatColor(id"%s Vypol si ^3pridavanie HP za zabitie"START)
                
onoffhp1[id] = 0
            
} else {
                
ChatColor(id"%s Zapol si ^3pridavanie HP za zabitie"START)
                
onoffhp1[id] = 1
            
}
            
cmd_nastaveni(id)
        }
        case 
2:
        {
            if(
onfoffhphs1[id]) {
                
ChatColor(id"%s Vypol si ^3pridavanie HP za headshot"START)
                
onfoffhphs1[id] = 0
            
} else {
                
ChatColor(id"%s Zapol si ^3pridavanie HP za headshot"START)
                
onfoffhphs1[id] = 1
            
}
            
cmd_nastaveni(id)        
        }
        case 
3:
        {
            if(
onoffmoney1[id]) {
                
ChatColor(id"%s Vypol si ^3pridavanie $ za zabitie"START)
                
onoffmoney1[id] = 0
            
} else {
                
ChatColor(id"%s Zapol si ^3pridavanie $ za zabitie"START)
                
onoffmoney1[id] = 1
            
}
            
cmd_nastaveni(id)
        }
        case 
4:
        {
            
client_cmd(id,"gdkmenu")
        }
        case 
5:
        {
            
//...
        
}
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}

public 
hrac_spawn(id
{
    
Round[id]++
    
    if(
get_pcvar_num(onoffmenu))
    {
        if(
Menu[id]) 
        {
            if(
get_user_flags(id) & VIP)
            {
            
cmd_menu(id)
            }
        } else {
            
ChatColor(id"%s K otvoreniu menu, napis !g/!tmenu!y"START)
        }
    }
        
    if(
get_user_flags(id) & VIP)
    {
        
Weapon[id] = 0
        
        
//give_item(id, "weapon_hegrenade")
        
give_item(id"weapon_smokegrenade")    
        
//give_item(id, "weapon_flashbang")
        //give_item(id, "weapon_flashbang")            
        
        //give_item(id, "item_thighpack")
        //give_item(id, "item_assaultsuit")
        
        
if(get_pcvar_num(onoffskin))
        {
            if(
cs_get_user_team(id) & CS_TEAM_CT
            {
                
cs_set_user_model(idplayer_ct)
            }
            if(
cs_get_user_team(id) & CS_TEAM_T
            {
                
cs_set_user_model(idplayer_t)
            }
        }
    }
    
/*else if(get_user_flags(id) & EVIP)
    {
        Weapon[id] = 0
        
        give_item(id, "weapon_hegrenade")
        give_item(id, "weapon_smokegrenade")    
        give_item(id, "weapon_flashbang")
        give_item(id, "weapon_flashbang")            
        
        give_item(id, "item_thighpack")
        give_item(id, "item_assaultsuit")
        
        if(get_pcvar_num(onoffskin))
        {
            if(cs_get_user_team(id) & CS_TEAM_CT) 
            {
                cs_set_user_model(id, player_ct1)
            }
            if(cs_get_user_team(id) & CS_TEAM_T) 
            {
                cs_set_user_model(id, player_t1)
            }
        }
    }*/
}

public 
hrac_killed(victimattackershouldgib)
{
    new 
HPkill get_pcvar_num(killHP)
    new 
HPkillhs get_pcvar_num(hskillHP)
    new 
Moneykill get_pcvar_num(killMoney)
    new 
Moneykillhs get_pcvar_num(hskillMoney)
    new 
Moneykillhrac get_pcvar_num(killMoneyhrac)
    new 
Moneykillhshrac get_pcvar_num(hskillMoneyhrac)
    new 
HPmax get_pcvar_num(maxHP)
    
    if(
get_user_flags(attacker) & VIP && is_user_alive(attacker))
    {
        if(
get_pcvar_num(onoffhp))
        {
            if(
onoffhp1[attacker])
            {
                
set_user_health(attackerget_user_health(attacker) + HPkill)
                
                
set_hudmessage(00100, -1.00.2900.01.8)
                
ShowSyncHudMsg(attackerg_iHudSync"+%s HP"HPkill)
                
cmd_fade(attacker)
            }    
        }
        if(
get_pcvar_num(onoffhs))
        {
            if(
get_pdata_int(victim75) == HIT_HEAD && onfoffhphs1[attacker])
            {
                
set_user_health(attackerget_user_health(attacker) + HPkillhs)
                
                
set_hudmessage(00100, -1.00.3100.01.8)
                
ShowSyncHudMsg(attackerg_iHudSync"+%s HP (hlava)"HPkillhs)
                
cmd_fade(attacker)
            }
        }
        if(
get_user_health(attacker) > HPmax)
        {
            
set_user_health(attackerHPmax)
        }    
        if(
get_pcvar_num(onoffmoney))
        {
            if(
onoffmoney1[attacker])
            {
                
cs_set_user_money(attackercs_get_user_money(attacker) + Moneykill)
                
                if(
get_pdata_int(victim75) == HIT_HEAD)
                {
                    
cs_set_user_money(attackercs_get_user_money(attacker) + Moneykillhs)
                }
            }
        }
    else if(
get_user_flags(attacker) & ADMIN_USER && is_user_alive(attacker))
    {
        
cs_set_user_money(attackercs_get_user_money(attacker) + Moneykillhrac)
                
        if(
get_pdata_int(victim75) == HIT_HEAD)
        {
        
cs_set_user_money(attackercs_get_user_money(attacker) + Moneykillhshrac)
        }
    }
    }    
}

public 
hrac_damage(id)
{
    static 
attackerattacker get_user_attacker(id)
    static 
damagedamage read_data(2)    
        
    if(
get_user_flags(id) & VIP)
    {
        
set_hudmessage(025500.450.5020.14.00.10.1, -1)
        
ShowSyncHudMsg(idg_iHudSync"%i^n"damage)
    }
    
    if(
get_user_flags(attacker) & VIP)
    {
        
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
        
ShowSyncHudMsg(attackerg_iHudSync"%i^n"damage)
    }
}

public 
print_vips(user
{
    new 
vipnames[33][32]
    new 
message[256]
    new 
idcountxlen
    
    
for(id id <= g_iMaxPlayers id++)
        if(
is_user_connected(id))
            if(
get_user_flags(id) & VIP)
                
get_user_name(idvipnames[count++], 31)

    
len format(message255"^x03Online ^x04VIP hraci^x01:^x04 ")
    if(
count 0
    {
        for(
count x++) 
        {
            
len += format(message[len], 255-len"%s%s "vipnames[x], < (count-1) ? ", ":"")
            if(
len 96 
            {
                
print_message(usermessage)
                
len format(message255"^x04 ")
            }
        }
        
print_message(usermessage)
    }
    else 
    {
        
len += format(message[len], 255-len"Zidny VIP hrac nie je ONLINE.")
        
print_message(usermessage)
    }
}


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

stock ChatColor(const id, const input[], any:...) {
     new 
count 1players32 ]
    static 
msg191 ]
    
vformatmsg190input)
    
    
replace_allmsg190"!g""^4" )
    
replace_allmsg190"!y""^1" )
    
replace_allmsg190"!t""^3" )

    
    if(
idplayers] = id; else get_playersplayerscount"ch" )
    {
        for(new 
0counti++)
        {
            if( 
is_user_connectedplayers] ) )
            {
                
message_beginMSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players] )  
                
write_byteplayers] )
                
write_stringmsg )
                
message_end( )
            }
        }
    }

And basically, what I would like to add there, are these things:
1) cmd_fade, which is currently set to
PHP Code:
public hrac_killed(victimattackershouldgib
which is under
PHP Code:
if(get_pcvar_num(onoffhp))
        {
            if(
onoffhp1[attacker])
            {
                
set_user_health(attackerget_user_health(attacker) + HPkill)
                
                
set_hudmessage(00100, -1.00.2900.01.8)
                
ShowSyncHudMsg(attackerg_iHudSync"+%s HP"HPkill)
///////////            cmd_fade(attacker)
            
}    
        } 
-----> to be a single part of
PHP Code:
public cmd_nastaveni(id)
{
    if(
get_user_flags(id) & VIP)
    {
        if(
get_pcvar_num(onoffnastav))
        {
            new 
hp get_pcvar_num(onoffhp)
            new 
hphs get_pcvar_num(onoffhs)
            new 
money get_pcvar_num(onoffmoney)
            
            static 
item[64]
            
            
formatex(itemcharsmax(item), "\yVip \rNastavenia")
            new 
menu menu_create(item"nastaveni_handler")
            
            if(
hp)
            {
                if(
onoffhp1[id]) {
                    
formatex(itemcharsmax(item), "\wBonusove HP za zabitie \y[ZAPNUTE]")
                    
menu_additem(menuitem"1"0)
                } else {
                    
formatex(itemcharsmax(item), "\wBonusove HP za zabitie \r[VYPNUTE]")
                    
menu_additem(menuitem"1"0)
                }
            }
            
            if(
hphs)
            {
                if(
onfoffhphs1[id]) {
                    
formatex(itemcharsmax(item), "\wBonusove HP za headshot \y[ZAPNUTE]")
                    
menu_additem(menuitem"2"0)    
                } else {
                    
formatex(itemcharsmax(item), "\wBonusove HP za headshot \r[VYPNUTE]")
                    
menu_additem(menuitem"2"0)    
                }
            }
            
            if(
money)
            {
                if(
onoffmoney1[id]) {
                    
formatex(itemcharsmax(item), "\wBonusove $ za zabitie \y[ZAPNUTE]")
                    
menu_additem(menuitem"3"0)    
                } else {
                    
formatex(itemcharsmax(item), "\wBonusove $ za zabitie \r[VYPNUTE]")
                    
menu_additem(menuitem"3"0)    
                }
            }
            
                        
            if(
hp || hphs || money
                
menu_addblank(menu0)
            
            
formatex(itemcharsmax(item), "\yHlavne menu")
            
menu_additem(menuitem"4"0)
            
            
formatex(itemcharsmax(item), "\wUzavriet")
            
menu_additem(menuitem"5"0)
            
            
menu_setprop(menuMPROP_EXITMEXIT_NEVER)
            
menu_setprop(menuMPROP_NUMBER_COLOR"\r" )
            
menu_display(idmenu0)
        }
        else
        {
            
ChatColor(id"%s ^4Nastavenia^1 su na tomto ^4servery ^3vypnute^1!"START)
        }
    }
    else
    {
        
ChatColor(id"%s Nie si ^4VIP ^3hrac^1!"START)
    }
    return 
PLUGIN_HANDLED

2) to set hrac_damage as single part cmd_nastaveni as well.

and 3) from this plugin https://forums.alliedmods.net/showthread.php?p=680121
PHP Code:
amx_hud_hide_radar_health_armor (def 1) - Hide RadarHealth and Armor at onceCVAR is renamed from 0.3 version.
amx_hud_hide_crosshair (def 0) - Hide Crosshair 
these two to be single parts of cmd_nastaveni, if it is possible.

Thank you!

Last edited by TheBladerX; 11-10-2018 at 19:06.
TheBladerX 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 21:36.


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