AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   /vips command not working (https://forums.alliedmods.net/showthread.php?t=332850)

giumbalau 06-04-2021 14:51

/vips command not working
 
Anyone can fix the /vips command please ?
Please....
PHP Code:

/************************* CREDITS *************************
- OciXCrom ( For VIP Hour stock )
- Yontu ( For map parsing in file code )
************************* CREDITS *************************/
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < engine >
#include < fakemeta >
#include < fun >
#include < hamsandwich >
#pragma semicolon 1
#define PLUGIN "VIP Clasic"
#define VERSION "1.7"
#define AUTHOR "Shadows Adi"
//Aici modifici 'ADMIN_LEVEL_H' in functie de flagul pe care il vrei. Default: 't'
#define is_user_vip(%1) (get_user_flags(%1) & ADMIN_LEVEL_H)
//Aici vei pune "//" in fata lui #define daca nu vrei sa ii apara tag in chat cand scrie.
//#define VIP_CHAT
enum _:CvarsSettings {
    
VipHP,
    
VipHsHP,
    
VipAP,
    
VipHsAP,
    
VipMaxHP,
    
VipMaxAP,
    
VipPrefix,
    
VipSpawnHP,
    
VipSpawnAP,
#if defined VIP_CHAT
    
VipChatPrefix,
#endif
    
VipJumps,
    
VipPrices,
    
VipMenuRounds,
    
VipFree,
    
VipFreeStart,
    
VIpFreeEnd,
    
VipMaxResets
};
enum _:Teams
{
    
CT 0,
    
TERO,
    
BOTH
};
enum _:Weapons {
    
WeapName[64],
    
WeaponID[32],
    
BpAmmo,
    
Team[Teams]
};
new const 
VipWeapons[][Weapons] = {
    { 
"AK47 \d+ \wDeagle \d+ \wSet Grenade""weapon_ak47"90TERO },
    { 
"Galil \d+ \wDeagle \d+ \wSet Grenade""weapon_galil"30TERO },
    { 
"AWP \d+ \wDeagle \d+ \wSet Grenade""weapon_awp"30BOTH },
    { 
"M4A1 \d+ \wDeagle \d+ \wSet Grenade""weapon_m4a1"90CT },
    { 
"Famas \d+ \wDeagle \d+ \wSet Grenade""weapon_famas"30CT }
};
new const 
VipPistols[][Weapons] = {
    { 
"\wDeagle \d+ \wGrenade Set""weapon_deagle"35BOTH },        
    { 
"\wUSP \d+ \wGrenade Set","weapon_usp"100BOTH },    
    { 
"\wGlock-18 \d+ \wGrenade Set""weapon_glock18"120BOTH }    
};
new 
pCvars[CvarsSettings];
new 
g_iRound;
new 
jumpnum33 ] = 0;
new 
g_bMapBanned;
new 
Limit 33 ];
new 
Tag32 ];
/********************** BOOLEANS **********************/
new bool:WeaponSelected[33];
new 
bool:dojump33 ] = false;
/********************** END OF BOOLEANS **********************/
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const 
SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR);
    
    
register_clcmd"say /vm""ShowVIPMenu" );
    
register_clcmd"say /vmenu""ShowVIPMenu" );
    
register_clcmd"say /vip""ShowVIPMotd" );
    
register_clcmd"say /vips""ShowVIPs" );
    
register_clcmd"say /rsd""check_vip" );
    
register_clcmd"say_team /vm""ShowVIPMenu" );
    
register_clcmd"say_team /vmenu""ShowVIPMenu" );
    
register_clcmd"say_team /vips""ShowVIPs" );
    
register_clcmd"say_team /rsd""check_vip" );
    
    
register_cvar"lgcs_vip_version"VERSIONFCVAR_SERVER FCVAR_SPONLY FCVAR_UNLOGGED );
    
pCvars VipHP ] = register_cvar"vip_kill_hp""10" );
    
pCvars VipAP ] = register_cvar"vip_kill_ap""10" );
    
pCvars VipHsHP ] = register_cvar"vip_killhs_hp""15" );
    
pCvars VipHsAP ] = register_cvar"vip_killhs_ap""15" );
    
pCvars VipMaxHP ] = register_cvar"vip_max_hp""110" );
    
pCvars VipMaxAP ] = register_cvar"vip_max_ap""110" );
    
pCvars VipPrefix ] = register_cvar"vip_msg_prefix""[VIP]" );
    
pCvars VipSpawnHP ] = register_cvar("vip_spawn_hp""100");
    
