/* **************************************************
** Advanced VIP - Version 1.2 by LondoN eXtream **
**************************************************
1. Despre plugin
-----------------
Pluginul este o alternative a pluginului lui Dunno
mult mai optimizata si rapida, care nu contine
absolut niciun bug, totul fiind testat.
2. Instalarea
--------------
Pentru instalare puneti fisierul .sma in folderul
scripting, fisierul .amxx in plugins si in plugins.ini
adaugati: VIP.amxx
3. CVAR's
----------
Pluginul are o varietate de CVAR'uri:
vip_rounds - Default: 3 -> Din cate in cate runde va avea "Free Guns Menu"
vip_hp - Default: 110 -> Cat HP primeste la Spawn
vip_ap - Default: 100 -> Cat AP primeste la Spawn
vip_kill_hp - Default: 10 -> Cat HP primeste pentru 1 kill normal.
vip_kill_ap - Default: 10 -> Cat AP primeste pentru 1 kill normal.
vip_kill_mo - Default: 400 -> Cati bani primeste pentru 1 kill normal.
vip_kill_hp_hs - Default: 15 -> Cat HP primeste pentru 1 headshoot.
vip_kill_ap_hs - Default: 15 -> Cat AP primeste pentru 1 headshoot.
vip_kill_mo_hs - Default: 500 -> Cati bani primeste pentru 1 headshoot.
4. Avantaje
------------
Pluginul ofera o multitudine de avantaje, flag-ul fiind H (ADMIN_LEVEL_H):
* AP/HP la spawn (setat prin cvar);
* AP/HP/Money la kill (setat prin cvar);
* Afisare DMG primit/dat in timp real;
* Meniu de arme gratuite din x in x runde (setat prin cvar);
* Statutul de VIP in scoareboard.
* Mesaj de intampinare la intrarea pe server.
* Multi Jump / Saritura dubla.
* Slot rezervat.
5. Comenzi
-----------
amx_free on/off - Activeaza VIP-ul free pentru toata lumea. (require ADMIN ACCESS);
say /vip -> Afiseaza un meniu cu avantajele VIP-ului.
*/
#include < amxmodx >
#include < amxmisc >
#include <
cstrike >
#include < fun >
#include < hamsandwich >
#include < engine >
/* v1.2 fIX */
new bool: HasC4 [ 33 ];
/////////////////////////////////
new bool: Jump [ 33 ];
new g_RoundCount [ 33 ], Num [ 33 ];
new g_CvarRound, g_CvarHP, g_CvarAP, g_CvarKill [ 3 ], g_CvarKillHS [ 3 ];
new g_iMaxPlayers;
public plugin_init ( )
{
register_plugin ( "VIP Classic", "1.1", "LondoN eXtream" );
g_CvarRound = register_cvar ( "vip_rounds", "3" );
g_CvarHP = register_cvar ( "vip_hp", "110" );
g_CvarAP = register_cvar ( "vip_ap", "100" );
g_CvarKill [ 0 ] = register_cvar ( "vip_kill_hp", "10" );
g_CvarKill [ 1 ] = register_cvar ( "vip_kill_ap", "10" );
g_CvarKill [ 2 ] = register_cvar ( "vip_kill_mo", "400" );
g_CvarKillHS [ 0 ] = register_cvar ( "vip_kill_hp_hs", "15" );
g_CvarKillHS [ 1 ] = register_cvar ( "vip_kill_ap_hs", "15" );
g_CvarKillHS [ 2 ] = register_cvar ( "vip_kill_mo_hs", "500" );
register_event ( "Damage", "Event_ShowDamage", "b", "2!0", "3=0", "4!0" );
register_event ( "DeathMsg", "Event_DeathMsg", "a" );
RegisterHam ( Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1 );
register_message ( get_user_msgid ( "ScoreAttrib" ), "msg_ScoreAttrib" );
register_concmd ( "amx_free", "Client_Free", ADMIN_LEVEL_A, "" );
register_clcmd ( "say /vip", "ShowBenefits" );
g_iMaxPlayers = get_maxplayers ( );
}
public plugin_cfg ( )
{
new szFile [ 128 ], szDir [ 64 ];
get_configsdir ( szDir, charsmax ( szDir ) );
formatex ( szFile, charsmax ( szFile ), "%s/vip_config.cfg", szDir );
if ( file_exists ( szFile ) )
{
server_cmd ( "exec %s", szFile );
server_print ( "[VIP] Succefully executed configuration file" );
}
}
public client_putinserver ( id )
{
if ( !( is_user_bot ( id ) || is_user_hltv ( id ) ) && get_user_flags ( id ) & ADMIN_LEVEL_H )
{
new n [ 32 ], tmp [ 256 ];
get_user_name ( id, n, charsmax ( n ) );
formatex ( tmp, charsmax ( tmp ), "^4[VIP]^1 Jucatorul^3 %s^1 s-a conectat!", n );
message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "SayText" ), _, id );
write_byte ( id );
write_string ( tmp );
message_end ( );
}
}
public Event_ShowDamage ( id )
{
new a = get_user_attacker ( id );
new d = read_data ( 2 );
new s = CreateHudSyncObj ( );
if ( !is_user_alive ( a ) && !is_user_alive ( id ) && !( get_user_flags ( id ) & ADMIN_LEVEL_H ) && !( get_user_flags ( a ) & ADMIN_LEVEL_H ) )
return;
set_hudmessage ( 255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1 );
ShowSyncHudMsg ( id, s, "%i", d );
set_hudmessage ( 0, 127, 255, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1 );
ShowSyncHudMsg ( a, s, "%i", d );
}
public Event_DeathMsg ( )
{
static k; k = read_data ( 1 );
static m; m = cs_get_user_money ( k );
static h; h = get_user_health ( k );
static a; a = get_user_armor ( k );
if ( !is_user_alive ( k ) || k == read_data ( 2 ) || !(get_user_flags ( k ) & ADMIN_LEVEL_H) )
return;
if ( read_data ( 3 ) )
{
set_user_health ( k, h + get_pcvar_num ( g_CvarKill [ 0 ] ) );
set_user_armor ( k , a + get_pcvar_num ( g_CvarKill [ 1 ] ) );
cs_set_user_money ( k, m + get_pcvar_num ( g_CvarKill [ 2 ] ) );
}
else
{
set_user_health ( k, h + get_pcvar_num ( g_CvarKillHS [ 0 ] ) );
set_user_armor ( k, a + get_pcvar_num ( g_CvarKillHS [ 1 ] ) );
cs_set_user_money ( k, m + get_pcvar_num ( g_CvarKillHS [ 2 ] ) );
}
}
public fw_PlayerSpawn_Post ( id )
{
if ( !( 1 <= id <= g_iMaxPlayers ) || !is_user_alive ( id ) || !( get_user_flags ( id ) & ADMIN_LEVEL_H ) )
return;
if ( user_has_weapon ( id, CSW_C4 ) )
HasC4 [ id ] = true;
g_RoundCount [ id ] ++;
set_user_health ( id, get_pcvar_num ( g_CvarHP ) );
set_user_armor ( id, get_pcvar_num ( g_CvarAP ) );
if ( g_RoundCount [ id ] >= get_pcvar_num ( g_CvarRound ) )
{
new Menu = menu_create ( "\\rVIP \\yGuns", "Func_Menu" );
menu_additem ( Menu, "\\wAK47 \\r+ \\wDeagle" );
menu_additem ( Menu, "\\wM4A1 \\r+ \\wDeagle" );
menu_additem ( Menu, "\\wAWP \\r+ \\wDeagle" );
menu_setprop ( Menu, MPROP_EXIT, MEXIT_ALL );
menu_display ( id, Menu, 0 );
}
}
public Func_Menu ( id, Menu, Item )
{
if ( !( Item == MENU_EXIT ) )
{
switch ( Item )
{
case 0: ItemGive ( id, "weapon_ak47", CSW_AK47, 90 );
case 1: ItemGive ( id, "weapon_m4a1", CSW_M4A1, 90 );
case 2: ItemGive ( id, "weapon_awp", CSW_AWP, 35 );
}
}
menu_destroy ( Menu );
return PLUGIN_HANDLED;
}
public msg_ScoreAttrib ( MsgID, MsgDest, MsgReciver )
{
if ( get_user_flags ( get_msg_arg_int ( 1 ) ) & ADMIN_LEVEL_H )
set_msg_arg_int ( 2, ARG_BYTE, (1<<2) );
}
public Client_Free ( id, level, cid )
{
if ( !cmd_access ( id, level, cid, 1 ) )
{
console_print ( id, "[AMXX] Nu ai acces la aceasta comanda" );
return PLUGIN_HANDLED;
}
new x [ 4 ];
read_argv ( 1, x, charsmax ( x ) );
if ( equal ( x, "on" ) )
{
set_cvar_string ( "amx_default_access", "h" );
console_print ( id, "[AMXX] VIP Free Status: ON" );
}
else if ( equal ( x, "off" ) )
{
set_cvar_string ( "amx_default_access", "z" );
console_print ( id, "[AMXX] VIP Free Status: OFF" );
}
server_cmd ( "amx_reloadadmins" );
return PLUGIN_CONTINUE;
}
public ShowBenefits ( id )
{
new Menu = menu_create ( "\\rBenefits", "Func_Ignore" );
new x [ 64 ], y [ 128 ], g [ 64 ];
formatex ( x, charsmax ( x ), "\\wSpawn Benefits^nHP: \\r%d \\w| AP: \\r%d", get_pcvar_num ( g_CvarHP ), get_pcvar_num ( g_CvarAP ) );
formatex ( y, charsmax ( y ), "\\wKill Benefits^nHP: \\r%d/%d \\w| AP: \\r%d/%d \\w| Money: \\r%d/%d", get_pcvar_num ( g_CvarKill [ 0 ] ), get_pcvar_num ( g_CvarKillHS [ 0 ] ), get_pcvar_num ( g_CvarKill [ 1 ] ), get_pcvar_num ( g_CvarKillHS [ 1 ] ), get_pcvar_num ( g_CvarKill [ 2 ] ), get_pcvar_num ( g_CvarKillHS [ 2 ] ) );
formatex ( g, charsmax ( g ), "\\wFree Guns Menu^nOnce at \\r%d \\wround you recive a menu", get_pcvar_num ( g_CvarRound ) );
menu_additem ( Menu, x );
menu_additem ( Menu, y );
menu_additem ( Menu, "\\wPut in Server Message^nWhen you're connected server display a message" );
menu_additem ( Menu, "\\wVIP Status in Score Board^nYou have [VIP] tag in score board" );
menu_additem ( Menu, "\\wReserved Slot^nYou have slot!" );
menu_additem ( Menu, g );
menu_additem ( Menu, "\\wMulti Jump^nYou have 2 jump in air." );
menu_setprop ( Menu, MPROP_EXIT, MEXIT_ALL );
menu_display ( id, Menu, 0 );
return PLUGIN_CONTINUE;
}
public Func_Ignore ( id, Menu, Item ) return PLUGIN_HANDLED;
public client_PreThink ( id )
{
if ( !is_user_alive ( id ) )
return;
if ( get_user_flags ( id ) & ADMIN_LEVEL_H )
{
new n = get_user_button ( id );
new o = get_user_oldbutton ( id );
if ( ( n & IN_JUMP ) && !( get_entity_flags ( id ) & FL_ONGROUND) && !( o & IN_JUMP ) )
{
if ( Num [ id ] < 1 )
{
Jump [ id ] = true;
Num [ id ] ++;
}
}
if ( ( n & IN_JUMP ) && ( get_entity_flags ( id ) & FL_ONGROUND ) )
{
Num [ id ] = 0;
}
}
}
public client_PostThink ( id )
{
if ( !is_user_alive ( id ) )
return;
if ( get_user_flags ( id ) & ADMIN_LEVEL_H && Jump [ id ] )
{
new Float:x [ 3 ];
entity_get_vector ( id, EV_VEC_velocity, x );
x [ 2 ] = random_float ( 265.0, 285.0 );
entity_set_vector ( id, EV_VEC_velocity, x );
Jump [ id ] = false;
}
}
stock ItemGive ( id, const Weapon [ ], CSW_ID, Bullet )
{
strip_user_weapons ( id );
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, "weapon_deagle" );
give_item ( id, Weapon );
cs_set_user_bpammo ( id, CSW_ID, Bullet );
cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );
if ( HasC4 [ id ] )
{
give_item ( id, "weapon_c4" );
HasC4 [ id ] = false;
}
g_RoundCount [ id ] = 0;
}