Raised This Month: $32 Target: $400
 8% 

Help With VIP.SMA ERRORS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CanyoN1337
Junior Member
Join Date: Feb 2019
Old 02-24-2019 , 03:27   Help With VIP.SMA ERRORS
Reply With Quote #1

Hello, I need help with plugin VIP.SMA when I want to compile its showing this errors

VIP.sma(834) : error 035: argument type mismatch (argument 2)
VIP.sma(83 : error 035: argument type mismatch (argument 2)
VIP.sma(929) : error 035: argument type mismatch (argument 2)
VIP.sma(940) : error 035: argument type mismatch (argument 2)
VIP.sma(945) : error 035: argument type mismatch (argument 2)
VIP.sma(953) : error 035: argument type mismatch (argument 2)
VIP.sma(957) : error 035: argument type mismatch (argument 2)
VIP.sma(1023) : error 021: symbol already defined: "client_print_color"
VIP.sma(1023) : error 001: expected token: "=", but found ","
VIP.sma(1023) : error 008: must be a constant expression; assumed zero
VIP.sma(1023) : fatal error 107: too many error messages on one line

Compilation aborted.
11 Errors.
Attached Files
File Type: sma Get Plugin or Get Source (VIP.sma - 293 views - 41.9 KB)
CanyoN1337 is offline
Dragos
Senior Member
Join Date: Oct 2018
Location: Romania
Old 02-24-2019 , 05:45   Re: Help With VIP.SMA ERRORS
Reply With Quote #2

error copiled or what?
Dragos is offline
Dragos
Senior Member
Join Date: Oct 2018
Location: Romania
Old 02-24-2019 , 05:47   Re: Help With VIP.SMA ERRORS
Reply With Quote #3

PHP Code:
/* Plugin generated by AMXX-Studio 
    Original creator: Dunn0
    Remade by: Unkolix
    
    Changelog by me, Unkolix:
    v5.5.1 - Addition to cvar vip_menu_buyzone, if it's 1, player can't get VIP meniu.
    v5.5.0 - New cvar vip_menu_buyzone, if it's 1, then VIP menu will close as soon as player leaves buyzone.
    v5.4.9 - Small optimisations and more explanation!
    v5.4.8 - Fixed show damage to all players and hp add to all players.
    v5.4.7 - Added VIPCVARs.cfg file!
    v5.4.6 - Fixed damge showing.
    v5.4.5 - MotD correction, should work perfectly now. + auto contact info + price in motd.
    v5.4.4 - A new cvar to control how to show online vip list. vip_list 0/1/2. off/chat/motd. Thanks to alicx
    v5.4.3 - Edited all cvars, vip_ prefix added. color_msg now changes /vips colors and vip info color.
    v5.4.2 - Added a cvar for vip price show: amx_vipprice "price"
    v5.4.1 - Renewed amx_contactinfo cvar, now it will be shown when player types /vips and in want vip MotD.
    v5.4.0 - If files awpmapnames.ini and mapnames.ini are missing, they are automatically created.
    v5.3.9 - MotD improvement, no need for other .txt files. Example taken from: souvikdas95
    v5.3.8 - Fixed double grenade throw bug, thanks to ConnorMcLeod.
    v5.3.7 - Now you can control the menu number colors with menu_num_color 0/1/2/3.
    v5.3.6 - Fixed C4 not showing on players back.
    v5.3.5 - Not using colorchat.inc anymore, color stock instead! Small error fix. New cvar colored_text_message - control the printed message color.
    v5.3.4 - Now changing VIP models with Fakemeta module. Tag Mismatch fix.
    v5.3.3 - Grenades fix. Optimization.
    v5.3.2 - VIP models added, controled by a cvar vip_models 1/0
    v5.3.1 - Added error message if files awpmapnames.ini and mapnames.ini doesn't exist. Another way not to allow non VIP players
    to pick up snipers, thanks to SeriousSpot.
    v5.3.0 - Terrorists won't get defuse kits now. New bullet damage system (took from Sn!ff3r). 
    A lot of optimization and fixes, thanks to aaarnas. 2 new cvars, bulletdamage_recieved, bulletdamage
    v5.2.9 - Multi-lingual "Back." menu item added.
    v5.2.8 - Fixed menu choices after death and on new round.
    v5.2.7 - Now you can easily change the flag wich gives all the abilities. Thanks to quilhos.
    v5.2.6 - Multi-lingual want vip MotD added
    v5.2.5 - Small sniper pickup fix
    v5.2.4 - Now players won't lose their defuse kits after taking weapons from menu
    v5.2.3 - Fixed flashed bug, a little change on motd window
    v5.2.2 - Fixed player_menu_info error
    v5.2.1 - Not using stripweapons include anymore, just to get rid of that shield bug.
    v5.2 - Several fixes, optimization. New cvar to control if only VIP's can pick up snipers.
    v5.1 - Fixed shield bug.
    v5.0 - Multi-lingual added!
    v4.9.2 - New cvar, awp_active. 1 - VIP can get AWP choice; 0 - cann't
    v4.9.1 - AWP choice improvement. New Cvar, awp_menu_round, set the round from which VIP can see AWP choice.
    v4.8 - Fixed VIP menu dilsplay after player death. Thanks to vitorrossi.
    v4.7 - Fixed fading bug/glitch that was removing flashbang effect. Thanks to ConnorMcLeod.
    v4.6 - Fixed log error. Thanks to wickedd.
    v4.5 - OPTIMISATION, thanks to Backstabnoob.
    v4.4 - New Cvars awp_ct and awp_tr, how mant counter-terrorists and terrorists must be in each team to get AWP choice in VIP menu
    v4.3 - New feature, AWP only from sertain amount of players. Thanks to Emp`.
    v4.2 - Added new Cvar, vip_menu_uses. Thanks to Erox902.
    v4.1 - mapnames and awpmapnames consts are now readed from 2 files, awpmanames.ini and mapnames.ini. Thanks to fysiks.
    v4.0 - New feature, awp an't be used in maps that are mentioned in awpmapnames const. UPDATE: awpmapnames.ini
    v3.9 - Added new menu item, AWP.
    v3.8 - Improved v3.7 update. Thanks to Bugsy.
    v3.7 - New feature, VIP menu can't be shown on maps which are listed in mapnames const. UPDATED: mapnames.ini
    v3.6 - Small part is rewrited with drekes help, he made stripweapons.inc
    v3.5 - Fixed triple VIP message. Thanks jimaway!
    v3.4 - Fixed a bug/glitch which didn't let player to have AWP, even on awp maps! Now, they can't buy it, but if they find it, they can have it.
    v3.3 - Completely remade menu
    v3.2 - Fixed a bug/glitch when all VIP players was getting defuse kit on all maps. Now only on maps which has bombsites and only for CT. Thanks ConnorMcLeod
    v3.1 -  Added commands to call VIP menu. Thanks Stereo!
    
    Changelog by original author Dunn0:
    Updates on 3.0version
    Granates bug fixed, give it when round starts only. Removed hamsandwich module becouse i removed event witch was usualess.
    
    Updates on 2.06version
    Fixed C4 Planting just need'ed remove 1 simbol... Remove'd AWP pick up now only VIP can buy awp and non VIP can pick up it from ground. Fixed Bug whit menu was giving in first round I changed some events and it works just fine.
    
    Updates on 2.05version
    Was not working /wantvip , /vips command it got fixed. Was removed "pickup_active 1" cvar (couse was to much commands in registrations. Was removed some useless commands. Now changed that Only VIPS can buy awp weapons but normal players can pick up awp if VIPS drop it.
    
    Updates on 2.04version
    Menu Fixed now it always shows only from 3rd round. Nades , armor will give when u spawn not from round start. Some small fixes on Event_curweapons. 
    Add cvar pickup_active 1 so now if u write pickup_active 0 not vips will can pick up AWP weapons just wont be able to buy.
    
    Updated at 2.03version
    Repaired C4 bug now u can plant it
    
    Updated at 2.02version
    Repaired C4 bug
    
    UPDATE's at 2.01version
    Well i add'ed 2 new cvar's becouse people was asking it
    First is "menu_active 1" so now u can turn off menu when u will one.
    Second is "sniper_active 1" well if u will do it 0 all people will can buy awp.
*/

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

#define PLUGIN "VIP Plugin"
#define VERSION "5.5.0"
#define AUTHOR "Unkolix"

#define VIP_FLAG ADMIN_LEVEL_H
#define MAXPLAYERS 32 + 1
#define ALPHA_FULLBLINDED 255
#define g_Buffer 1536
#define find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)

static const COLOR[] = "^x04" //green
const m_flFlashedUntil 514;
const 
m_flFlashedAt 515;
const 
m_flFlashHoldTime 516;
const 
m_flFlashDuration 517;
const 
m_iFlashAlpha 518;
const 
m_flFlashDuration 517;
new 
gMenuUsed[33];
new 
money_per_damagemoney_kill_bonusmoney_headshot_bonus;
new 
health_addhealth_hs_addhealth_max;
new 
nKillernKiller_hpnHp_addnHp_max;
new 
g_sniper_activeg_menu_activeg_map_activeg_awp_activeawp_activeg_buyzone_activebuyzone_active;
new 
g_menu_usesg_awp_ctg_awp_trg_menu_roundg_awp_menu_roundg_sniper_pickup;
new 
map_activeCTTRmenu_roundawp_menu_roundmenu_uses;
new 
CurrentRound;
new 
bool:g_bHasBombSite;
new 
bool:g_freezetime;
new 
bool:bAwpMap false;
new 
bool:g_bCurrentMapIsInList false
new 
bool:g_bCurrentAWPMapIsInList false;
new 
bool:g_bRoundEnd;
new 
iTCountiCTCount;
new 
g_typeg_enabledg_recievedbool:g_showrecievedg_hudmsg1g_hudmsg2;
new 
g_models_enabledmodels_enabled;
new const 
VIP_CT[] = "vip_ct";
new const 
VIP_CT_MODEL[] = "models/player/vip_ct/vip_ct.mdl";
new const 
VIP_TR[] = "vip_tr";
new const 
VIP_TR_MODEL[] = "models/player/vip_tr/vip_tr.mdl";
new 
player_model[33][32], bool:g_model[33], bool:UserInBuyZone[33];
new 
g_color_msgcolor_msgg_menu_number_colormenu_number_color;
new 
g_vips_listvips_listmenu;

new const 
vipmenu[][] =
{
    
//Commands to call VIP menu
    
"say /vipmenu""say vipmenu""say_team /vipmenu""say_team vipmenu""say vmenu""say_team vmenu"


new const 
VIPweapons[][] =
{
    
//Weapons which normal players can't pick up.
    
"awp""sg550""g3sg1"
}

new const 
wantvip[][] =
{
    
//Commands which call wantvip.txt motd window
    
"say /wantvip""say wantvip""say_team /wantvip""say_team wantvip",
    
"say /noriuvip""say noriuvip""say_team /noriuvip""say_team noriuvip",
    
"say /chciecvip""say chciecvip""say_team /chciecvip""say_team chciecvip",
    
"say /willenvip""say willenvip""say_team /willenvip""say_team willenvip",
    
"say /vouloirvip""say vouloirvip""say_team /vouloirvip""say_team vouloirvip"
}

new const 
vipguns[][] =
{
    
//Guns that are only for VIP (controlled via CVAR)
    
"weapon_awp""weaopn_g3sg1""weapon_sg550"
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("LogEvent_RoundEnd"2"1=Round_End");
    
register_logevent("LogEvent_RoundStart"2"1=Round_Start" );
    
register_logevent("LogEvent_GameCommencing"2"0=World triggered""1=Game_Commencing");

    
register_event("Damage","Damage","b");
    
register_event("DeathMsg","death_msg","a");
    
register_event("DeathMsg""hook_death""a""1>0");
    
register_event("HLTV""event_new_round""a""1=0""2=0");
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w");
    
register_event("Damage""on_damage""b""2!0""3=0""4!0");
    
register_event("StatusIcon""Event_StatusIcon_Show_buyzone""be""1=1""2=buyzone");
    
register_event("StatusIcon""StatusIcon_buyzone_OFF""be""1=0""2=buyzone");
    
    
RegisterHam(Ham_Touch"weaponbox""fw_TouchWeapon");
    
RegisterHam(Ham_Touch"armoury_entity""fw_TouchWeapon");
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
    
register_forward(FM_SetClientKeyValue"fw_SetClientKeyValue");
    
register_forward(FM_ClientUserInfoChanged"fw_ClientUserInfoChanged");
    
    for(new 
0sizeof wantvipi++)
    
register_clcmd(wantvip[i], "ShowMotd"//Checks const wantvip, that is above plugin_init
    
for(new 0sizeof vipmenui++)
    
register_clcmd(vipmenu[i], "cmdvipmenu"//Checks const vipmenu, that is above plugin_init
    
for(new 0sizeof VIPweaponsi++)
    
register_clcmd(VIPweapons[i], "HandleCmd"//Checks const VIPweapons, that is above plugin_init
    
    
register_clcmd("say /vips","print_adminlist"//If someone says /vips it starts the function print_adminlist
    
    
register_cvar("vip_contactinfo""contact info here"FCVAR_SERVER)
    
register_cvar("vip_price""your price here"FCVAR_SERVER)
    
    
money_per_damage     register_cvar("vip_money_per_damage","3"//How many $ VIP will get per 1 damage 
    
money_kill_bonus     register_cvar("vip_money_kill_bonus","200"//How many $ VIP will get per kill
    
money_headshot_bonus     register_cvar("vip_money_hs_bonus","500"//How many $ VIP will get per head shot kill 
    
health_add         register_cvar("vip_hp""15"//How many hp VIP will get per kill 
    
health_hs_add         register_cvar("vip_hp_hs""30"//How many hp VIP will get per head shot kill 
    
health_max         register_cvar("vip_max_hp""100"//How many hp VIP can have in total 
    
g_sniper_active     register_cvar("vip_sniper_active""1"//Who can buy SNIPERS? 0 - everyone, 1 - only VIP
    
g_menu_active         register_cvar("vip_menu_active""1"//Will VIP get VIP menu? 0 - won't get the menu, 1 - will get the menu.
    
g_map_active         register_cvar("vip_map_active""1"//VIP menu works on the maps in mapnames.ini? 0 - Yes (VIP will get VIP menu), 1 - No
    
g_awp_active         register_cvar("vip_awp_active""1"// 1 - VIP can get AWP choice; 0 - cann't
    
g_menu_uses         register_cvar("vip_menu_uses""1"// How many times VIP can use VIP menu per round?
    
g_awp_ct         register_cvar("vip_awp_ct""5"//How many counter terrorist must be in a team to AWP choice show up
    
g_awp_tr         register_cvar("vip_awp_tr""5"//How many terrorist must be in a team to AWP choice show up
    
g_menu_round         register_cvar("vip_menu_round""2"//Round from which VIP will get VIP menu
    
g_awp_menu_round     register_cvar("vip_awp_menu_round""3"//Round from which VIP will get AWP choice
    
g_sniper_pickup     register_cvar("vip_sniper_pickup""1"//0 - everyone can pickup snipers, 1 - only VIP
    
g_recieved         register_cvar("vip_bulletdamage_recieved","1"//0 - bullet damage disabled, 1 - show damage done, 2 - show damage done, but not via wall
    
g_type             register_cvar("vip_bulletdamage","1"// Enable or disable showing recieved damage
    
g_models_enabled     register_cvar("vip_models""1"//0 - VIP models disabled, 1 - enabled.
    
g_color_msg         register_cvar("vip_colored_text_message""1")// Print /vips and info about vip text. 1 - colored, 0 - normal
    
g_menu_number_color     register_cvar("vip_menu_number_color""0"//0 - red, 1 - yellow, 2 - white, 3 - grey.
    
g_vips_list         register_cvar("vip_show_list""3"// /vips show. 0 - off, 1 - chat message, 2 - motd window.
    
g_buyzone_active    register_cvar("vip_menu_buyzone""1"// Close menu if player leaves buyzone? 1 - close, 2 - leaves it.

    
g_hudmsg1         CreateHudSyncObj()
    
g_hudmsg2         CreateHudSyncObj()
    
    if( 
find_ent_by_class(-1"func_bomb_target") || find_ent_by_class(-1"info_bomb_target") ) //Checks if the map has bombsite
    
{
        
g_bHasBombSite true//If the map has bombsite it is set to true
    
}
    
    
get_user_msgid("ScreenFade")
    
    
register_dictionary"vip.txt" );
}

public 
plugin_cfg()
{
    
map_active         get_pcvar_num(g_map_active); //Gets the value of g_map_active 
    
awp_active         get_pcvar_num(g_awp_active); //Gets the value of g_awp_active 
    
CT             get_pcvar_num(g_awp_ct); //Gets the value of g_awp_ct
    
TR             get_pcvar_num(g_awp_tr); //Gets the value of g_awp_tr
    
menu_round         get_pcvar_num(g_menu_round); //Gets the value of g_menu_round
    
awp_menu_round         get_pcvar_num(g_awp_menu_round); //Gets the value of g_awp_menu_round
    
menu_uses         get_pcvar_num(g_menu_uses); //Gets the value of g_menu_uses
    
models_enabled         get_pcvar_num(g_models_enabled); //Gets the value of g_models_enabled
    
color_msg         get_pcvar_num(g_color_msg); //Gets the value of g_color_msg
    
menu_number_color     get_pcvar_num(g_menu_number_color); //Gets the value of g_menu_number_color
    
vips_list         get_pcvar_num(g_vips_list//Gets the value of g_vips_list
    
g_enabled         get_pcvar_num(g_type//Gets the value of g_type
    
buyzone_active        get_pcvar_num(g_buyzone_active//Gets the value of buyzone_active
    
    
if(get_pcvar_num(g_recieved)) g_showrecieved true//Checks of g_received is 1 and if so, sets g_showrecieved to true
    
    
new szmapnames[128], szData[32], szCurrentMap[32], szawpmapnames[128];
    
formatszmapnames128"addons/amxmodx/configs/mapnames.ini" //Sets the path of mapnames.ini and saves it to szmapnames
    
if(!file_exists(szmapnames)) //Checks if szmapnames file doesn't exist
    
{
        
server_print("[VIP] File %s is missing!"szmapnames); //Prints a missing message
        
server_print("[VIP] File %s is created!"szmapnames); //Prints a create message
        
write_file(szmapnames"awp_"//Writes awp_ to szmapnames file
        
write_file(szmapnames"cs_deagle"//Writes cs_deagle to szmapnames file
        
write_file(szmapnames"knf_"//Writes knf_ to szmapnames file
        
write_file(szmapnames"1hp_"//Writes 1hp_ to szmapnames file
        
write_file(szmapnames"aim"//Writes aim to szmapnames file
    
}
    if(
file_exists(szmapnames)) //Checks if szmapnames file does exist
    
{
        
get_configsdir(szmapnamescharsmax(szmapnames)); // Get the AMX Mod X configs directory (folder). 
        
add(szmapnamescharsmax(szmapnames), "/mapnames.ini"); // Add your filename to the filepath. 
        
get_mapname(szCurrentMapcharsmax(szCurrentMap)); // Get the current map. 
         
        
new fopen(szmapnames"rt"); // Open the file. 
        
while( !feof(f) ) // Loop until it finds the End Of the File (aka EOF). 
        

            
fgets(fszDatacharsmax(szData)); // Get all text from current line.
            
trim(szData); // Trim off the new line and carriage return characters.
            
if( containi(szCurrentMapszData) != -)   // Check if the current map is equal to the map listed on this line. 
            

                
g_bCurrentMapIsInList true// Set boolean to true so that you know if the map was in the file. 
                
break; // Stop looping (reading the file) because you found what you came for. 
            

        } 
        
fclose(f); // Close the file.
    
}
    
    
formatszawpmapnames128"addons/amxmodx/configs/awpmapnames.ini" //Sets the path of awpmapnames.ini and saves it to szawpmapnames
    
if(!file_exists(szawpmapnames)) //Checks if szawpmapnames file doesn't exist
    
{
        
server_print("[VIP] File %s is missing!"szawpmapnames); //Prints a missing message
        
server_print("[VIP] File %s is created!"szawpmapnames); //Prints a create message
        
write_file(szawpmapnames"2x2"//Writes 2x2 to szmapnames file
        
write_file(szawpmapnames"3x3"//Writes 3x3 to szmapnames file
        
write_file(szawpmapnames"4x4"//Writes 4x4 to szmapnames file
        
write_file(szawpmapnames"cs_max"//Writes cs_max to szmapnames file
        
write_file(szawpmapnames"aim"//Writes aim to szmapnames file
    
}
    if(
file_exists(szawpmapnames)) //Checks if szawpmapnames file does exist
    
{
        
//Now lets check if current map is in awpmapnames.ini
        
get_configsdir(szawpmapnamescharsmax(szawpmapnames)); // Get the AMX Mod X configs directory (folder). 
        
add(szawpmapnamescharsmax(szawpmapnames), "awpmapnames.ini"); // Add your filename to the filepath. 
        
get_mapname(szCurrentMapcharsmax(szCurrentMap)); // Get the current map. 
        
        
new fopen(szawpmapnames"rt"); // Open the file. 
        
while( !feof(f) ) // Loop until it finds the End Of the File (aka EOF). 
        

            
fgets(fszDatacharsmax(szData)); // Get all text from current line. 
            
trim(szData); // Trim off the new line and carriage return characters. 
            
if( containi(szCurrentMapszData) != -)   // Check if the current map is equal to the map listed on this line. 
            

                
g_bCurrentAWPMapIsInList true// Set boolean to true so that you know if the map was in the file. 
                
break; // Stop looping (reading the file) because you found what you came for. 
            

        } 
        
fclose(f); // Close the file.
    
}
    
    new 
CfgDir[32], CfgFile[192];
    
    
get_configsdir(CfgDircharsmaxCfgDir ) );
    
formatex(CfgFilecharsmaxCfgFile ), "%s/VIPCVARs.cfg"CfgDir);
        
    if( !
file_exists(CfgFile ) )
    {
        
server_print("[VIP] File %s is missing!"CfgDir//Prints a missing message
        
server_print("[VIP] CVAR's are loaded from the plugin!"CfgDir//Prints a load message
    
}
    else
    {    
        
server_print("[VIP] CVAR's are loaded from %s!"CfgDir); //Prints a load message
        
server_cmd("exec %s"CfgFile); //Loads CVARs from VIPCVARs.cfg
    
}
}

public 
plugin_precache() 
{
    if(
models_enabled == 1)
    {
        
precache_model(VIP_TR_MODEL//Precashes Terroris model
        
precache_model(VIP_CT_MODEL//Precashes Counter-Terroris model
    
}


public 
event_new_round(id)
{
    
g_freezetime false// Freeze time has ended, so lets set it to false
}

public 
LogEvent_RoundStart(id)
{
    
g_freezetime true//Sets g_freezetime to true
    
g_bRoundEnd false//Sets g_bRoundEnd to false
    
gMenuUsed[id] = 0//Makes sure that noone had yet chosen from menu
    
iTCount 0//Makes iTCount to 0
    
iCTCount 0//Makes iCTCount to 0
    
CurrentRound++; //Adds 1 to CurrentRound
    
new players[32], playerpnum
    
get_players(playerspnum"a");
    for ( new 
ipnumi++ )
    {
        switch( 
cs_get_user_teamplayers[i] ) )
        {
            case 
CS_TEAM_TiTCount++;
            case 
CS_TEAM_CTiCTCount++;
        }
    }
    for(new 
0pnumi++)
    {
        
player players[i];
        if (!
get_pcvar_num(g_menu_active))
            return 
PLUGIN_CONTINUE
        
        
if(CurrentRound >= menu_round && get_user_flags(id) & VIP_FLAG//Checks if current round is more or equal to menu_round and checks if player is VIP
        
{
            
Showrod(player); //Shows vip menu
        
}
    }
    return 
PLUGIN_CONTINUE;
}

public 
LogEvent_RoundEnd()
{
    
g_bRoundEnd true//Sets g_bRoundEnd to true
}

public 
Event_RoundRestart(id)
{
    
CurrentRound 0//Makes CurrentRound to 0
}

public 
LogEvent_GameCommencing(id)
{
    
CurrentRound 0//Makes CurrentRound to 0
}

public 
hook_death()
{
    new 
hp_added[64];
    
// Killer id
    
nKiller read_data(1)
    if(
is_user_alive(nKiller) && get_user_flags(nKiller) & VIP_FLAG
    {
        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) & VIP_FLAG))
        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"
        
if(nKiller_hp nHp_max)
        {
            
format(hp_addedsizeof(hp_added), "%L"nKiller"HP_ADDED"nHp_add)
            
set_hudmessage(02550, -1.00.1501.01.00.10.1, -1)
            
show_hudmessage(nKillerhp_added)
        }
        
// Screen fading
        
if(!get_user_flashed(nKiller)) //Checks if user is not flashed
        
{
            
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 
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(money_kill_bonus) - 300)
}

public 
on_damage(id)
{
    if(
g_enabled && get_user_flags(id) & VIP_FLAG)
    {        
        static 
attackerattacker get_user_attacker(id)
        static 
damagedamage read_data(2)        
        if(
g_showrecieved)
        {            
            
set_hudmessage(255000.450.5020.14.00.10.1, -1//Sets the hudmessage
            
ShowSyncHudMsg(idg_hudmsg2"%i^n"damage//Shows damage taken    
        
}
        if(
is_user_connected(attacker)) //Checks if attacker is online
        
{
            switch(
g_enabled)
            {
                case 
1: {
                    
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1//Sets the hudmessage
                    
ShowSyncHudMsg(attackerg_hudmsg1"%i^n"damage//Shows damage made            
                
}
                case 
2: {
                    if(
fm_is_ent_visible(attacker,id))
                    {
                        
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1//Sets the hudmessage
                        
ShowSyncHudMsg(attackerg_hudmsg1"%i^n"damage//Shows damage made        
                    
}
                }
            }
        }
    }
}

public 
Damage(id)
{
    new 
weaponhitpointattacker get_user_attacker(id,weapon,hitpoint)
    if(
attacker<=MAXPLAYERS && is_user_alive(attacker) && attacker!=id)
    if(
get_user_flags(id) & VIP_FLAG//Checks if player is VIP
    
{
        new 
money read_data(2) * get_pcvar_num(money_per_damage)
        if(
hitpoint==1money += get_pcvar_num(money_headshot_bonus//Checks if player damages enemy by head shot
        
cs_set_user_money(attacker,cs_get_user_money(attacker) + money//Gives money for damaging enemys
    
}
}

public 
fwHamPlayerSpawnPost(id)
{
    
gMenuUsed[id] = 0//Make sure that VIP didn't use VIP menu on his spawn
    
UserInBuyZone[id] = true;
    if(
is_user_alive(id))
    {
        if(
get_user_flags(id) & VIP_FLAG)
        {
            if(!
g_bCurrentMapIsInList//Checks if map is not the one written in mapnames.ini, if user is alive and if e has flag H
            
{
                
give_item(id"weapon_hegrenade"); //Gives HE grenade
                
give_item(id"weapon_flashbang"); //Gives FB grenade
                
give_item(id"weapon_flashbang"); //Gives BF grenade
                
give_item(id"weapon_smokegrenade"); //Gives SG grenade
                
give_item(id"item_assaultsuit"); //Gives armor
                
if(g_bHasBombSite && cs_get_user_team(id) == CS_TEAM_CT//Checks if current map has bombsite
                
{
                    
give_item(id"item_thighpack"); //Gives defuse kit
                
}
            }
        
            if(
models_enabled == 1//Checks of models are enabled (set to 1)
            
{
                new 
currentmodel[32];
                
fm_get_user_model(idcurrentmodelsizeof currentmodel 1); //Gets current player omdel
                    
                
if(cs_get_user_team(id) & CS_TEAM_T//Checks if player is in Terrorist team
                
{
                    
copy(player_model[id], sizeof(player_model), VIP_TR)
            
                    if(!
equal(currentmodelplayer_model[id])) //Checks if players model is not changed to VIP model
                    
{
                        
fm_set_user_model(idplayer_model[id]) //Sets players model
                    
}
                }
                else if(
cs_get_user_team(id) & CS_TEAM_CT//Checks if player is in Counter-Terrorist team
                
{
                    
copy(player_model[id], sizeof(player_model), VIP_CT)                    
            
                    if(!
equal(currentmodelplayer_model[id])) //Checks if players model is not changed to VIP model
                    
{
                        
fm_set_user_model(idplayer_model[id]) //Sets players model
                    
}
                }
            }
        }
    }
}

public 
fw_TouchWeapon(weaponid
{
    if (!
get_pcvar_num(g_sniper_pickup)) //Checks if g_sniper_pickup is disactivated (set to 0)
        
return PLUGIN_CONTINUE //If it is, let players pick up snipers
        
    
if (!is_user_alive(id) || get_user_flags(id) & VIP_FLAG//Checks if player is alive and if he is VIP
    
{
        return 
HAM_IGNORED//Ignores the blocked weapon pickup/buy
    
}
   
    static 
classname[32]
    
pev(weaponpev_classnameclassnamecharsmax(classname))
 
    for(new 
0sizeof vipgunsi++)
    if (
g_bCurrentMapIsInList && equal(classnamevipguns[i])) //Checks if current map is in list and if the weapon is one that is blocked
    
{
        
client_print(idprint_center"%L"id"SNIPER_ONLY_FOR_VIP"//Sends a message that snipers are only for VIP
        
return HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED//Ignores the blocked weapon pickup/buy


public 
fw_SetClientKeyValue(idinfobufferkey[], value[])
{   
    if (
g_model[id] && equal(key"model"))
        return 
FMRES_SUPERCEDE;
    
    return 
FMRES_IGNORED;
}

public 
fw_ClientUserInfoChanged(idinfobuffer)
{   
    if (!
g_model[id])
        return 
FMRES_IGNORED;
    
    new 
currentmodel[32]; 
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
    
    if(!
equal(currentmodelplayer_model[id]))
    {
        
fm_set_user_model(idplayer_model[id]) 
    }
    
    return 
FMRES_IGNORED;
}

public 
cmdvipmenu(id
{
    if ( 
is_user_alive(id) ) //Checks if player is alive
    
{
        if( 
get_user_flags(id) & VIP_FLAG //Checks if player is VIP
        
{
            if ( 
CurrentRound menu_round //Cheks if current round is lower than menu_round
            
{
                
client_printidprint_center"%L"id"VIP_MENU_ROUND"menu_round ); //Sends a message that VIP can use VIP menu only from specific round
            
}
            if ( 
map_active == //Checks if map_active is 1
            
{
                if( 
g_bCurrentMapIsInList //Checks if current map is in mapnames list
                
{
                    
client_printidprint_center"%L"id"VIP_MENU_WRONG_MAP" ); //Sends a message that VIP can't use VIP menu on that map
                
}
            }
            if ( 
gMenuUsed[id] >= menu_uses //Checks if palyer has already sued menu more than menu_uses
            
{
                
client_printidprint_center"%L"id"VIP_MENU_PER_ROUND"menu_uses ); //Message that VIP can only take VIP menu few time that is set as VIPUsed
            
}
            if ( !
g_freezetime //Checks if freezetime is not over yet and if user is alive and he has flag H
            
{
                
client_printidprint_center"%L"id"VIP_MENU_ONLY_FROM_ROUND_START" ); //Message that's set in vipplugin.txt as VIP_MENU_ONLY_FROM_ROUND_START
            
}
            if(
g_freezetime//Checks if freezetime is over
            
{
                if ( 
gMenuUsed[id] < menu_uses //Checks if VIP has already used VIP menu before, the amount of times we set as VIPUsed 
                
{
                    if( 
CurrentRound >= menu_round //Checks if current round is more or equal to the round that is set as VIPMenuRound
                    
{    
                        if (!
get_pcvar_num(g_menu_active)) //Checks if g_menu_active is disactivated (set to 0)
                            
return PLUGIN_CONTINUE//If so, VIP won't get VIP menu
                            
                        
Showrod(id//Shows VIP menu
                    
}
                }
            }
            if(
map_active//Checks if map_active is 1
            
{
                if( 
g_bCurrentMapIsInList //Checks if current map is in mapnames.ini, if so print the message and cancels the menu showup
                
{
                    
client_print(idprint_center"%L"id"VIP_MENU_WRONG_MAP"); //Sends a message that VIP can't use VIP menu on that map
                    
return PLUGIN_CONTINUE//Stop VIP from getting the VIP menu
                
}
            }
            if(
buyzone_active != 1)
            {
                
client_print(idprint_center"%L"id"VIP_MENU_NOT_BUYZONE");
            }
        }
        else 
// If user doesn't have VIP_FLAG
        
{
            
PrintText(id//Sets a task in 0.1 seconds and starts PrintTect
        
}
    }
    else if( 
get_user_flags(id) & VIP_FLAG //Checks if user is death and he have VIP_FLAG
    
{
        
client_printidprint_center"%L"id"VIP_MENU_MUST_BE_ALIVE" ); //Sends a message that VIP must be alive to use VIP menu
    
}
    else 
//If user is death and doesn't have VIP_FLAG
    
{
        
PrintText(id//Prints PrintText
    
}
    return 
PLUGIN_HANDLED;
}

public 
Showrod(id)
{
    if (
get_user_flags(id) & VIP_FLAG//Checks if player has flag H
    
{
        if( 
g_bCurrentAWPMapIsInList //Checks if map is in awpmapnames.ini
        
{
            
bAwpMap true //If so sets bAwpMap to true, so AWP choice would work in maps that are in awpmapnames.ini
        
}
        new 
newmenu[64], choice_1[64], choice_2[64], choice_3[64
        
format(newmenusizeof(newmenu), "%L"id"NEW_MENU"); //Shows a menu message that's set in vipplugin.txt as NEW_MENU_PRIMARY
        
menu menu_create(newmenu"Pressedrod"); //Creates menu that's in Pressedrod
        
        
format(choice_1sizeof(choice_1), "%L"id"MENU_CHOICE_1"); //Shows a menu message that's set in vipplugin.txt as MENU_CHOICE_PRIMARY_1
        
menu_additem(menuchoice_1"1"0); //Menu choice/case 1
        
format(choice_2sizeof(choice_2), "%L"id"MENU_CHOICE_2"); //Shows a menu message that's set in vipplugin.txt as MENU_CHOICE_PRIMARY_2
        
menu_additem(menuchoice_2"2"0); //Menu choice/case 2
        
if ( iTCount >= TR && iCTCount >= CT //Checks that each team has 5 or more people to AWP choice appear in the menu
        
{
            if (
awp_active == 1//Checks if vips can get awp choice, 0 - no; 1 - yes
            
{
                if ( 
CurrentRound >= awp_menu_round //Checks if current round is more or equal to 3, so AWP choice would come out
                
{
                    if( !
bAwpMap //Checks if map is not one in awpmapnames.xfg, if so shows the fifth menu item
                    
{
                        
format(choice_3sizeof(choice_3), "%L"id"MENU_CHOICE_3"); //Shows a menu message that's set in vipplugin.txt as MENU_CHOICE_PRIMARY_5
                        
menu_additem(menuchoice_3"3"0); //Menu choice/case 5
                    
}
                }
            }
        }        
        new 
menu_exit_name[64];
        
format(menu_exit_namesizeof(menu_exit_name), "%L"id"MENU_EXIT_NAME"//Formats menu_exit_name form vip.txt file
        
menu_setprop(menuMPROP_EXITNAMEmenu_exit_name//Sets menu exit name
        
menu_setprop(menuMPROP_EXITMEXIT_ALL); //Makes the exit button to close the menu
        
if(menu_number_color == 1//Checks if menu_number_color is set to 3
        
{
            
menu_setprop(menu,MPROP_NUMBER_COLOR,"\y"); // ets the number color to yello
        
}
        else if(
menu_number_color == 2//Checks if menu_number_color is set to 3
        
{
            
menu_setprop(menu,MPROP_NUMBER_COLOR,"\w"); //Sets the number color to white
        
}
        else if(
menu_number_color == 3//Checks if menu_number_color is set to 3
        
{
            
menu_setprop(menu,MPROP_NUMBER_COLOR,"\d"); //Sets the number color to grey
        
}
        else 
//In any other case the menu_number_color is set to
        
{
            
menu_setprop(menu,MPROP_NUMBER_COLOR,"\r"); //Sets the number color to red
        
}
        
menu_display(idmenu0)
    }
}

public 
Pressedrod(idmenuitem)
{
    if( 
item == MENU_EXIT //Checks if player clicks menu exit (0)
    
{
        
menu_destroy(menu); //If so the menu will be destroyed
        
return PLUGIN_HANDLED;
    }
    new 
iFlashes cs_get_user_bpammoidCSW_FLASHBANG ); //Makes iFlashes to check is player has flashbangs
    
new HasC4[33], HasHE[33], HasSG[33];
    new 
weapons pev(idpev_weapons)
    
HasC4[id] = ( weapons 1<<CSW_C4 //Makes HasC4 to check if player has C4
    
HasHE[id] = ( weapons 1<<CSW_HEGRENADE ) && cs_get_user_bpammo(idCSW_HEGRENADE//Makes HasHE to check if player has HE
    
HasSG[id] = ( weapons 1<<CSW_SMOKEGRENADE ) && cs_get_user_bpammo(idCSW_SMOKEGRENADE//Makes HasSG to check if player has SG
    
new data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
key str_to_num(data);
    if(
is_user_alive(id) && !g_bRoundEnd//Checks if player is alive and it's not round end
    
{
        
strip_user_weaponsid ); //Deletes players all weapons
        
switch(key)
        {
        case 
1: {                                  
                
give_item(id,"weapon_m4a1"//Gives M4A1
                
cs_set_user_bpammo(idCSW_M4A190); //Sets M4A1 back pack ammo to 90
                
client_printidprint_center"%L"id"CHOSE_M4A1" ); //Shows a message that's set in vipplugin.txt as CHOSE_M4A1
            
}
        case 
2: {     
                
give_item(id,"weapon_ak47"//Gives AK47
                
cs_set_user_bpammo(idCSW_AK4790); //Sets AK47 back pack ammo to 90
                
client_printidprint_center"%L"id"CHOSE_AK47" ); //Shows a message that's set in vipplugin.txt as CHOSE_AK47
            
}
        case 
3: { 
                
give_item(id,"weapon_awp"//Gives AWP
                
cs_set_user_bpammo(idCSW_AWP30); //Sets AWP back pack ammo to 30
                
client_printidprint_center"%L"id"CHOSE_AWP" ); //Shows a message that's set in vipplugin.txt as CHOSE_AWP
            
}
        }
        if (
HasC4[id]) //Checks if player had C4
        
{
            
give_item(id"weapon_c4"); //Gives C4
            
cs_set_user_plantid ); //Allows player to plant the bomb
            
set_pev(idpev_body1); //Puts C4 model on it's back
        
}
        if (
HasHE[id]) //Checks if player has HE
        
{
            
give_item(id"weapon_hegrenade"//Gives HE
        
}
        if (
HasSG[id]) //Checks if player has SG
        
{
            
give_item(id"weapon_smokegrenade"); //Gives SG
        
}
        if( 
iFlashes //Checks if player has FB
        

            
give_itemid"weapon_flashbang" ); //Gives first FB
            
cs_set_user_bpammoidCSW_FLASHBANGiFlashes ); //Gives second FB
        

        
give_item(id,"weapon_knife"//Gives knife
        
give_item(id,"weapon_deagle"//Gives deagle
        
cs_set_user_bpammo(idCSW_DEAGLE35); //Sets deagle back pack ammo to 35
        
if(g_bHasBombSite && cs_get_user_team(id) == CS_TEAM_CT//Checks if current map has bombsite
        
{
            
give_item(id"item_thighpack"); //Gives defuse kit
        
}
        
gMenuUsed[id]++ //Makes sure that VIP really made a choice
    
}
    
menu_destroy(menu); //Destroys menu
    
return PLUGIN_CONTINUE;
}

public 
HandleCmd(id)
{
    if (!
get_pcvar_num(g_sniper_active)) //Checks if g_awp_active is disactivated (set to 0)
        
return PLUGIN_CONTINUE //If it is, let players buy snipers
        
    
if(get_user_flags(id) & VIP_FLAG)  //Checks if player has flag H
        
return PLUGIN_CONTINUE 
        
    client_print
idprint_center"%L"id"SNIPER_ONLY_FOR_VIP" ); //Sends a message that snipers are only for VIP
    
    
return PLUGIN_HANDLED;
}

public 
ShowMotd(id)
{
    new 
contact[112];
    
get_cvar_string("vip_contactinfo"contact63//Gets the vip_contactinfo
    
new price[112];
    
get_cvar_string("vip_price"price63//Gets the vip_price
    
static MOTD[1501];
    new 
len formatex(MOTD1500,"<style type=text/css>body{background-color: #000000;font-family:Verdana,Tahoma;}</style>");
    
len += formatex(MOTD[len],1500-len,"<font size=2 color=#e0a518><b><center>%L</center></b></font><br /><font size=1 color=#c0c0ff><UL>"id"MOTD_LINE_01");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_02");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_03");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_04");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_05");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_06");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_07");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_08");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_09");
    
len += formatex(MOTD[len],1500-len,"%L"id"MOTD_LINE_10");
    
len += formatex(MOTD[len],1500-len,"<br>%L"id"MOTD_LINE_11");
    
len += formatex(MOTD[len],1500-len,"<br>%L"id"MOTD_LINE_12");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI><br>"id"MOTD_LINE_13");
    
len += formatex(MOTD[len],1500-len,"<font size=1 color=#00c000><strong>%L</strong></font>"id"MOTD_LINE_14")
    
len += formatex(MOTD[len],1500-len,"<br>%L %s"id"MOTD_LINE_15"price)
    
len += formatex(MOTD[len],1500-len,"<br>%L <font color=#FF6600>%s</font>"id"MOTD_LINE_16"contact);

    new 
motd_name[64];
    
format(motd_name64"%L"id"WANTVIP_MOTD_NAME"); //Formats the MOTD name from VIP.txt file
    
show_motd(id,MOTDmotd_name); //Shows the MOTD to player
    
    
return PLUGIN_HANDLED;
}

public 
client_putinserver(id)
{
    if (!
task_exists(id 1000)) set_task(30.0"PrintText"id 1000//Checks if task already exist, if not print text set in public PrintText
}

public 
PrintText(id)
{
    if(
color_msg == 1//Checks if color_msg is 1
    
{
        
client_print_colorid"%L"id"PRINT_TEXT_COLORED" ); //Message which is sent
    
}
    else
    {
        
client_print_colorid"%L"id"PRINT_TEXT" ); //Message which is sent
    
}
}

public 
StatusIcon_buyzone_OFFid )
{
    
UserInBuyZone[id] = false;
    
    
CheckMenuClose(id);
}

public 
Event_StatusIcon_Show_buyzone(id

    if(
get_user_flags(id) & VIP_FLAG && buyzone_active == 1
    { 
        
UserInBuyZone[id] = true;
    } 
}

CheckMenuClose(id)
{
    new 
oldMenuIdnewMenuId;
    
player_menu_info(idoldMenuIdnewMenuId)
    if(
newMenuId > -&& newMenuId == menu && buyzone_active == 1)
    {
        
menu_cancel(id);
    }
}

public 
print_adminlist(user
{
    new 
idcountxlenadminnames[33][32];
    for(
id id <= MAXPLAYERS id++)
    {
        if(
is_user_connected(id) && get_user_flags(id) & VIP_FLAG//Checks if player is connected and if player is VIP
        
{
            
get_user_name(idadminnames[count++], 31//Gets players name and adds to adminnames
        
}
    }
                
    if(
vips_list == || vips_list == 3//Checks if vips_list is 2 or 3
    
{                    
        new 
contact[112];
        
get_cvar_string("vip_contactinfo"contact63//Gets the vip_contactinfo
        
new price[112];
        
get_cvar_string("vip_price"price63//Gets the vip_price
        
new Data[g_Buffer];
    
        
len formatex(Data[len], g_Buffer len"<html><center><font color=yellow>%L <font color=green>%s.<font color=yellow> %L <font color=green>%s</font><body bgcolor=Black>"user"CONTACT"contactuser"MOTD_LINE_15"price);
        
len += formatex(Data[len], g_Buffer len"<br><table border=1 width=300 cellspacing=0 bordercolor=#4A4344 style=color:#56A5EC;text-align:center;>");
        
len += formatex(Data[len], g_Buffer len"<tr><td><b>#</b></td><td><b>%L</b></td></tr>"user"VIPS_ONLINE");
    
        if(
count 0)
        {
            for(
count x++) 
            {
                
len += formatex(Data[len], g_Buffer len"<tr><td><font color=Red>%d</font></td>"1);
                
len += formatex(Data[len], g_Buffer len"<td>%s</td></tr>"adminnames[x]);
            }
        }
        else
        {
            
len += formatex(Data[len], g_Buffer len"<tr><td><font color=Red>-</font></td>");
            
len += formatex(Data[len], g_Buffer len"<td>%L</td></tr>"user"NO_VIPS_ONLINE");
        }
        
len += formatex(Data[len],g_Buffer len,"</center></body></html>");
        new 
motd_name[64];
        
format(motd_name64"%L"user"WANTVIP_MOTD_NAME"); //Formats the MOTD name from VIP.txt file
        
show_motd(userDatamotd_name); //Shows MOTD to player
        
        
    
}
    if(
vips_list == || vips_list == 3//Checks if vips_list is 1 or 3
    
{
        new 
message[256], contact[112]
        
        if(
color_msg == 1)
        {
            
len format(message255"%L"user"VIPS_ONLINE_COLORED"COLOR)
        }
        else
        {
            
len format(message255"%L"user"VIPS_ONLINE")
        }
        if(
count 0)
        {
            for(
count x++) 
            {
                
len += format(message[len], 255-len" %s%s "adminnames[x], < (count-1) ? ", ":"")
                if(
len 96 
                {
                    
client_print_color(usermessage)
                    if(
color_msg == 1)
                    {
                        
len format(message255"%s",COLOR)
                    }
                    else
                    {
                        
len format(message255"")
                    }
                }
            }
            
client_print_color(usermessage)
        }
        else 
        {
            
len += format(message[len], 255-len" %L"id"NO_VIPS_ONLINE")
            
client_print_color(usermessage)
        }
        
        
get_cvar_string("vip_contactinfo"contactcharsmax(contact))
        if(
contact[0]) 
        {
            if(
color_msg == 1)
            {
                
client_print_color(user"%L %s"user"CONTACT_COLORED"contact)
            }
            else
            {
                
client_print_color(user"%L %s"user"CONTACT"contact)
            }
        }
    }
}

stock fm_set_user_model(playermodelname[])
{   
    
engfunc(EngFunc_SetClientKeyValueplayerengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modelname)
    
    
g_model[player] = true
}

stock fm_get_user_model(playermodel[], len)
{   
    
engfunc(EngFunc_InfoKeyValueengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modellen)
}

stock fm_reset_user_model(player)
{         
    
g_model[player] = false
    
    dllfunc
(DLLFunc_ClientUserInfoChangedplayerengfunc(EngFunc_GetInfoKeyBufferplayer))
}

get_user_flashed(id, &iPercent=0//Checks if user is flashed

    new 
Float:flFlashedAt get_pdata_float(idm_flFlashedAt

    if( !
flFlashedAt 
    { 
        return 

    

    
    new 
Float:flGameTime get_gametime() 
    new 
Float:flTimeLeft flGameTime flFlashedAt 
    
new Float:flFlashDuration get_pdata_float(idm_flFlashDuration
    new 
Float:flFlashHoldTime get_pdata_float(idm_flFlashHoldTime
    new 
Float:flTotalTime flFlashHoldTime flFlashDuration 
    
    
if( flTimeLeft flTotalTime 
    { 
        return 

    

    
    new 
iFlashAlpha get_pdata_int(idm_iFlashAlpha

    if( 
iFlashAlpha == ALPHA_FULLBLINDED 
    { 
        if( 
get_pdata_float(idm_flFlashedUntil) - flGameTime 0.0 
        { 
            
iPercent 100 
        

        else 
        { 
            
iPercent 100-floatround(((flGameTime - (flFlashedAt flFlashHoldTime))*100.0)/flFlashDuration
        } 
    } 
    else 
    { 
        
iPercent 100-floatround(((flGameTime flFlashedAt)*100.0)/flTotalTime
    } 

    return 
iFlashAlpha 
}

stock client_print_color(const id, const input[], any:...) 

    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 

    
replace_all(msg190"!g""^x04"); // Green Color 
    
replace_all(msg190"!n""^x01"); // Default Color 
    
replace_all(msg190"!t""^x03"); // Team Color 

    
if (idplayers[0] = id; else get_players(playerscount"ch"); 
    { 
        for (new 
0counti++) 
        { 
            if (
is_user_connected(players[i])) 
            { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

Dragos is offline
CanyoN1337
Junior Member
Join Date: Feb 2019
Old 02-24-2019 , 07:14   Re: Help With VIP.SMA ERRORS
Reply With Quote #4

Quote:
Originally Posted by Dragos View Post
PHP Code:
/* Plugin generated by AMXX-Studio 
    Original creator: Dunn0
    Remade by: Unkolix
    
    Changelog by me, Unkolix:
    v5.5.1 - Addition to cvar vip_menu_buyzone, if it's 1, player can't get VIP meniu.
    v5.5.0 - New cvar vip_menu_buyzone, if it's 1, then VIP menu will close as soon as player leaves buyzone.
    v5.4.9 - Small optimisations and more explanation!
    v5.4.8 - Fixed show damage to all players and hp add to all players.
    v5.4.7 - Added VIPCVARs.cfg file!
    v5.4.6 - Fixed damge showing.
    v5.4.5 - MotD correction, should work perfectly now. + auto contact info + price in motd.
    v5.4.4 - A new cvar to control how to show online vip list. vip_list 0/1/2. off/chat/motd. Thanks to alicx
    v5.4.3 - Edited all cvars, vip_ prefix added. color_msg now changes /vips colors and vip info color.
    v5.4.2 - Added a cvar for vip price show: amx_vipprice "price"
    v5.4.1 - Renewed amx_contactinfo cvar, now it will be shown when player types /vips and in want vip MotD.
    v5.4.0 - If files awpmapnames.ini and mapnames.ini are missing, they are automatically created.
    v5.3.9 - MotD improvement, no need for other .txt files. Example taken from: souvikdas95
    v5.3.8 - Fixed double grenade throw bug, thanks to ConnorMcLeod.
    v5.3.7 - Now you can control the menu number colors with menu_num_color 0/1/2/3.
    v5.3.6 - Fixed C4 not showing on players back.
    v5.3.5 - Not using colorchat.inc anymore, color stock instead! Small error fix. New cvar colored_text_message - control the printed message color.
    v5.3.4 - Now changing VIP models with Fakemeta module. Tag Mismatch fix.
    v5.3.3 - Grenades fix. Optimization.
    v5.3.2 - VIP models added, controled by a cvar vip_models 1/0
    v5.3.1 - Added error message if files awpmapnames.ini and mapnames.ini doesn't exist. Another way not to allow non VIP players
    to pick up snipers, thanks to SeriousSpot.
    v5.3.0 - Terrorists won't get defuse kits now. New bullet damage system (took from Sn!ff3r). 
    A lot of optimization and fixes, thanks to aaarnas. 2 new cvars, bulletdamage_recieved, bulletdamage
    v5.2.9 - Multi-lingual "Back." menu item added.
    v5.2.8 - Fixed menu choices after death and on new round.
    v5.2.7 - Now you can easily change the flag wich gives all the abilities. Thanks to quilhos.
    v5.2.6 - Multi-lingual want vip MotD added
    v5.2.5 - Small sniper pickup fix
    v5.2.4 - Now players won't lose their defuse kits after taking weapons from menu
    v5.2.3 - Fixed flashed bug, a little change on motd window
    v5.2.2 - Fixed player_menu_info error
    v5.2.1 - Not using stripweapons include anymore, just to get rid of that shield bug.
    v5.2 - Several fixes, optimization. New cvar to control if only VIP's can pick up snipers.
    v5.1 - Fixed shield bug.
    v5.0 - Multi-lingual added!
    v4.9.2 - New cvar, awp_active. 1 - VIP can get AWP choice; 0 - cann't
    v4.9.1 - AWP choice improvement. New Cvar, awp_menu_round, set the round from which VIP can see AWP choice.
    v4.8 - Fixed VIP menu dilsplay after player death. Thanks to vitorrossi.
    v4.7 - Fixed fading bug/glitch that was removing flashbang effect. Thanks to ConnorMcLeod.
    v4.6 - Fixed log error. Thanks to wickedd.
    v4.5 - OPTIMISATION, thanks to Backstabnoob.
    v4.4 - New Cvars awp_ct and awp_tr, how mant counter-terrorists and terrorists must be in each team to get AWP choice in VIP menu
    v4.3 - New feature, AWP only from sertain amount of players. Thanks to Emp`.
    v4.2 - Added new Cvar, vip_menu_uses. Thanks to Erox902.
    v4.1 - mapnames and awpmapnames consts are now readed from 2 files, awpmanames.ini and mapnames.ini. Thanks to fysiks.
    v4.0 - New feature, awp an't be used in maps that are mentioned in awpmapnames const. UPDATE: awpmapnames.ini
    v3.9 - Added new menu item, AWP.
    v3.8 - Improved v3.7 update. Thanks to Bugsy.
    v3.7 - New feature, VIP menu can't be shown on maps which are listed in mapnames const. UPDATED: mapnames.ini
    v3.6 - Small part is rewrited with drekes help, he made stripweapons.inc
    v3.5 - Fixed triple VIP message. Thanks jimaway!
    v3.4 - Fixed a bug/glitch which didn't let player to have AWP, even on awp maps! Now, they can't buy it, but if they find it, they can have it.
    v3.3 - Completely remade menu
    v3.2 - Fixed a bug/glitch when all VIP players was getting defuse kit on all maps. Now only on maps which has bombsites and only for CT. Thanks ConnorMcLeod
    v3.1 -  Added commands to call VIP menu. Thanks Stereo!
    
    Changelog by original author Dunn0:
    Updates on 3.0version
    Granates bug fixed, give it when round starts only. Removed hamsandwich module becouse i removed event witch was usualess.
    
    Updates on 2.06version
    Fixed C4 Planting just need'ed remove 1 simbol... Remove'd AWP pick up now only VIP can buy awp and non VIP can pick up it from ground. Fixed Bug whit menu was giving in first round I changed some events and it works just fine.
    
    Updates on 2.05version
    Was not working /wantvip , /vips command it got fixed. Was removed "pickup_active 1" cvar (couse was to much commands in registrations. Was removed some useless commands. Now changed that Only VIPS can buy awp weapons but normal players can pick up awp if VIPS drop it.
    
    Updates on 2.04version
    Menu Fixed now it always shows only from 3rd round. Nades , armor will give when u spawn not from round start. Some small fixes on Event_curweapons. 
    Add cvar pickup_active 1 so now if u write pickup_active 0 not vips will can pick up AWP weapons just wont be able to buy.
    
    Updated at 2.03version
    Repaired C4 bug now u can plant it
    
    Updated at 2.02version
    Repaired C4 bug
    
    UPDATE's at 2.01version
    Well i add'ed 2 new cvar's becouse people was asking it
    First is "menu_active 1" so now u can turn off menu when u will one.
    Second is "sniper_active 1" well if u will do it 0 all people will can buy awp.
*/

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

#define PLUGIN "VIP Plugin"
#define VERSION "5.5.0"
#define AUTHOR "Unkolix"

#define VIP_FLAG ADMIN_LEVEL_H
#define MAXPLAYERS 32 + 1
#define ALPHA_FULLBLINDED 255
#define g_Buffer 1536
#define find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)

static const COLOR[] = "^x04" //green
const m_flFlashedUntil 514;
const 
m_flFlashedAt 515;
const 
m_flFlashHoldTime 516;
const 
m_flFlashDuration 517;
const 
m_iFlashAlpha 518;
const 
m_flFlashDuration 517;
new 
gMenuUsed[33];
new 
money_per_damagemoney_kill_bonusmoney_headshot_bonus;
new 
health_addhealth_hs_addhealth_max;
new 
nKillernKiller_hpnHp_addnHp_max;
new 
g_sniper_activeg_menu_activeg_map_activeg_awp_activeawp_activeg_buyzone_activebuyzone_active;
new 
g_menu_usesg_awp_ctg_awp_trg_menu_roundg_awp_menu_roundg_sniper_pickup;
new 
map_activeCTTRmenu_roundawp_menu_roundmenu_uses;
new 
CurrentRound;
new 
bool:g_bHasBombSite;
new 
bool:g_freezetime;
new 
bool:bAwpMap false;
new 
bool:g_bCurrentMapIsInList false
new 
bool:g_bCurrentAWPMapIsInList false;
new 
bool:g_bRoundEnd;
new 
iTCountiCTCount;
new 
g_typeg_enabledg_recievedbool:g_showrecievedg_hudmsg1g_hudmsg2;
new 
g_models_enabledmodels_enabled;
new const 
VIP_CT[] = "vip_ct";
new const 
VIP_CT_MODEL[] = "models/player/vip_ct/vip_ct.mdl";
new const 
VIP_TR[] = "vip_tr";
new const 
VIP_TR_MODEL[] = "models/player/vip_tr/vip_tr.mdl";
new 
player_model[33][32], bool:g_model[33], bool:UserInBuyZone[33];
new 
g_color_msgcolor_msgg_menu_number_colormenu_number_color;
new 
g_vips_listvips_listmenu;

new const 
vipmenu[][] =
{
    
//Commands to call VIP menu
    
"say /vipmenu""say vipmenu""say_team /vipmenu""say_team vipmenu""say vmenu""say_team vmenu"


new const 
VIPweapons[][] =
{
    
//Weapons which normal players can't pick up.
    
"awp""sg550""g3sg1"
}

new const 
wantvip[][] =
{
    
//Commands which call wantvip.txt motd window
    
"say /wantvip""say wantvip""say_team /wantvip""say_team wantvip",
    
"say /noriuvip""say noriuvip""say_team /noriuvip""say_team noriuvip",
    
"say /chciecvip""say chciecvip""say_team /chciecvip""say_team chciecvip",
    
"say /willenvip""say willenvip""say_team /willenvip""say_team willenvip",
    
"say /vouloirvip""say vouloirvip""say_team /vouloirvip""say_team vouloirvip"
}

new const 
vipguns[][] =
{
    
//Guns that are only for VIP (controlled via CVAR)
    
"weapon_awp""weaopn_g3sg1""weapon_sg550"
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("LogEvent_RoundEnd"2"1=Round_End");
    
register_logevent("LogEvent_RoundStart"2"1=Round_Start" );
    
register_logevent("LogEvent_GameCommencing"2"0=World triggered""1=Game_Commencing");

    
register_event("Damage","Damage","b");
    
register_event("DeathMsg","death_msg","a");
    
register_event("DeathMsg""hook_death""a""1>0");
    
register_event("HLTV""event_new_round""a""1=0""2=0");
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w");
    
register_event("Damage""on_damage""b""2!0""3=0""4!0");
    
register_event("StatusIcon""Event_StatusIcon_Show_buyzone""be""1=1""2=buyzone");
    
register_event("StatusIcon""StatusIcon_buyzone_OFF""be""1=0""2=buyzone");
    
    
RegisterHam(Ham_Touch"weaponbox""fw_TouchWeapon");
    
RegisterHam(Ham_Touch"armoury_entity""fw_TouchWeapon");
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
    
register_forward(FM_SetClientKeyValue"fw_SetClientKeyValue");
    
register_forward(FM_ClientUserInfoChanged"fw_ClientUserInfoChanged");
    
    for(new 
0sizeof wantvipi++)
    
register_clcmd(wantvip[i], "ShowMotd"//Checks const wantvip, that is above plugin_init
    
for(new 0sizeof vipmenui++)
    
register_clcmd(vipmenu[i], "cmdvipmenu"//Checks const vipmenu, that is above plugin_init
    
for(new 0sizeof VIPweaponsi++)
    
register_clcmd(VIPweapons[i], "HandleCmd"//Checks const VIPweapons, that is above plugin_init
    
    
register_clcmd("say /vips","print_adminlist"//If someone says /vips it starts the function print_adminlist
    
    
register_cvar("vip_contactinfo""contact info here"FCVAR_SERVER)
    
register_cvar("vip_price""your price here"FCVAR_SERVER)
    
    
money_per_damage     register_cvar("vip_money_per_damage","3"//How many $ VIP will get per 1 damage 
    
money_kill_bonus     register_cvar("vip_money_kill_bonus","200"//How many $ VIP will get per kill
    
money_headshot_bonus     register_cvar("vip_money_hs_bonus","500"//How many $ VIP will get per head shot kill 
    
health_add         register_cvar("vip_hp""15"//How many hp VIP will get per kill 
    
health_hs_add         register_cvar("vip_hp_hs""30"//How many hp VIP will get per head shot kill 
    
health_max         register_cvar("vip_max_hp""100"//How many hp VIP can have in total 
    
g_sniper_active     register_cvar("vip_sniper_active""1"//Who can buy SNIPERS? 0 - everyone, 1 - only VIP
    
g_menu_active         register_cvar("vip_menu_active""1"//Will VIP get VIP menu? 0 - won't get the menu, 1 - will get the menu.
    
g_map_active         register_cvar("vip_map_active""1"//VIP menu works on the maps in mapnames.ini? 0 - Yes (VIP will get VIP menu), 1 - No
    
g_awp_active         register_cvar("vip_awp_active""1"// 1 - VIP can get AWP choice; 0 - cann't
    
g_menu_uses         register_cvar("vip_menu_uses""1"// How many times VIP can use VIP menu per round?
    
g_awp_ct         register_cvar("vip_awp_ct""5"//How many counter terrorist must be in a team to AWP choice show up
    
g_awp_tr         register_cvar("vip_awp_tr""5"//How many terrorist must be in a team to AWP choice show up
    
g_menu_round         register_cvar("vip_menu_round""2"//Round from which VIP will get VIP menu
    
g_awp_menu_round     register_cvar("vip_awp_menu_round""3"//Round from which VIP will get AWP choice
    
g_sniper_pickup     register_cvar("vip_sniper_pickup""1"//0 - everyone can pickup snipers, 1 - only VIP
    
g_recieved         register_cvar("vip_bulletdamage_recieved","1"//0 - bullet damage disabled, 1 - show damage done, 2 - show damage done, but not via wall
    
g_type             register_cvar("vip_bulletdamage","1"// Enable or disable showing recieved damage
    
g_models_enabled     register_cvar("vip_models""1"//0 - VIP models disabled, 1 - enabled.
    
g_color_msg         register_cvar("vip_colored_text_message""1")// Print /vips and info about vip text. 1 - colored, 0 - normal
    
g_menu_number_color     register_cvar("vip_menu_number_color""0"//0 - red, 1 - yellow, 2 - white, 3 - grey.
    
g_vips_list         register_cvar("vip_show_list""3"// /vips show. 0 - off, 1 - chat message, 2 - motd window.
    
g_buyzone_active    register_cvar("vip_menu_buyzone""1"// Close menu if player leaves buyzone? 1 - close, 2 - leaves it.

    
g_hudmsg1         CreateHudSyncObj()
    
g_hudmsg2         CreateHudSyncObj()
    
    if( 
find_ent_by_class(-1"func_bomb_target") || find_ent_by_class(-1"info_bomb_target") ) //Checks if the map has bombsite
    
{
        
g_bHasBombSite true//If the map has bombsite it is set to true
    
}
    
    
get_user_msgid("ScreenFade")
    
    
register_dictionary"vip.txt" );
}

public 
plugin_cfg()
{
    
map_active         get_pcvar_num(g_map_active); //Gets the value of g_map_active 
    
awp_active         get_pcvar_num(g_awp_active); //Gets the value of g_awp_active 
    
CT             get_pcvar_num(g_awp_ct); //Gets the value of g_awp_ct
    
TR             get_pcvar_num(g_awp_tr); //Gets the value of g_awp_tr
    
menu_round         get_pcvar_num(g_menu_round); //Gets the value of g_menu_round
    
awp_menu_round         get_pcvar_num(g_awp_menu_round); //Gets the value of g_awp_menu_round
    
menu_uses         get_pcvar_num(g_menu_uses); //Gets the value of g_menu_uses
    
models_enabled         get_pcvar_num(g_models_enabled); //Gets the value of g_models_enabled
    
color_msg         get_pcvar_num(g_color_msg); //Gets the value of g_color_msg
    
menu_number_color     get_pcvar_num(g_menu_number_color); //Gets the value of g_menu_number_color
    
vips_list         get_pcvar_num(g_vips_list//Gets the value of g_vips_list
    
g_enabled         get_pcvar_num(g_type//Gets the value of g_type
    
buyzone_active        get_pcvar_num(g_buyzone_active//Gets the value of buyzone_active
    
    
if(get_pcvar_num(g_recieved)) g_showrecieved true//Checks of g_received is 1 and if so, sets g_showrecieved to true
    
    
new szmapnames[128], szData[32], szCurrentMap[32], szawpmapnames[128];
    
formatszmapnames128"addons/amxmodx/configs/mapnames.ini" //Sets the path of mapnames.ini and saves it to szmapnames
    
if(!file_exists(szmapnames)) //Checks if szmapnames file doesn't exist
    
{
        
server_print("[VIP] File %s is missing!"szmapnames); //Prints a missing message
        
server_print("[VIP] File %s is created!"szmapnames); //Prints a create message
        
write_file(szmapnames"awp_"//Writes awp_ to szmapnames file
        
write_file(szmapnames"cs_deagle"//Writes cs_deagle to szmapnames file
        
write_file(szmapnames"knf_"//Writes knf_ to szmapnames file
        
write_file(szmapnames"1hp_"//Writes 1hp_ to szmapnames file
        
write_file(szmapnames"aim"//Writes aim to szmapnames file
    
}
    if(
file_exists(szmapnames)) //Checks if szmapnames file does exist
    
{
        
get_configsdir(szmapnamescharsmax(szmapnames)); // Get the AMX Mod X configs directory (folder). 
        
add(szmapnamescharsmax(szmapnames), "/mapnames.ini"); // Add your filename to the filepath. 
        
get_mapname(szCurrentMapcharsmax(szCurrentMap)); // Get the current map. 
         
        
new fopen(szmapnames"rt"); // Open the file. 
        
while( !feof(f) ) // Loop until it finds the End Of the File (aka EOF). 
        

            
fgets(fszDatacharsmax(szData)); // Get all text from current line.
            
trim(szData); // Trim off the new line and carriage return characters.
            
if( containi(szCurrentMapszData) != -)   // Check if the current map is equal to the map listed on this line. 
            

                
g_bCurrentMapIsInList true// Set boolean to true so that you know if the map was in the file. 
                
break; // Stop looping (reading the file) because you found what you came for. 
            

        } 
        
fclose(f); // Close the file.
    
}
    
    
formatszawpmapnames128"addons/amxmodx/configs/awpmapnames.ini" //Sets the path of awpmapnames.ini and saves it to szawpmapnames
    
if(!file_exists(szawpmapnames)) //Checks if szawpmapnames file doesn't exist
    
{
        
server_print("[VIP] File %s is missing!"szawpmapnames); //Prints a missing message
        
server_print("[VIP] File %s is created!"szawpmapnames); //Prints a create message
        
write_file(szawpmapnames"2x2"//Writes 2x2 to szmapnames file
        
write_file(szawpmapnames"3x3"//Writes 3x3 to szmapnames file
        
write_file(szawpmapnames"4x4"//Writes 4x4 to szmapnames file
        
write_file(szawpmapnames"cs_max"//Writes cs_max to szmapnames file
        
write_file(szawpmapnames"aim"//Writes aim to szmapnames file
    
}
    if(
file_exists(szawpmapnames)) //Checks if szawpmapnames file does exist
    
{
        
//Now lets check if current map is in awpmapnames.ini
        
get_configsdir(szawpmapnamescharsmax(szawpmapnames)); // Get the AMX Mod X configs directory (folder). 
        
add(szawpmapnamescharsmax(szawpmapnames), "awpmapnames.ini"); // Add your filename to the filepath. 
        
get_mapname(szCurrentMapcharsmax(szCurrentMap)); // Get the current map. 
        
        
new fopen(szawpmapnames"rt"); // Open the file. 
        
while( !feof(f) ) // Loop until it finds the End Of the File (aka EOF). 
        

            
fgets(fszDatacharsmax(szData)); // Get all text from current line. 
            
trim(szData); // Trim off the new line and carriage return characters. 
            
if( containi(szCurrentMapszData) != -)   // Check if the current map is equal to the map listed on this line. 
            

                
g_bCurrentAWPMapIsInList true// Set boolean to true so that you know if the map was in the file. 
                
break; // Stop looping (reading the file) because you found what you came for. 
            

        } 
        
fclose(f); // Close the file.
    
}
    
    new 
CfgDir[32], CfgFile[192];
    
    
get_configsdir(CfgDircharsmaxCfgDir ) );
    
formatex(CfgFilecharsmaxCfgFile ), "%s/VIPCVARs.cfg"CfgDir);
        
    if( !
file_exists(CfgFile ) )
    {
        
server_print("[VIP] File %s is missing!"CfgDir//Prints a missing message
        
server_print("[VIP] CVAR's are loaded from the plugin!"CfgDir//Prints a load message
    
}
    else
    {    
        
server_print("[VIP] CVAR's are loaded from %s!"CfgDir); //Prints a load message
        
server_cmd("exec %s"CfgFile); //Loads CVARs from VIPCVARs.cfg
    
}
}

public 
plugin_precache() 
{
    if(
models_enabled == 1)
    {
        
precache_model(VIP_TR_MODEL//Precashes Terroris model
        
precache_model(VIP_CT_MODEL//Precashes Counter-Terroris model
    
}


public 
event_new_round(id)
{
    
g_freezetime false// Freeze time has ended, so lets set it to false
}

public 
LogEvent_RoundStart(id)
{
    
g_freezetime true//Sets g_freezetime to true
    
g_bRoundEnd false//Sets g_bRoundEnd to false
    
gMenuUsed[id] = 0//Makes sure that noone had yet chosen from menu
    
iTCount 0//Makes iTCount to 0
    
iCTCount 0//Makes iCTCount to 0
    
CurrentRound++; //Adds 1 to CurrentRound
    
new players[32], playerpnum
    
get_players(playerspnum"a");
    for ( new 
ipnumi++ )
    {
        switch( 
cs_get_user_teamplayers[i] ) )
        {
            case 
CS_TEAM_TiTCount++;
            case 
CS_TEAM_CTiCTCount++;
        }
    }
    for(new 
0pnumi++)
    {
        
player players[i];
        if (!
get_pcvar_num(g_menu_active))
            return 
PLUGIN_CONTINUE
        
        
if(CurrentRound >= menu_round && get_user_flags(id) & VIP_FLAG//Checks if current round is more or equal to menu_round and checks if player is VIP
        
{
            
Showrod(player); //Shows vip menu
        
}
    }
    return 
PLUGIN_CONTINUE;
}

public 
LogEvent_RoundEnd()
{
    
g_bRoundEnd true//Sets g_bRoundEnd to true
}

public 
Event_RoundRestart(id)
{
    
CurrentRound 0//Makes CurrentRound to 0
}

public 
LogEvent_GameCommencing(id)
{
    
CurrentRound 0//Makes CurrentRound to 0
}

public 
hook_death()
{
    new 
hp_added[64];
    
// Killer id
    
nKiller read_data(1)
    if(
is_user_alive(nKiller) && get_user_flags(nKiller) & VIP_FLAG
    {
        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) & VIP_FLAG))
        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"
        
if(nKiller_hp nHp_max)
        {
            
format(hp_addedsizeof(hp_added), "%L"nKiller"HP_ADDED"nHp_add)
            
set_hudmessage(02550, -1.00.1501.01.00.10.1, -1)
            
show_hudmessage(nKillerhp_added)
        }
        
// Screen fading
        
if(!get_user_flashed(nKiller)) //Checks if user is not flashed
        
{
            
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 
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(money_kill_bonus) - 300)
}

public 
on_damage(id)
{
    if(
g_enabled && get_user_flags(id) & VIP_FLAG)
    {        
        static 
attackerattacker get_user_attacker(id)
        static 
damagedamage read_data(2)        
        if(
g_showrecieved)
        {            
            
set_hudmessage(255000.450.5020.14.00.10.1, -1//Sets the hudmessage
            
ShowSyncHudMsg(idg_hudmsg2"%i^n"damage//Shows damage taken    
        
}
        if(
is_user_connected(attacker)) //Checks if attacker is online
        
{
            switch(
g_enabled)
            {
                case 
1: {
                    
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1//Sets the hudmessage
                    
ShowSyncHudMsg(attackerg_hudmsg1"%i^n"damage//Shows damage made            
                
}
                case 
2: {
                    if(
fm_is_ent_visible(attacker,id))
                    {
                        
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1//Sets the hudmessage
                        
ShowSyncHudMsg(attackerg_hudmsg1"%i^n"damage//Shows damage made        
                    
}
                }
            }
        }
    }
}

public 
Damage(id)
{
    new 
weaponhitpointattacker get_user_attacker(id,weapon,hitpoint)
    if(
attacker<=MAXPLAYERS && is_user_alive(attacker) && attacker!=id)
    if(
get_user_flags(id) & VIP_FLAG//Checks if player is VIP
    
{
        new 
money read_data(2) * get_pcvar_num(money_per_damage)
        if(
hitpoint==1money += get_pcvar_num(money_headshot_bonus//Checks if player damages enemy by head shot
        
cs_set_user_money(attacker,cs_get_user_money(attacker) + money//Gives money for damaging enemys
    
}
}

public 
fwHamPlayerSpawnPost(id)
{
    
gMenuUsed[id] = 0//Make sure that VIP didn't use VIP menu on his spawn
    
UserInBuyZone[id] = true;
    if(
is_user_alive(id))
    {
        if(
get_user_flags(id) & VIP_FLAG)
        {
            if(!
g_bCurrentMapIsInList//Checks if map is not the one written in mapnames.ini, if user is alive and if e has flag H
            
{
                
give_item(id"weapon_hegrenade"); //Gives HE grenade
                
give_item(id"weapon_flashbang"); //Gives FB grenade
                
give_item(id"weapon_flashbang"); //Gives BF grenade
                
give_item(id"weapon_smokegrenade"); //Gives SG grenade
                
give_item(id"item_assaultsuit"); //Gives armor
                
if(g_bHasBombSite && cs_get_user_team(id) == CS_TEAM_CT//Checks if current map has bombsite
                
{
                    
give_item(id"item_thighpack"); //Gives defuse kit
                
}
            }
        
            if(
models_enabled == 1//Checks of models are enabled (set to 1)
            
{
                new 
currentmodel[32];
                
fm_get_user_model(idcurrentmodelsizeof currentmodel 1); //Gets current player omdel
                    
                
if(cs_get_user_team(id) & CS_TEAM_T//Checks if player is in Terrorist team
                
{
                    
copy(player_model[id], sizeof(player_model), VIP_TR)
            
                    if(!
equal(currentmodelplayer_model[id])) //Checks if players model is not changed to VIP model
                    
{
                        
fm_set_user_model(idplayer_model[id]) //Sets players model
                    
}
                }
                else if(
cs_get_user_team(id) & CS_TEAM_CT//Checks if player is in Counter-Terrorist team
                
{
                    
copy(player_model[id], sizeof(player_model), VIP_CT)                    
            
                    if(!
equal(currentmodelplayer_model[id])) //Checks if players model is not changed to VIP model
                    
{
                        
fm_set_user_model(idplayer_model[id]) //Sets players model
                    
}
                }
            }
        }
    }
}

public 
fw_TouchWeapon(weaponid
{
    if (!
get_pcvar_num(g_sniper_pickup)) //Checks if g_sniper_pickup is disactivated (set to 0)
        
return PLUGIN_CONTINUE //If it is, let players pick up snipers
        
    
if (!is_user_alive(id) || get_user_flags(id) & VIP_FLAG//Checks if player is alive and if he is VIP
    
{
        return 
HAM_IGNORED//Ignores the blocked weapon pickup/buy
    
}
   
    static 
classname[32]
    
pev(weaponpev_classnameclassnamecharsmax(classname))
 
    for(new 
0sizeof vipgunsi++)
    if (
g_bCurrentMapIsInList && equal(classnamevipguns[i])) //Checks if current map is in list and if the weapon is one that is blocked
    
{
        
client_print(idprint_center"%L"id"SNIPER_ONLY_FOR_VIP"//Sends a message that snipers are only for VIP
        
return HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED//Ignores the blocked weapon pickup/buy


public 
fw_SetClientKeyValue(idinfobufferkey[], value[])
{   
    if (
g_model[id] && equal(key"model"))
        return 
FMRES_SUPERCEDE;
    
    return 
FMRES_IGNORED;
}

public 
fw_ClientUserInfoChanged(idinfobuffer)
{   
    if (!
g_model[id])
        return 
FMRES_IGNORED;
    
    new 
currentmodel[32]; 
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
    
    if(!
equal(currentmodelplayer_model[id]))
    {
        
fm_set_user_model(idplayer_model[id]) 
    }
    
    return 
FMRES_IGNORED;
}

public 
cmdvipmenu(id
{
    if ( 
is_user_alive(id) ) //Checks if player is alive
    
{
        if( 
get_user_flags(id) & VIP_FLAG //Checks if player is VIP
        
{
            if ( 
CurrentRound menu_round //Cheks if current round is lower than menu_round
            
{
                
client_printidprint_center"%L"id"VIP_MENU_ROUND"menu_round ); //Sends a message that VIP can use VIP menu only from specific round
            
}
            if ( 
map_active == //Checks if map_active is 1
            
{
                if( 
g_bCurrentMapIsInList //Checks if current map is in mapnames list
                
{
                    
client_printidprint_center"%L"id"VIP_MENU_WRONG_MAP" ); //Sends a message that VIP can't use VIP menu on that map
                
}
            }
            if ( 
gMenuUsed[id] >= menu_uses //Checks if palyer has already sued menu more than menu_uses
            
{
                
client_printidprint_center"%L"id"VIP_MENU_PER_ROUND"menu_uses ); //Message that VIP can only take VIP menu few time that is set as VIPUsed
            
}
            if ( !
g_freezetime //Checks if freezetime is not over yet and if user is alive and he has flag H
            
{
                
client_printidprint_center"%L"id"VIP_MENU_ONLY_FROM_ROUND_START" ); //Message that's set in vipplugin.txt as VIP_MENU_ONLY_FROM_ROUND_START
            
}
            if(
g_freezetime//Checks if freezetime is over
            
{
                if ( 
gMenuUsed[id] < menu_uses //Checks if VIP has already used VIP menu before, the amount of times we set as VIPUsed 
                
{
                    if( 
CurrentRound >= menu_round //Checks if current round is more or equal to the round that is set as VIPMenuRound
                    
{    
                        if (!
get_pcvar_num(g_menu_active)) //Checks if g_menu_active is disactivated (set to 0)
                            
return PLUGIN_CONTINUE//If so, VIP won't get VIP menu
                            
                        
Showrod(id//Shows VIP menu
                    
}
                }
            }
            if(
map_active//Checks if map_active is 1
            
{
                if( 
g_bCurrentMapIsInList //Checks if current map is in mapnames.ini, if so print the message and cancels the menu showup
                
{
                    
client_print(idprint_center"%L"id"VIP_MENU_WRONG_MAP"); //Sends a message that VIP can't use VIP menu on that map
                    
return PLUGIN_CONTINUE//Stop VIP from getting the VIP menu
                
}
            }
            if(
buyzone_active != 1)
            {
                
client_print(idprint_center"%L"id"VIP_MENU_NOT_BUYZONE");
            }
        }
        else 
// If user doesn't have VIP_FLAG
        
{
            
PrintText(id//Sets a task in 0.1 seconds and starts PrintTect
        
}
    }
    else if( 
get_user_flags(id) & VIP_FLAG //Checks if user is death and he have VIP_FLAG
    
{
        
client_printidprint_center"%L"id"VIP_MENU_MUST_BE_ALIVE" ); //Sends a message that VIP must be alive to use VIP menu
    
}
    else 
//If user is death and doesn't have VIP_FLAG
    
{
        
PrintText(id//Prints PrintText
    
}
    return 
PLUGIN_HANDLED;
}

public 
Showrod(id)
{
    if (
get_user_flags(id) & VIP_FLAG//Checks if player has flag H
    
{
        if( 
g_bCurrentAWPMapIsInList //Checks if map is in awpmapnames.ini
        
{
            
bAwpMap true //If so sets bAwpMap to true, so AWP choice would work in maps that are in awpmapnames.ini
        
}
        new 
newmenu[64], choice_1[64], choice_2[64], choice_3[64
        
format(newmenusizeof(newmenu), "%L"id"NEW_MENU"); //Shows a menu message that's set in vipplugin.txt as NEW_MENU_PRIMARY
        
menu menu_create(newmenu"Pressedrod"); //Creates menu that's in Pressedrod
        
        
format(choice_1sizeof(choice_1), "%L"id"MENU_CHOICE_1"); //Shows a menu message that's set in vipplugin.txt as MENU_CHOICE_PRIMARY_1
        
menu_additem(menuchoice_1"1"0); //Menu choice/case 1
        
format(choice_2sizeof(choice_2), "%L"id"MENU_CHOICE_2"); //Shows a menu message that's set in vipplugin.txt as MENU_CHOICE_PRIMARY_2
        
menu_additem(menuchoice_2"2"0); //Menu choice/case 2
        
if ( iTCount >= TR && iCTCount >= CT //Checks that each team has 5 or more people to AWP choice appear in the menu
        
{
            if (
awp_active == 1//Checks if vips can get awp choice, 0 - no; 1 - yes
            
{
                if ( 
CurrentRound >= awp_menu_round //Checks if current round is more or equal to 3, so AWP choice would come out
                
{
                    if( !
bAwpMap //Checks if map is not one in awpmapnames.xfg, if so shows the fifth menu item
                    
{
                        
format(choice_3sizeof(choice_3), "%L"id"MENU_CHOICE_3"); //Shows a menu message that's set in vipplugin.txt as MENU_CHOICE_PRIMARY_5
                        
menu_additem(menuchoice_3"3"0); //Menu choice/case 5
                    
}
                }
            }
        }        
        new 
menu_exit_name[64];
        
format(menu_exit_namesizeof(menu_exit_name), "%L"id"MENU_EXIT_NAME"//Formats menu_exit_name form vip.txt file
        
menu_setprop(menuMPROP_EXITNAMEmenu_exit_name//Sets menu exit name
        
menu_setprop(menuMPROP_EXITMEXIT_ALL); //Makes the exit button to close the menu
        
if(menu_number_color == 1//Checks if menu_number_color is set to 3
        
{
            
menu_setprop(menu,MPROP_NUMBER_COLOR,"\y"); // ets the number color to yello
        
}
        else if(
menu_number_color == 2//Checks if menu_number_color is set to 3
        
{
            
menu_setprop(menu,MPROP_NUMBER_COLOR,"\w"); //Sets the number color to white
        
}
        else if(
menu_number_color == 3//Checks if menu_number_color is set to 3
        
{
            
menu_setprop(menu,MPROP_NUMBER_COLOR,"\d"); //Sets the number color to grey
        
}
        else 
//In any other case the menu_number_color is set to
        
{
            
menu_setprop(menu,MPROP_NUMBER_COLOR,"\r"); //Sets the number color to red
        
}
        
menu_display(idmenu0)
    }
}

public 
Pressedrod(idmenuitem)
{
    if( 
item == MENU_EXIT //Checks if player clicks menu exit (0)
    
{
        
menu_destroy(menu); //If so the menu will be destroyed
        
return PLUGIN_HANDLED;
    }
    new 
iFlashes cs_get_user_bpammoidCSW_FLASHBANG ); //Makes iFlashes to check is player has flashbangs
    
new HasC4[33], HasHE[33], HasSG[33];
    new 
weapons pev(idpev_weapons)
    
HasC4[id] = ( weapons 1<<CSW_C4 //Makes HasC4 to check if player has C4
    
HasHE[id] = ( weapons 1<<CSW_HEGRENADE ) && cs_get_user_bpammo(idCSW_HEGRENADE//Makes HasHE to check if player has HE
    
HasSG[id] = ( weapons 1<<CSW_SMOKEGRENADE ) && cs_get_user_bpammo(idCSW_SMOKEGRENADE//Makes HasSG to check if player has SG
    
new data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
key str_to_num(data);
    if(
is_user_alive(id) && !g_bRoundEnd//Checks if player is alive and it's not round end
    
{
        
strip_user_weaponsid ); //Deletes players all weapons
        
switch(key)
        {
        case 
1: {                                  
                
give_item(id,"weapon_m4a1"//Gives M4A1
                
cs_set_user_bpammo(idCSW_M4A190); //Sets M4A1 back pack ammo to 90
                
client_printidprint_center"%L"id"CHOSE_M4A1" ); //Shows a message that's set in vipplugin.txt as CHOSE_M4A1
            
}
        case 
2: {     
                
give_item(id,"weapon_ak47"//Gives AK47
                
cs_set_user_bpammo(idCSW_AK4790); //Sets AK47 back pack ammo to 90
                
client_printidprint_center"%L"id"CHOSE_AK47" ); //Shows a message that's set in vipplugin.txt as CHOSE_AK47
            
}
        case 
3: { 
                
give_item(id,"weapon_awp"//Gives AWP
                
cs_set_user_bpammo(idCSW_AWP30); //Sets AWP back pack ammo to 30
                
client_printidprint_center"%L"id"CHOSE_AWP" ); //Shows a message that's set in vipplugin.txt as CHOSE_AWP
            
}
        }
        if (
HasC4[id]) //Checks if player had C4
        
{
            
give_item(id"weapon_c4"); //Gives C4
            
cs_set_user_plantid ); //Allows player to plant the bomb
            
set_pev(idpev_body1); //Puts C4 model on it's back
        
}
        if (
HasHE[id]) //Checks if player has HE
        
{
            
give_item(id"weapon_hegrenade"//Gives HE
        
}
        if (
HasSG[id]) //Checks if player has SG
        
{
            
give_item(id"weapon_smokegrenade"); //Gives SG
        
}
        if( 
iFlashes //Checks if player has FB
        

            
give_itemid"weapon_flashbang" ); //Gives first FB
            
cs_set_user_bpammoidCSW_FLASHBANGiFlashes ); //Gives second FB
        

        
give_item(id,"weapon_knife"//Gives knife
        
give_item(id,"weapon_deagle"//Gives deagle
        
cs_set_user_bpammo(idCSW_DEAGLE35); //Sets deagle back pack ammo to 35
        
if(g_bHasBombSite && cs_get_user_team(id) == CS_TEAM_CT//Checks if current map has bombsite
        
{
            
give_item(id"item_thighpack"); //Gives defuse kit
        
}
        
gMenuUsed[id]++ //Makes sure that VIP really made a choice
    
}
    
menu_destroy(menu); //Destroys menu
    
return PLUGIN_CONTINUE;
}

public 
HandleCmd(id)
{
    if (!
get_pcvar_num(g_sniper_active)) //Checks if g_awp_active is disactivated (set to 0)
        
return PLUGIN_CONTINUE //If it is, let players buy snipers
        
    
if(get_user_flags(id) & VIP_FLAG)  //Checks if player has flag H
        
return PLUGIN_CONTINUE 
        
    client_print
idprint_center"%L"id"SNIPER_ONLY_FOR_VIP" ); //Sends a message that snipers are only for VIP
    
    
return PLUGIN_HANDLED;
}

public 
ShowMotd(id)
{
    new 
contact[112];
    
get_cvar_string("vip_contactinfo"contact63//Gets the vip_contactinfo
    
new price[112];
    
get_cvar_string("vip_price"price63//Gets the vip_price
    
static MOTD[1501];
    new 
len formatex(MOTD1500,"<style type=text/css>body{background-color: #000000;font-family:Verdana,Tahoma;}</style>");
    
len += formatex(MOTD[len],1500-len,"<font size=2 color=#e0a518><b><center>%L</center></b></font><br /><font size=1 color=#c0c0ff><UL>"id"MOTD_LINE_01");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_02");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_03");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_04");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_05");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_06");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_07");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_08");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI>"id"MOTD_LINE_09");
    
len += formatex(MOTD[len],1500-len,"%L"id"MOTD_LINE_10");
    
len += formatex(MOTD[len],1500-len,"<br>%L"id"MOTD_LINE_11");
    
len += formatex(MOTD[len],1500-len,"<br>%L"id"MOTD_LINE_12");
    
len += formatex(MOTD[len],1500-len,"<LI>%L</LI><br>"id"MOTD_LINE_13");
    
len += formatex(MOTD[len],1500-len,"<font size=1 color=#00c000><strong>%L</strong></font>"id"MOTD_LINE_14")
    
len += formatex(MOTD[len],1500-len,"<br>%L %s"id"MOTD_LINE_15"price)
    
len += formatex(MOTD[len],1500-len,"<br>%L <font color=#FF6600>%s</font>"id"MOTD_LINE_16"contact);

    new 
motd_name[64];
    
format(motd_name64"%L"id"WANTVIP_MOTD_NAME"); //Formats the MOTD name from VIP.txt file
    
show_motd(id,MOTDmotd_name); //Shows the MOTD to player
    
    
return PLUGIN_HANDLED;
}

public 
client_putinserver(id)
{
    if (!
task_exists(id 1000)) set_task(30.0"PrintText"id 1000//Checks if task already exist, if not print text set in public PrintText
}

public 
PrintText(id)
{
    if(
color_msg == 1//Checks if color_msg is 1
    
{
        
client_print_colorid"%L"id"PRINT_TEXT_COLORED" ); //Message which is sent
    
}
    else
    {
        
client_print_colorid"%L"id"PRINT_TEXT" ); //Message which is sent
    
}
}

public 
StatusIcon_buyzone_OFFid )
{
    
UserInBuyZone[id] = false;
    
    
CheckMenuClose(id);
}

public 
Event_StatusIcon_Show_buyzone(id

    if(
get_user_flags(id) & VIP_FLAG && buyzone_active == 1
    { 
        
UserInBuyZone[id] = true;
    } 
}

CheckMenuClose(id)
{
    new 
oldMenuIdnewMenuId;
    
player_menu_info(idoldMenuIdnewMenuId)
    if(
newMenuId > -&& newMenuId == menu && buyzone_active == 1)
    {
        
menu_cancel(id);
    }
}

public 
print_adminlist(user
{
    new 
idcountxlenadminnames[33][32];
    for(
id id <= MAXPLAYERS id++)
    {
        if(
is_user_connected(id) && get_user_flags(id) & VIP_FLAG//Checks if player is connected and if player is VIP
        
{
            
get_user_name(idadminnames[count++], 31//Gets players name and adds to adminnames
        
}
    }
                
    if(
vips_list == || vips_list == 3//Checks if vips_list is 2 or 3
    
{                    
        new 
contact[112];
        
get_cvar_string("vip_contactinfo"contact63//Gets the vip_contactinfo
        
new price[112];
        
get_cvar_string("vip_price"price63//Gets the vip_price
        
new Data[g_Buffer];
    
        
len formatex(Data[len], g_Buffer len"<html><center><font color=yellow>%L <font color=green>%s.<font color=yellow> %L <font color=green>%s</font><body bgcolor=Black>"user"CONTACT"contactuser"MOTD_LINE_15"price);
        
len += formatex(Data[len], g_Buffer len"<br><table border=1 width=300 cellspacing=0 bordercolor=#4A4344 style=color:#56A5EC;text-align:center;>");
        
len += formatex(Data[len], g_Buffer len"<tr><td><b>#</b></td><td><b>%L</b></td></tr>"user"VIPS_ONLINE");
    
        if(
count 0)
        {
            for(
count x++) 
            {
                
len += formatex(Data[len], g_Buffer len"<tr><td><font color=Red>%d</font></td>"1);
                
len += formatex(Data[len], g_Buffer len"<td>%s</td></tr>"adminnames[x]);
            }
        }
        else
        {
            
len += formatex(Data[len], g_Buffer len"<tr><td><font color=Red>-</font></td>");
            
len += formatex(Data[len], g_Buffer len"<td>%L</td></tr>"user"NO_VIPS_ONLINE");
        }
        
len += formatex(Data[len],g_Buffer len,"</center></body></html>");
        new 
motd_name[64];
        
format(motd_name64"%L"user"WANTVIP_MOTD_NAME"); //Formats the MOTD name from VIP.txt file
        
show_motd(userDatamotd_name); //Shows MOTD to player
        
        
    
}
    if(
vips_list == || vips_list == 3//Checks if vips_list is 1 or 3
    
{
        new 
message[256], contact[112]
        
        if(
color_msg == 1)
        {
            
len format(message255"%L"user"VIPS_ONLINE_COLORED"COLOR)
        }
        else
        {
            
len format(message255"%L"user"VIPS_ONLINE")
        }
        if(
count 0)
        {
            for(
count x++) 
            {
                
len += format(message[len], 255-len" %s%s "adminnames[x], < (count-1) ? ", ":"")
                if(
len 96 
                {
                    
client_print_color(usermessage)
                    if(
color_msg == 1)
                    {
                        
len format(message255"%s",COLOR)
                    }
                    else
                    {
                        
len format(message255"")
                    }
                }
            }
            
client_print_color(usermessage)
        }
        else 
        {
            
len += format(message[len], 255-len" %L"id"NO_VIPS_ONLINE")
            
client_print_color(usermessage)
        }
        
        
get_cvar_string("vip_contactinfo"contactcharsmax(contact))
        if(
contact[0]) 
        {
            if(
color_msg == 1)
            {
                
client_print_color(user"%L %s"user"CONTACT_COLORED"contact)
            }
            else
            {
                
client_print_color(user"%L %s"user"CONTACT"contact)
            }
        }
    }
}

stock fm_set_user_model(playermodelname[])
{   
    
engfunc(EngFunc_SetClientKeyValueplayerengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modelname)
    
    
g_model[player] = true
}

stock fm_get_user_model(playermodel[], len)
{   
    
engfunc(EngFunc_InfoKeyValueengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modellen)
}

stock fm_reset_user_model(player)
{         
    
g_model[player] = false
    
    dllfunc
(DLLFunc_ClientUserInfoChangedplayerengfunc(EngFunc_GetInfoKeyBufferplayer))
}

get_user_flashed(id, &iPercent=0//Checks if user is flashed

    new 
Float:flFlashedAt get_pdata_float(idm_flFlashedAt

    if( !
flFlashedAt 
    { 
        return 

    

    
    new 
Float:flGameTime get_gametime() 
    new 
Float:flTimeLeft flGameTime flFlashedAt 
    
new Float:flFlashDuration get_pdata_float(idm_flFlashDuration
    new 
Float:flFlashHoldTime get_pdata_float(idm_flFlashHoldTime
    new 
Float:flTotalTime flFlashHoldTime flFlashDuration 
    
    
if( flTimeLeft flTotalTime 
    { 
        return 

    

    
    new 
iFlashAlpha get_pdata_int(idm_iFlashAlpha

    if( 
iFlashAlpha == ALPHA_FULLBLINDED 
    { 
        if( 
get_pdata_float(idm_flFlashedUntil) - flGameTime 0.0 
        { 
            
iPercent 100 
        

        else 
        { 
            
iPercent 100-floatround(((flGameTime - (flFlashedAt flFlashHoldTime))*100.0)/flFlashDuration
        } 
    } 
    else 
    { 
        
iPercent 100-floatround(((flGameTime flFlashedAt)*100.0)/flTotalTime
    } 

    return 
iFlashAlpha 
}

stock client_print_color(const id, const input[], any:...) 

    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 

    
replace_all(msg190"!g""^x04"); // Green Color 
    
replace_all(msg190"!n""^x01"); // Default Color 
    
replace_all(msg190"!t""^x03"); // Team Color 

    
if (idplayers[0] = id; else get_players(playerscount"ch"); 
    { 
        for (new 
0counti++) 
        { 
            if (
is_user_connected(players[i])) 
            { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

Yes when I want to compile its showing errors
CanyoN1337 is offline
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 02-25-2019 , 04:52   Re: Help With VIP.SMA ERRORS
Reply With Quote #5

Quote:
Originally Posted by CanyoN1337 View Post
Hello, I need help with plugin VIP.SMA when I want to compile its showing this errors

VIP.sma(834) : error 035: argument type mismatch (argument 2)
VIP.sma(83 : error 035: argument type mismatch (argument 2)
VIP.sma(929) : error 035: argument type mismatch (argument 2)
VIP.sma(940) : error 035: argument type mismatch (argument 2)
VIP.sma(945) : error 035: argument type mismatch (argument 2)
VIP.sma(953) : error 035: argument type mismatch (argument 2)
VIP.sma(957) : error 035: argument type mismatch (argument 2)
VIP.sma(1023) : error 021: symbol already defined: "client_print_color"
VIP.sma(1023) : error 001: expected token: "=", but found ","
VIP.sma(1023) : error 008: must be a constant expression; assumed zero
VIP.sma(1023) : fatal error 107: too many error messages on one line

Compilation aborted.
11 Errors.

bro i can compile your plugin there maybe some include error in your compile
SHIELD755 is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 02-25-2019 , 06:15   Re: Help With VIP.SMA ERRORS
Reply With Quote #6

Quote:
Originally Posted by CanyoN1337 View Post
Hello, I need help with plugin VIP.SMA when I want to compile its showing this errors

VIP.sma(834) : error 035: argument type mismatch (argument 2)
VIP.sma(83 : error 035: argument type mismatch (argument 2)
VIP.sma(929) : error 035: argument type mismatch (argument 2)
VIP.sma(940) : error 035: argument type mismatch (argument 2)
VIP.sma(945) : error 035: argument type mismatch (argument 2)
VIP.sma(953) : error 035: argument type mismatch (argument 2)
VIP.sma(957) : error 035: argument type mismatch (argument 2)
VIP.sma(1023) : error 021: symbol already defined: "client_print_color"
VIP.sma(1023) : error 001: expected token: "=", but found ","
VIP.sma(1023) : error 008: must be a constant expression; assumed zero
VIP.sma(1023) : fatal error 107: too many error messages on one line

Compilation aborted.
11 Errors.
If you're compiling under amxmodx 1.8.3/1.9.0 you have to change "client_print_color" to a different name, or adjust the parameters to work with the new "client_print_color" native included with 1.9.0;
PartialCloning 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 01:27.


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