pCvars VipSpawnAP ] = register_cvar("vip_spawn_ap""100");
    
    
#if defined VIP_CHAT
    
register_clcmd"say ""hook_say" );
    
register_clcmd"say_team ""hook_sayteam" );
    
pCvars VipChatPrefix ] = register_cvar"vip_chat_prefix""[VIP]" );
    
#endif
    
    
pCvars VipJumps ] = register_cvar"vip_multi_jumps""1" );
    
pCvars VipPrices ] = register_cvar"vip_prices_motd""vip_info.html" );
    
pCvars VipMenuRounds ] = register_cvar"vip_rounds_showmenu""3" );
    
pCvars VipFree ] = register_cvar"vip_free_on""1" );
    
pCvars VipFreeStart ] = register_cvar"vip_free_start""22" );
    
pCvars VIpFreeEnd ] = register_cvar"vip_free_end""10" );
    
pCvars VipMaxResets ] = register_cvar"vip_max_reset_deaths""3" );
    
    
RegisterHamHam_Spawn"player""ham_PlayerSpawnPost"1);
    
RegisterHamHam_Killed"player""ham_PlayerKilled"1);
    
register_event"HLTV""ev_NewRound""a""1=0""2=0" ); 
    
register_logevent"logev_Restart"2"1&Restart_Round""1&Game_Commencing" );
    
register_message(get_user_msgid("ScoreAttrib"), "OnScoreAttrib");
    
    
get_pcvar_stringpCvarsVipPrefix ], TagcharsmaxTag ) );
    new 
path64 ];
    
get_localinfo"amxx_configsdir"pathcharsmaxpath ) );
    
formatexpathcharsmaxpath ), "%s/VIP/vip_maps.ini"path);
    
    new 
file fopenpath"r+" );
    
    if( !
file_existspath ) )
    {
        
write_filepath"; VIP-UL ESTE DEZACTIVAT PE URMATOARELE HARTI: ");
        
write_filepath"; Exemplu de adaugare HARTA:^n; ^"harta^"^n^nfy_snow^nawp_bycastor" );
        
write_filepath"; NOTA:^n Pentru a ignora anumite harti, adaugati ^";^" in fata hartii" );
    }
    
    new 
mapname32 ];
    
get_mapnamemapnamecharsmaxmapname ) );
    
    new 
text121 ], maptext32 ];
    while( !
feoffile ) )
    {
        
fgetsfiletextcharsmaxtext ) );
        
trimtext );
        
        if( 
text] == ';' || !strlentext ) ) 
        {
            continue; 
        }
        
        
parsetextmaptextcharsmaxmaptext ) );
        
        if( 
equalmaptextmapname) )
        {
            
//********* AICI STERGETI "//" DIN FATA PENTRU DEBUG. *********//
            //log_amx("Am dezactivat pluginul 'VIP' pe harta %s.", maptext ); 
            
g_bMapBanned 1;
            break;
        }
    }
    
fclosefile );
}
public 
client_putinserverid )
{
    if( 
is_user_vipid ) )
    {
        new 
szName[32];
        
get_user_nameidszNamecharsmaxszName ) );
        
color_chat(0"!g%s !yVIP-ul !g%s !ytocmai s-a conectat pe server!"TagszName);
    }
    
jumpnumid ] = 0;
    
dojumpid ] = false;
}
#if AMXX_VERSION_NUM < 183
public client_disconnectid )
#else
public client_disconnectedid )
#endif
{
    
jumpnumid ] = 0;
    
dojumpid ] = false;
}
public 
ev_NewRound( )
{
    
g_iRound++;
    if( 
IsVipHourget_pcvar_numpCvars VipFreeStart ] ), get_pcvar_numpCvars VIpFreeEnd ] ) ) )
        
set_pcvar_stringpCvars VipFree ], "1" );
    else
        
set_pcvar_stringpCvars VipFree ], "0" );
}
public 
logev_Restart( )
{
    
g_iRound 0;
}
public 
check_vipid )
{
    if( 
is_user_vipid ) )
    {
        
vip_rsid );
    }
    else
    {
        
color_chatid"^3| ^4%s^3| ^1Aceasta comanda este doar pentru membrii ^4V.I.P. ^1!"Tag );
        return 
1;
    }
    return 
