Wolferik66
26-06-12, 21:22
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <cstrike>
#define VIP ADMIN_LEVEL_H
#define HTMLORTXT "vip.txt"
#define HTMLORTXT2 "VIP by Dj pEpSy"
static const START[ ] = "^1[^4CS-HostGame^1]"
static const BUY[ ] = "^3CS-HostGame^1"
new player_t[ ] = "Host_vip_t"
new player_ct[ ] = "Host_vip_ct"
new precache_ct[ ] = "models/player/Host_vip_ct/Host_vip_ct.mdl" //Cesta k CT VIP modelu
new precache_t[ ] = "models/player/Host_vip_t/Host_vip_t.mdl" //Cesta k T VIP modelu
// Index
new Menu[ 33 ], Round[ 33 ], Weapon[ 33 ], bool: HasC4[ 33 ]
// Older
new g_iMaxPlayers, g_iHudSync
// Cvars
new killHP, hskillHP, killMoney, hskillMoney, maxHP
new onoffhp1[ 33 ], onfoffhphs1[ 33 ], onoffmoney1[ 33 ]
new onoffmoney, onoffhp, onoffskin, onoffnastav, onoffhs, onoffmenu
public plugin_init( ) {
register_plugin( "VIP Menu", "3.2", "by Dj pEpSy" )
RegisterHam( Ham_Spawn, "player", "player_spawn", 1 )
RegisterHam( Ham_Killed, "player", "player_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", "player_damage", "b", "2!0", "3=0", "4!0" )
register_clcmd( "say /menu", "cmd_menu" )
register_clcmd( "say /nastavenia", "cmd_nastaveni" )
register_clcmd( "say /vips", "print_adminlist" )
register_clcmd( "say_team /menu", "cmd_menu" )
register_clcmd( "say_team /nastavenia", "cmd_nastaveni" )
register_clcmd( "say_team /vips", "print_adminlist" )
register_clcmd( "say /rs", "cmd_resetscore" )
register_clcmd( "say /resetscore", "cmd_resetscore" )
register_clcmd( "say /vip", "cmd_motd" )
onoffmoney = register_cvar("vip_OnOffMoney", "1")
onoffhp = register_cvar("vip_OnOffHP", "1")
onoffhs = register_cvar("vip_OnOffHPHS", "1") // HP za hlavu
onoffskin = register_cvar("vip_OnOffSkins", "1")
onoffnastav = register_cvar("vip_OnOffNastaveni", "1")
onoffmenu = register_cvar("vip_OnOffMenu", "1")
killHP = register_cvar("vip_killHP", "15")
hskillHP = register_cvar("vip_hskillHP", "15") // Bonus za HS
killMoney = register_cvar("vip_killMoney", "200")
hskillMoney = register_cvar("vip_hskillMoney", "300") // Bonus za HS
maxHP = register_cvar("vip_maxHP", "110")
g_iMaxPlayers = get_maxplayers( )
g_iHudSync = CreateHudSyncObj( )
}
public plugin_precache()
{
precache_model(precache_ct)
precache_model(precache_t)
precache_model("models/player/Host_vip_t/Host_vip_tT.mdl") // Kdy× vßÜ model nepot°ebuje xxxT.mdl tak toto odstra˛te!
}
public cmd_fade(id)
{
message_begin(MSG_ONE_UNRELIABLE, get_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_UNRELIABLE, get_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(id, HTMLORTXT, HTMLORTXT2)
}
public cmd_resetscore(id)
{
if(get_user_flags(id) & VIP)
{
set_user_frags(id, 0)
cs_set_user_deaths(id, 0)
ChatColor(id, "%s Uspesne si si resetoval skore!", START)
}
else
{
ChatColor(id, "%s Ak si chces resetovat skore kup si !gVIP!y!", START)
}
}
public client_putinserver(id)
{
Weapon[id] = 0
Round[id] = 0
Menu[id] = 1
onoffhp1[id] = 1
onfoffhphs1[id] = 1
onoffmoney1[id] = 1
}
public round_first()
{
for(new i = 0; i < g_iMaxPlayers; i++)
{
Round[i] = 0
}
}
public cmd_menu(id)
{
if(get_pcvar_num(onoffmenu))
{
if(is_user_alive(id))
{
static item[64]
formatex(item, charsmax(item), "\rCS-HostGame \yV.I.P \rMenu")
new menu = menu_create(item, "menu_handler")
formatex(item, charsmax(item), "\rM\w4A1 + \rD\weagle")
menu_additem(menu, item, "1", 0)
formatex(item, charsmax(item), "\rA\wK47 + \rD\weagle")
menu_additem(menu, item, "2", 0)
formatex(item, charsmax(item), "\rA\wWP + \rD\weagle")
menu_additem(menu, item, "3", 0)
menu_addblank(menu, 0)
formatex(item, charsmax(item), "\rN\wastavenia \yVyhod")
menu_additem(menu, item, "4", 0)
formatex(item, charsmax(item), "\rZ\wakupit \yVIP")
menu_additem(menu, item, "5", 0)
menu_addblank(menu, 0)
if(Menu[id]) {
formatex(item, charsmax(item), "\rN\wezobrazovat")
menu_additem(menu, item, "6", 0)
} else {
formatex(item, charsmax(item), "\yZ\wobrazovat")
menu_additem(menu, item, "6", 0)
}
formatex(item, charsmax(item), "\rU\wzavriet")
menu_additem(menu, item, "7", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)
menu_setprop(menu, MPROP_NUMBER_COLOR, "\w" )
menu_display(id, menu, 0)
}
}
}
public menu_handler(id, menu, item)
{
new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
if(get_user_flags(id) & VIP)
{
if(Round[id] >= 3)
{
if(!Weapon[id])
{
if(user_has_weapon(id, CSW_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, "item_thighpack")
cs_set_user_bpammo(id, CSW_M4A1, 90)
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
ChatColor(id, "%s Prave si dostal !tM4A1 !ys !tDeaglom!y!", START)
}
else
{
ChatColor(id, "%s Uz si si vybral jednu !tzbran!y!", START)
}
}
else
{
ChatColor(id, "%s Zbran si mozes vybrat az po !t3-tom kole!y!", START)
}
}
else
{
ChatColor(id, "%s Nie si VIP hrac! Zakup si ho na !t%s!y!", START, BUY)
cmd_menu(id)
}
}
case 2:
{
if(get_user_flags(id) & VIP)
{
if(Round[id] >= 3)
{
if(!Weapon[id])
{
if (user_has_weapon(id, CSW_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, "item_thighpack")
cs_set_user_bpammo(id, CSW_AK47, 90)
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
ChatColor(id, "%s Prave si dostal !tAK47 !ys !tDeaglom!y!", START)
}
else
{
ChatColor(id, "%s Uz si si vybral jednu !tzbran!y!", START)
}
}
else
{
ChatColor(id, "%s Zbran si mozes vybrat az po !t3-tom kole!y!", START)
}
}
else
{
ChatColor(id, "%s Nie si VIP hrac! Zakup si ho na !t%s!y!", START, BUY)
cmd_menu(id)
}
}
case 3:
{
if(get_user_flags(id) & VIP)
{
if(Round[id] >= 3)
{
if(!Weapon[id])
{
if (user_has_weapon(id, CSW_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, "item_thighpack")
cs_set_user_bpammo(id, CSW_AWP, 90)
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
ChatColor(id, "%s Prave si dostal !tAWP !ys !tDeaglom!y!", START)
}
else
{
ChatColor(id, "%s Uz si si vybral jednu !tzbran!y!", START)
}
}
else
{
ChatColor(id, "%s Zbran si mozes vybrat az po !t3-tom kole!y!", START)
}
}
else
{
ChatColor(id, "%s Nie si VIP hrac! Zakup si ho na !t%s!y!", START, BUY)
cmd_menu(id)
}
}
case 4:
{
if(get_pcvar_num(onoffnastav)) {
cmd_nastaveni(id)
} else {
ChatColor(id, "%s Nastavenie su na tomto servery !tvypnute!y!", START)
}
}
case 5:
{
cmd_motd(id)
}
case 6:
{
if(Menu[id])
Menu[id] = 0
else
Menu[id] = 1
cmd_menu(id)
}
case 7:
{
//...
}
}
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(item, charsmax(item), "\rNastavenia")
new menu = menu_create(item, "nastaveni_handler")
if(hp)
{
if(onoffhp1[id]) {
formatex(item, charsmax(item), "\yD\woplnovanie HP za \rK\will \y[ZAPNUTE]")
menu_additem(menu, item, "1", 0)
} else {
formatex(item, charsmax(item), "\rD\woplnovanie HP za \rK\will \r[VYPNUTE]")
menu_additem(menu, item, "1", 0)
}
}
if(hphs)
{
if(onfoffhphs1[id]) {
formatex(item, charsmax(item), "\yD\woplnovanie HP za \rH\weadshot \y[ZAPNUTE]")
menu_additem(menu, item, "2", 0)
} else {
formatex(item, charsmax(item), "\rD\woplnovanie HP za \rH\weadshot \r[VYPNUTE]")
menu_additem(menu, item, "2", 0)
}
}
if(money)
{
if(onoffmoney1[id]) {
formatex(item, charsmax(item), "\yD\woplnovanie Penazi za \rK\will \y[ZAPNUTE]")
menu_additem(menu, item, "3", 0)
} else {
formatex(item, charsmax(item), "\rD\woplnovanie Penazi za \rK\will \r[VYPNUTE]")
menu_additem(menu, item, "3", 0)
}
}
if(hp || hphs || money)
menu_addblank(menu, 0)
formatex(item, charsmax(item), "\rV\wratit sa do \rM\wenu")
menu_additem(menu, item, "4", 0)
formatex(item, charsmax(item), "\rU\wzavriet")
menu_additem(menu, item, "5", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)
menu_setprop(menu, MPROP_NUMBER_COLOR, "\w" )
menu_display(id, menu, 0)
}
else
{
ChatColor(id, "%s Nastavenia su na tomto servery !tvypnute!y!", START)
}
}
else
{
ChatColor(id, "%s Nie si VIP hrac! Zakup si ho na !t%s!y!", START, BUY)
}
return PLUGIN_HANDLED
}
public nastaveni_handler(id, menu, item)
{
new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
if(onoffhp1[id]) {
ChatColor(id, "%s Doplnovanie HP za Kill !tVYPNUTE", START)
onoffhp1[id] = 0
} else {
ChatColor(id, "%s Doplnovanie HP za Kill !tZAPNUTE", START)
onoffhp1[id] = 1
}
cmd_nastaveni(id)
}
case 2:
{
if(onfoffhphs1[id]) {
ChatColor(id, "%s Doplnovanie HP za HS !tVYPNUTE", START)
onfoffhphs1[id] = 0
} else {
ChatColor(id, "%s Doplnovanie HP za HS !tZAPNUTE", START)
onfoffhphs1[id] = 1
}
cmd_nastaveni(id)
}
case 3:
{
if(onoffmoney1[id]) {
ChatColor(id, "%s Doplnovanie Penazi za Kill !tVYPNUTE", START)
onoffmoney1[id] = 0
} else {
ChatColor(id, "%s Doplnovanie Penazi za Kill !tZAPNUTE", START)
onoffmoney1[id] = 1
}
cmd_nastaveni(id)
}
case 4:
{
cmd_menu(id)
}
case 5:
{
//...
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public player_spawn(id)
{
Round[id]++
if(get_pcvar_num(onoffmenu))
{
if(Menu[id]) {
cmd_menu(id)
} else {
ChatColor(id, "%s K otvoreniu menu, napis !t/menu!y.", START)
}
}
if(get_user_flags(id) & VIP)
{
Weapon[id] = 0
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_smokegrenade")
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_ct)
}
if(cs_get_user_team(id) & CS_TEAM_T)
{
cs_set_user_model(id, player_t)
}
}
}
}
public player_killed(victim, attacker, shouldgib)
{
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 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(attacker, get_user_health(attacker) + HPkill)
set_hudmessage(0, 0, 100, -1.0, 0.29, 0, 0.0, 1.8)
ShowSyncHudMsg(attacker, g_iHudSync, "+%s HP", HPkill)
cmd_fade(attacker)
}
}
if(get_pcvar_num(onoffhs))
{
if(get_pdata_int(victim, 75) == HIT_HEAD && onfoffhphs1[attacker])
{
set_user_health(attacker, get_user_health(attacker) + HPkillhs)
set_hudmessage(0, 0, 100, -1.0, 0.31, 0, 0.0, 1.8)
ShowSyncHudMsg(attacker, g_iHudSync, "+%s HP (HeadShot Bonus)", HPkillhs)
cmd_fade(attacker)
}
}
if(get_user_health(attacker) > HPmax)
{
set_user_health(attacker, HPmax)
}
if(get_pcvar_num(onoffmoney))
{
if(onoffmoney1[attacker])
{
cs_set_user_money(attacker, cs_get_user_money(attacker) + Moneykill)
if(get_pdata_int(victim, 75) == HIT_HEAD)
{
cs_set_user_money(attacker, cs_get_user_money(attacker) + Moneykillhs)
}
}
}
}
}
public player_damage(id)
{
static attacker; attacker = get_user_attacker(id)
static damage; damage = read_data(2)
if(get_user_flags(id) & VIP)
{
set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(id, g_iHudSync, "%i^n", damage)
}
if(get_user_flags(attacker) & VIP)
{
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(attacker, g_iHudSync, "%i^n", damage)
}
}
public print_adminlist(user)
{
new vipnames[33][32]
new message[256]
new id, count, x, len
for(id = 1 ; id <= g_iMaxPlayers ; id++)
if(is_user_connected(id))
if(get_user_flags(id) & VIP)
get_user_name(id, vipnames[count++], 31)
len = format(message, 255, "^x04VIP ONLINE: ")
if(count > 0)
{
for(x = 0 ; x < count ; x++)
{
len += format(message[len], 255-len, "%s%s ", vipnames[x], x < (count-1) ? ", ":"")
if(len > 96 )
{
print_message(user, message)
len = format(message, 255, "^x04 ")
}
}
print_message(user, message)
}
else
{
len += format(message[len], 255-len, "Ziaden VIP nie je ONLINE.")
print_message(user, message)
}
}
print_message(id, msg[]) {
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}
stock ChatColor(const id, const input[], any:...) {
new count = 1, players[ 32 ]
static msg[ 191 ]
vformat( msg, 190, input, 3 )
replace_all( msg, 190, "!g", "^4" )
replace_all( msg, 190, "!y", "^1" )
replace_all( msg, 190, "!t", "^3" )
if(id) players[ 0 ] = id; else get_players( players, count, "ch" )
{
for(new i = 0; i < count; i++)
{
if( is_user_connected( players[ i ] ) )
{
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[ i ] )
write_byte( players[ i ] )
write_string( msg )
message_end( )
}
}
}
}
Ak sa tomu rozumies toto je moj plugin na Dust 2 only par vyhod mozem pridat napriklad pred menon VIP atd..
Vytvořeno ve vBulletinu® verze 4.2.2 (c) 2024 vBulletin Solutions, Inc. All rights reserved.