0;
}
public 
vip_rs(id)
{
    if(
Limit id ] >= get_pcvar_numpCvarsVipMaxResets ] ) )
    {
        
color_chat(id"^3| ^4%s ^3| ^1Aceasta comanda poate fi folosita decat de ^4 3 ^1ori pe ^4harta ^1!"Tag );
        return 
1;
    }
    else
    {
        
cmd_rs(id);
        
Limit[id]++;
    }
    return 
0;
}
public 
cmd_rs(id)
{
    if(
get_user_deaths(id) == 0)
    {
        
color_chat(id"^3| ^4%s ^3| ^1Death-urile tale sunt deja ^4 0^3!"Tag );
    }
    else 
    {
        
cs_set_user_deaths(id,0);
        
color_chat(id"^3| ^4%s ^3| ^4Decesele tale ^1au fost ^4resetate^1!"Tag );
    }
    return 
PLUGIN_HANDLED;
}
public 
ShowVIPMenuid )
{
    if(!
is_user_connected(id) || !is_user_alive(id)) 
        return 
PLUGIN_HANDLED;
    
    if(
is_user_vipid ) || get_pcvar_numpCvarsVipFree ] ) )
    {
        if(
g_bMapBanned)
        {
            
color_chat(id"!g%s !yVIP-ul este dezactivat pe aceasta harta!g!"Tag);
            return 
PLUGIN_HANDLED;
        }
        else
        {
            if( 
g_iRound >= get_pcvar_numpCvarsVipMenuRounds ] ) )
            {
                if(!
WeaponSelected id ] )
                {
                    new 
g_iMenu menu_create("\wVIP Menu""handle_vip_menu_weapons" );
                    new 
szItem[32], CsTeams:iTeam;
                    
iTeam cs_get_user_team(id);
                    
                    for ( new 
isizeof VipWeaponsi++ )
                    {
                        switch(
iTeam)
                        {
                            case 
CS_TEAM_T:
                            {
                                switch(
VipWeapons[i][Team])
                                {
                                    case 
TEROBOTH:
                                    {
                                        
num_to_str(iszItemcharsmax(szItem));
                                        
menu_additemg_iMenuVipWeapons][ WeapName ], szItem );
                                    }
                                }
                            }
                            case 
CS_TEAM_CT:
                            {
                                switch(
VipWeapons[i][Team])
                                {
                                    case 
CTBOTH:
                                    {
                                        
num_to_str(iszItemcharsmax(szItem));
                                        
menu_additemg_iMenuVipWeapons][ WeapName ], szItem );
                                    }
                                }
                            }
                        }
                    }
                    
                    
menu_setprop(g_iMenuMPROP_EXITMEXIT_ALL);
                    
menu_displayidg_iMenu );
                }
                else 
                {
                    
color_chatid"!g%s!y: Asteapta runda viitoare pentru a-ti alege iar armele!"Tag );
                    return 
PLUGIN_HANDLED;
                }
            }
            else
            {
                if(!
WeaponSelected id ] )
                {
                    new 
g_iMenu menu_create("\wVIP Menu""handle_vip_menu_pistols" );
                    new 
szItem[32], CsTeams:iTeam;
                    
iTeam cs_get_user_team(id);
                    
                    for ( new 
isizeof VipPistolsi++ )
                    {
                        switch(
iTeam)
                        {
                            case 
CS_TEAM_T:
                            {
                                switch(
VipPistols[i][Team])
                                {
                                    case 
TEROBOTH:
                                    {
                                        
num_to_str(iszItemcharsmax(szItem));
                                        
menu_additemg_iMenuVipPistols][ WeapName ], szItem );
                                    }
                                }
                            }
                            case 
CS_TEAM_CT:
                            {
                                switch(
VipPistols[i][Team])
                                {
                                    case 
CTBOTH:
                                    {
                                        
num_to_str(iszItemcharsmax(szItem));
                                        
menu_additemg_iMenuVipPistols][ WeapName ], szItem );
                                    }
                                }
                            }
                        }
                    }
                    
                    
menu_setprop(g_iMenuMPROP_EXITMEXIT_ALL);
                    
menu_displayidg_iMenu );
                }
                else 
                {
                    
color_chatid"!g%s!y: Asteapta runda viitoare pentru a-ti alege iar armele!"Tag );
                    return 
PLUGIN_HANDLED;
                }
            }
        }
    }
    else 
    {
        
color_chatid"!g%s!y: Acest meniu este doar pentru jucatorii !gVIP!y!"Tag );
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;
}
public 
handle_vip_menu_weaponsidmenuitem )
{
    if( 
item == MENU_EXIT || !is_user_aliveid ))
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
itemdata[3];
    new 
data[6][32];
    new 
index[32];
    
menu_item_getinfo(menuitemitemdata[0], data[0], charsmax(data), data[1], charsmax(data), itemdata[1]);
    
parse(data[0], index31);
    
item str_to_num(index);
    if( 
is_user_vipid ) || get_pcvar_numpCvarsVipFree ] ) )
    {
        
drop_weaponsid1);
        
drop_weaponsid2);
        
give_itemid"weapon_knife" );
        
give_itemid"weapon_hegrenade" );
        
give_itemid"weapon_flashbang" );
        
cs_set_user_bpammoidCSW_FLASHBANG);
        
WeaponSelected id ] = true;
        
give_itemidVipWeaponsitem ][ WeaponID ] );
        
cs_set_user_bpammoidget_weaponidVipWeaponsitem ][ WeaponID ] ), VipWeaponsitem ][ BpAmmo ] );
        
give_itemid"weapon_deagle" );
        
cs_set_user_bpammoidCSW_DEAGLE35 );
    }
    return 
PLUGIN_HANDLED;
}
public 
handle_vip_menu_pistolsidmenuitem )    
{    
    if( 
item == MENU_EXIT || !is_user_aliveid ) || !is_user_connected(id))
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
itemdata[3];
    new 
data[6][32];
    new 
index[32];
    
menu_item_getinfo(menuitemitemdata[0], data[0], charsmax(data), data[1], charsmax(data), itemdata[1]);
    
parse(data[0], index31);
    
item str_to_num(index);
    
    if( 
is_user_vipid ) || get_pcvar_numpCvarsVipFree ] ) )    
    {    
        
drop_weaponsid);    
        
give_itemid"weapon_knife" );    
        
give_itemid"weapon_hegrenade" );    
        
give_itemid"weapon_flashbang" );    
        
cs_set_user_bpammoidCSW_FLASHBANG);    
        
WeaponSelected id ] = true;    
        
give_itemidVipPistolsitem ][ WeaponID ] );    
        
cs_set_user_bpammoidget_weaponidVipPistolsitem ][ WeaponID ] ), VipPistolsitem ][ BpAmmo ] );    
    }    
    return 
PLUGIN_HANDLED;    
}    
public 
ham_PlayerSpawnPostid )
{
    if(!
is_user_aliveid ) )
        return 
HAM_IGNORED;
    
    if( 
is_user_vipid ) || get_pcvar_numpCvarsVipFree ] ) )
    {
        
WeaponSelected id ] = false;
        
        
ShowVIPMenuid );
        
        
cs_set_user_armorid100CS_ARMOR_VESTHELM );
        
        if( 
get_user_teamid ) == )
            
give_itemid"item_thighpack" );
        
cs_set_user_armor(idget_pcvar_num(pCvars VipSpawnAP ]), CS_ARMOR_VESTHELM);
        
set_user_health(idget_pcvar_num(pCvars VipSpawnHP ]));
    }
    return 
PLUGIN_HANDLED;
}
public 
ham_PlayerKillediVictimiAttacker )
{
    if( !
iVictim || !iAttacker || !is_user_aliveiAttacker ) )
        return 
HAM_IGNORED;
        
    if( 
is_user_vipiAttacker ) || get_pcvar_numpCvarsVipFree ] ) )
    {
        new 
g_iIsHeadshot read_data);
        new 
g_iHealth get_user_healthiAttacker );
        new 
g_iArmor get_user_armoriAttacker );
        new 
g_iHealthAdd get_pcvar_numpCvarsVipHP ] );
        new 
g_iHealthHSAdd get_pcvar_numpCvarsVipHsHP ] );
        new 
g_iArmorAdd get_pcvar_numpCvarsVipAP ] );
        new 
g_iArmorHSAdd get_pcvar_numpCvarsVipHsAP ] );
        new 
g_iMaxHP get_pcvar_numpCvarsVipMaxHP ] );
        new 
g_iMaxAP get_pcvar_numpCvarsVipMaxAP ] );
        
        if( 
g_iIsHeadshot )
        {
            if( 
g_iHealth >= g_iMaxHP || g_iArmor >= g_iMaxAP )
            {
                
set_user_healthiAttackerg_iMaxHP );
                
set_user_armoriAttackerg_iMaxAP );
            }
            else
            {
                
set_user_healthiAttackerg_iHealth g_iHealthHSAdd );
                
set_user_armoriAttackerg_iHealth g_iArmorHSAdd );
            }
        }
        else
        {
            if( 
g_iHealth >= g_iMaxHP || g_iArmor >= g_iMaxAP )
            {
                
set_user_healthiAttackerg_iMaxHP );
                
set_user_armoriAttackerg_iMaxAP );
            }
            else
            {
                
set_user_healthiAttackerg_iHealth g_iHealthAdd );
                
set_user_armoriAttackerg_iHealth g_iArmorAdd );
            }
        }
    }
    return 
PLUGIN_HANDLED;
}
public 
client_PreThink(id)
{
    if(!
is_user_alive(id)) return PLUGIN_CONTINUE;
    
    new 
nbut get_user_button(id);
    new 
obut get_user_oldbutton(id);
    if((
nbut IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut IN_JUMP))
    {
        if( 
is_user_vipid ) || get_pcvar_numpCvarsVipFree ] ) )
        {
            if(
jumpnum[id] < get_pcvar_numpCvarsVipJumps ] ))
            {
                
dojump[id] = true;
                
jumpnum[id]++;
                return 
PLUGIN_CONTINUE;
            }
        }
    }
    if((
nbut IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
    {
        
jumpnum[id] = 0;
        return 
PLUGIN_CONTINUE;
    }
    return 
PLUGIN_CONTINUE;
}
public 
client_PostThink(id)
{
    if(!
is_user_alive(id)) return PLUGIN_CONTINUE;
    if( 
is_user_vipid ) || get_pcvar_numpCvarsVipFree ] ) )
    {
        if(
dojump[id] == true)
        {
            new 
Float:velocity[3]    ;
            
entity_get_vector(id,EV_VEC_velocity,velocity);
            
velocity[2] = random_float(265.0,285.0);
            
entity_set_vector(id,EV_VEC_velocity,velocity);
            
dojump[id] = false;
            return 
PLUGIN_CONTINUE;
        }
    }
    return 
PLUGIN_CONTINUE;
}
#if defined VIP_CHAT
public hook_sayid )
{
    if( 
is_user_vipid ) || get_pcvar_numpCvarsVipFree ] ) )
    {
        new 
szName32 ], szMessage192 ], szPrefix32 ];
        
get_user_nameidszNamecharsmaxszName ) );
        
get_pcvar_stringpCvarsVipChatPrefix ], szPrefixcharsmaxszPrefix ) );
        
        
read_argsszMessagecharsmaxszMessage ) );
        
remove_quotesszMessage );
        
        if( 
is_user_aliveid ) )
            
color_chat0"!g%s!team %s!y: %s"szPrefixszNameszMessage );
            
        else if(!
is_user_aliveid ) )
            
color_chat0"!y*DEAD* !g%s!team %s!y: %s"szPrefixszNameszMessage );
    }
    else 
    {
        new 
szName32 ], szMessage192 ];
        
get_user_nameidszNamecharsmaxszName ) );
        
read_argsszMessagecharsmaxszMessage ) );
        
remove_quotesszMessage );
        
        if( 
is_user_aliveid ) )
            
color_chat0"!team %s!y: %s"szNameszMessage );
            
        else if(!
is_user_aliveid ) )
            
color_chat0"!y*DEAD* %s!team %s!y: %s"szNameszMessage );
    }
    return 
PLUGIN_HANDLED;
}
public 
hook_sayteamid )
{
    if( 
is_user_vipid ) || get_pcvar_numpCvarsVipFree ] ) )
    {
        new 
szName32 ], szMessage192 ], szPrefix32 ];
        
get_user_nameidszNamecharsmaxszName ) );
        
get_pcvar_stringpCvarsVipChatPrefix ], szPrefixcharsmaxszPrefix ) );
        
        
read_argsszMessagecharsmaxszMessage ) );
        
remove_quotesszMessage );
        if(
get_user_teamid ) == )
        {
            if( 
is_user_aliveid ) )
                
color_chat0"!y(Terrorist) !g%s!team %s!y: %s"szPrefixszNameszMessage );
                
            else if( !
is_user_aliveid ) )
                
color_chat0"!y*DEAD* (Terrorist) !g%s!team %s!y: %s"szPrefixszNameszMessage );
        }
        if(
get_user_teamid ) == )
        {
            if( 
is_user_aliveid ) )
                
color_chat0"!y(Counter-Terrorist) !g%s!team %s!y: %s"szPrefixszNameszMessage );
                
            else if( !
is_user_aliveid ) )
                
color_chat0"!y*DEAD* (Counter-Terrorist) !g%s!team %s!y: %s"szPrefixszNameszMessage );
        }
    }
    else
    {
        new 
szName32 ], szMessage192 ];
        
get_user_nameidszNamecharsmaxszName ) );
        
        
read_argsszMessagecharsmaxszMessage ) );
        
remove_quotesszMessage );
        if(
get_user_teamid ) == )
        {
            if( 
is_user_aliveid ) )
                
color_chat0"!y(Terrorist)!team %s!y: %s"szNameszMessage );
                
            else if( !
is_user_aliveid ) )
                
color_chat0"!y*DEAD* (Terrorist)!team %s!y: %s"szNameszMessage );
        }
        if(
get_user_teamid ) == )
        {
            if( 
is_user_aliveid ) )
                
color_chat0"!y(Counter-Terrorist)!team %s!y: %s"szNameszMessage );
                
            else if( !
is_user_aliveid ) )
                
color_chat0"!y*DEAD* (Counter-Terrorist)!team %s!y: %s"szNameszMessage );
        }
    }
    
    return 
PLUGIN_HANDLED;
}
#endif
public ShowVIPMotd(id)
{
    if( !
is_user_connectedid ) )
        return 
PLUGIN_HANDLED;
    new 
szString64 ], Temp64 ], Tag[32];
    
get_pcvar_stringpCvarsVipPrices ], szStringcharsmaxszString ) );
    
get_pcvar_stringpCvarsVipPrefix ], TagcharsmaxTag ) );
    
    
formatexTempcharsmaxTemp ), "addons/amxmodx/configs/%s"szString );
    
    
show_motdidTemp"Avantajele VIP-ului" );
    
color_chat(0"!g%s !yCiteste despre avantajele !gVIP!y-ului!y!");
    return 
PLUGIN_HANDLED;
}
public 
OnScoreAttribiMsgIdiMsgDestiMsgEnt )
{
    if( 
is_user_vipget_msg_arg_int) ) || get_pcvar_numpCvarsVipFree ] ) )
    {
        if(
is_user_alive(get_msg_arg_int)))
        {
            
set_msg_arg_int2ARG_BYTE, ( 1<<) );
        }
    }
}
public 
ShowVIPsid )
{
    if(
is_user_connectedid ) )
        return 
PLUGIN_HANDLED;
        
    new 
vip_name[33];
    new 
message[190];
    new 
contorlen;
    if( 
is_user_vipid ) )
    {
        
get_user_nameidvip_namecontor++ ], charsmaxvip_name ) );
    }
    
len formatmessagecharsmaxmessage ), "!g%s !yVIP's Online!team: ");
    if( 
contor 
    {
        for( new 
contor i++)
        {
            
len += formatmessagelen ], charsmaxmessage ) - len"!y%s%s "vip_name], < ( contor ) ? ", " "");
            if(
len 96 )
            {
                
color_chatidmessage );
                
len formatmessagecharsmaxmessage ), "%s ");
            }
        }
        
color_chatidmessage);
    }
    else 
    {
        
len += formatmessagelen ], charsmaxmessage ) - len"No VIP online.");
        
color_chatidmessage );
    }
    return 
PLUGIN_CONTINUE;
}
bool:IsVipHouriStartiEnd //Credits OciXCrom
{
    new 
iHourtimeiHour );
    return 
bool:( iStart iEnd ? ( iStart <= iHour iEnd ) : ( iStart <= iHour || iHour iEnd ) );

stock drop_weapons(iddropwhat)
{
    
// Get user weapons
    
new weapons[32], num_weaponsindexweaponid;
    
get_user_weapons(idweaponsnum_weapons);
    
    
// Loop through them and drop primaries or secondaries
    
for (index 0index num_weaponsindex++)
    {
        
// Prevent re-indexing the array
        
weaponid weapons[index];
        
        if ((
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) 
        || (
dropwhat == && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM))
        || (
dropwhat == 3) && (((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM) || ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            
// Get weapon entity
            
new wname[32];
            
get_weaponname(weaponidwnamecharsmax(wname));
            
            
// Player drops the weapon
            
engclient_cmd(id"drop"wname);
        }
    }

// Stock: ChatColor!
stock color_chat(const id, const input[], any:...)
{
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^4"); // Green Color
    
replace_all(msg190"!y""^1"); // Default Color
    
replace_all(msg190"!team""^3"); // Team Color
    
replace_all(msg190"!team2""^0"); // Team2 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();
            }
        }
    }




All times are GMT -4. The time now is 19:53.

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