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

Vip Plugin Add Guns Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cosminvl
Member
Join Date: Mar 2013
Location: Romania
Old 08-29-2019 , 14:09   Vip Plugin Add Guns Menu
Reply With Quote #1

cAN YOU ADD FOR ME GUNS MENU FOR THIS PLUGIN
AFTER 3 ROUND TO GIVE MENU FOR CHOICE WEPON
FOR TERRO
AK47+DEAGLE+HE SMOKE FLASHBANG
GALIL+DEAGLE+HE SMOKE FLASHBANG
AWP+DEAGLE+HE SMOKE FLASHBANG
FOR CT
M4A1+DEAGLE+HE SMOKE FLASHBANG
FAMAS+DEAGLE+HE SMOKE FLASHBANG
AWP+DEAGLE+HE SMOKE FLASHBANG


PHP Code:
/*


        Credits: Exolent - VIP in Scoreboard
            pharse - x2 Jump for VIP( for ZP 5.0.5 )
            Sn!ff3r - Show bullet dmg in HUD only VIP
            Askhanar - Change Model to VIP
            cheap.suit - No VIP Flash( extracted on Biohazard v2.00 beta )
            AMXX Dev Team - Add VIP's
            cyby - VIP Event
        

*/
#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >
#include < cstrike >
#include < fakemeta >
#include < engine >
#include < fun >
#include < CC_ColorChat >
#include < message_const >

//#define USING_SQL

#if defined USING_SQL
#include < sqlx >
#endif

// Toate aceste date vor fi trecute in fisierul "users.ini" !
#define VIP_FLAGS        "bit"    // Flagurile VIP-ului( Nu schimba )
#define VIP_FLAGS_TYPE        "a"    // a - deconecteaza VIP-ii cu parola invalida( Alte flaguri gasiti in "users.ini" )
#define VIP_PASSWORD        "parola"    // Aici setati parola oricarui VIP

#define is_user_player(%1) ( 1 <= %1 <= g_iMaxPlayers )

#define TASK_SECRET_MSG        216439

// Aici schimbati orele cand jucatorii pot avea VIP free( pentru a dezactiva setati caloarea 0 cvar-ului "vip_enable_vip_event" )
#define FIRST_HOUR    12
#define LAST_HOUR    13

new const PLUGIN_VERSION[  ] = "1.0.2",
     
PLUGIN_AUTHOR[  ] = "YONTU";

#if defined USING_SQL
new const PLUGIN_NAME_SQL[  ] = "VIP System( SQL )";
#else
new const PLUGIN_NAME[  ] = "VIP System";
#endif

new const g_szTag[  ] = "[VIP CSGO]";    // TAG
new const g_szVipFlags[  ] =    "t";        // flagul vip-ului( ADMIN_LEVEL_H )

// Aici iti pui numele cu care joci pe server si adresa ta( pluginul va afisa un mesaj la inceput de runda cu datele tale daca jucatorii sunt interesati sa cumpere vip );
new const YourNick[  ] = "CoSmiN"
     
YourMessenger[  ] = "www.pubzone.ro";

static const 
COLORG[  ] = "^x04"COLORD[  ] = "^x01"COLORT[  ] = "^x03";

// Refil Ammo on headshot
new const g_Weapons[  ] = {

    
CSW_M4A1,
    
CSW_AK47,
    
CSW_DEAGLE,
    
CSW_USP
};

new const 
g_szWeapons[  ][  ] = {

    
"weapon_m4a1",
    
"weapon_ak47",
    
"weapon_deagle",
    
"weapon_usp"
};

new const 
g_iWeaponsAmmo[  ] = {

    
30,
    
30,
    
7,
    
12
};

enum {

        
SCOREATTRIB_ARG_PLAYERID 1,
        
SCOREATTRIB_ARG_FLAGS
};

enum ( <<= ) {

        
SCOREATTRIB_FLAG_NONE 0,
        
SCOREATTRIB_FLAG_DEAD 1,
        
SCOREATTRIB_FLAG_BOMB,
        
SCOREATTRIB_FLAG_VIP
};

enum _:WhatUserHas {

    
Speed,
    
Jump,
}
new 
bool:g_bUserHas33 ][ WhatUserHas ];

new     
g_cvar_speed_spawn,
    
g_cvar_health_spawn,
    
g_cvar_armor_spawn,
    
g_cvar_gravity_spawn,
    
g_cvar_multidmg,
    
g_cvar_health_kill_reward,
    
g_cvar_health_hs_reward,
    
g_cvar_maxhealth,
    
g_cvar_kill_money_reward,
    
g_cvar_show_msgs,
    
g_cvar_enable_show_dmg,
    
g_cvar_ebable_vip_scoreboard,
    
g_cvar_enable_vip_noflash,
    
g_cvar_enable_vip_multijump,
    
g_cvar_enable_vip_event,
    
g_cvar_enable_vip_model;

new 
Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame;

new 
bool:VipEvent;

new 
iJumpNum33 ] = 0;
new 
g_iMultiJumps33 ] = 0;
new 
g_iMaxJumps 0;

new 
g_iMaxPlayers;
new 
SyncHudMessage;

public 
plugin_init(  ) {

    
#if defined USING_SQL
    
register_pluginPLUGIN_NAME_SQL,
            
PLUGIN_VERSION,
            
PLUGIN_AUTHOR );
    
#else
    
register_pluginPLUGIN_NAME,
            
PLUGIN_VERSION,
            
PLUGIN_AUTHOR );
    
#endif

    
register_clcmd"say /wantvip""ShowAbilityForVip" );
    
register_clcmd"say_team /wantvip""ShowAbilityForVip" );

    
register_concmd"amx_addvips""ClCmdAddVips"ADMIN_RCON"< nume >" );

    
register_event"ResetHUD""event_ResetModel""b" );
    
register_event"DeathMsg""event_DeathMsg""a" );
    
register_event"DeathMsg""event_DeathMsg2""ae" );
    
register_event"Damage""event_Damage""b""2!0""3=0""4!0" );

    
register_logevent"logevent_RoundStart""1=Round_Start" );
    
register_logevent"logevent_RoundEnd"2"1=Round_End" );

    
register_forwardFM_PlayerPreThink"forward_PlayerPreThink" );
    
register_forwardFM_PlayerPostThink"forward_PlayerPostThink" );

    
RegisterHamHam_Spawn"player""Ham_PlayerSpawnPost");
    
RegisterHamHam_TakeDamage"player""Ham_TakeDamagePre" );
    
RegisterHamHam_Player_ResetMaxSpeed"player""Ham_ResetMaxSpeedPost");

        
register_messageget_user_msgid"ScoreAttrib" ), "MessageScoreAttrib" );
    
register_messageget_user_msgid"ScreenFade" ), "MessageScreenFade" );

    
g_cvar_speed_spawn register_cvar"vip_speed_spawn""400.0" );        // viteza pe care o primeste vip-ul la spawn( sa fie cu zecimala.0 )
    
g_cvar_health_spawn register_cvar"vip_health_spawn""200" );        // viata pe care o primeste vip-ul la spawn
    
g_cvar_armor_spawn register_cvar"vip_armor_spawn""150" );        // armura pe care o primeste vip-ul la spawn
    
g_cvar_gravity_spawn register_cvar"vip_gravity_spawn""0.85" );    // gravitatea pe care o primeste vip-ul la spawn
    
g_cvar_multidmg register_cvar"vip_multi_dmg""2.0" );        // vip-ul are dmg mai mare la toate armele
    
g_cvar_health_kill_reward register_cvar"vip_hp_kill_reward""15" );    // cata viata sa primeasca vip-ul cand face un kill
    
g_cvar_health_hs_reward register_cvar"vip_hp_hs_reward""25" );    // cata viata sa primeasca vip-ul cand face un headshot
    
g_cvar_maxhealth register_cvar"vip_maxhealth""300" );        // viata maxima a vip-ului
    
g_cvar_kill_money_reward register_cvar"vip_kill_money""1000" );    // Cati bani sa primeasca Vip-ul pe un frag
    
g_cvar_show_msgs register_cvar"vip_show_messages""30.0" );        // la ce interval de timp.0 sa apara mesajele in chat despre VIP
    
g_cvar_enable_show_dmg register_cvar"vip_show_dmg""1" );        // afiseaza vip-ului dmg-ul facut de victima si dmg-ul pe care i la facut victimei
    
g_cvar_ebable_vip_scoreboard register_cvar"vip_on_scoreboard""1" );    // 1 - vip-ii apar in scoreboard ca "VIP" | 0 - dezactivat
    
g_cvar_enable_vip_noflash register_cvar"vip_imune_flashbang""1" );    // 1 - Vip-ul este imun la flash-uri | 0 - Nu este
    
g_cvar_enable_vip_multijump register_cvar"vip_enable_multijump""1" );    // 1 - Vip-ul beneficiaza de multi jump | 0 - Nu beneficiaza
    
g_cvar_enable_vip_event register_cvar"vip_enable_vip_event""1" );    // 1 - Intre anumite ore toti jucatorii au VIP | 0 dezactivat
    
g_cvar_enable_vip_model register_cvar"vip_enable_model""1" );    // 1 - VIP-ul are alt model pe server | 0 - Nu are

    
if( get_pcvar_numg_cvar_enable_vip_event ) > ) {

        
check_time(  );
        
set_task60.0"check_time"___"b" );
        
set_task1.0"hud_mess"___"b" );
    }

    new 
szFile64 ]
    
get_configsdirszFile63 );
    
formatszFile63"%s/vip_system.cfg"szFile );
    
    if( 
file_existsszFile ) ) 
        
server_cmd"exec %s"szFile );

    
g_iMaxPlayers get_maxplayers(  );
    
SyncHudMessage CreateHudSyncObj(  );
}

public 
plugin_cfg(  )
    
set_cvar_float"sv_maxspeed"1000.0 );

public 
plugin_precache(  ) {

    
precache_model"models/player/vip_ct/vip_ct.mdl" );
    
precache_model"models/player/vip_tero/vip_tero.mdl" );
}

public 
client_putinserverid ) {

    
g_iMultiJumpsid ] = 0;
    
iJumpNumid ] = 0;
    
g_bUserHasid ][ Jump ] = false;
    
g_bUserHasid ][ Speed ] = false;
}

public 
client_disconnectid ) {

    
g_iMultiJumpsid ] = 0;
    
iJumpNumid ] = 0;
    
g_bUserHasid ][ Jump ] = false;
    
g_bUserHasid ][ Speed ] = false;
}

public 
event_ResetModelid ) {

    if( 
get_pcvar_numg_cvar_enable_vip_model ) ) {

        if( 
is_user_vipid ) ) {

            new 
CsTeams:userTeam cs_get_user_teamid );

            if( 
userTeam == CS_TEAM_T ) {

                
cs_set_user_modelid"vip_t" );

                return 
1;
            }

            else if( 
userTeam == CS_TEAM_CT ) {

                
cs_set_user_modelid"vip_ct" );

                return 
1;
            }
        } else
            
cs_reset_user_modelid );
    } else
        return 
0;

    return 
0;
}

public 
event_DeathMsg(  ) {

    new 
iAttacker read_data);
    new 
iVictim read_data);
    new 
iHeadshot read_data);
    
    new 
HealthOnHeadShot get_pcvar_numg_cvar_health_hs_reward );
    new 
MaxHealth get_pcvar_numg_cvar_maxhealth );
    new 
HealthOnKill get_pcvar_numg_cvar_health_kill_reward );

    if( 
iAttacker == iVictim )
        return 
0;

    if( 
is_user_vipiAttacker ) && iAttacker != iVictim ) {
        
        if( 
get_user_healthiAttacker ) <= MaxHealth ) {

            if( 
iHeadshot ) {

                
set_user_healthiAttackerget_user_healthiAttacker ) + HealthOnHeadShot );

                
set_hudmessage025000.850.706.05.0 );
                
ShowSyncHudMsgiAttackerSyncHudMessage"+ %i HP"HealthOnHeadShot );
            } else {

                
set_user_healthiAttackerget_user_healthiAttacker ) + HealthOnKill );

                
set_hudmessage20020000.850.706.05.0 );
                
ShowSyncHudMsgiAttackerSyncHudMessage"+ %i HP"HealthOnKill );
            }
        }

        if( 
is_user_aliveiAttacker ) && !is_user_botiAttacker ) )
            if( 
read_data) )
                for( new 
0sizeofg_Weapons ); w++ )
                    if( 
get_user_weaponiAttacker ) == g_Weapons] )
                        if( 
find_ent_by_owner( -1g_szWeapons], iAttacker ) )
                            
cs_set_weapon_ammofind_ent_by_owner( -1g_szWeapons], iAttacker ), g_iWeaponsAmmo] );
    }

    return 
0;
}

public 
event_DeathMsg2(  ) {

    new 
iAttacker read_data); 
    new 
iVictim read_data);

    new 
BonusMoney get_pcvar_numg_cvar_kill_money_reward );
    
    if( 
iAttacker == iVictim )
        return 
0;

    if( 
is_user_vipiAttacker ) )
        if( 
iAttacker && is_user_aliveiAttacker ) )
            if( 
cs_get_user_teamiVictim ) == CS_TEAM_T || cs_get_user_teamiVictim ) == CS_TEAM_CT )
                if( 
cs_get_user_moneyiAttacker ) < 16000 BonusMoney 300 )
                    
cs_set_user_moneyiAttackercs_get_user_moneyiAttacker ) + BonusMoney 300 );

    return 
0;
}

public 
event_Damageid ) {

    if( 
get_pcvar_numg_cvar_enable_show_dmg ) > ) {

        static 
iAttacker;
        static 
fDamage;
    
        
iAttacker get_user_attackerid );
        
fDamage read_data);

        if( 
is_user_aliveid ) && is_user_vipid ) ) {
            
            
set_hudmessage255000.450.5020.11.00.10.1, -);
            
ShowSyncHudMsgidSyncHudMessage"%i^n"fDamage );    
        }

        if( 
is_user_aliveiAttacker ) && is_user_vipiAttacker ) ) {

            
set_hudmessage025515, -1.00.5520.11.00.020.02, -);
            
ShowSyncHudMsgiAttackerSyncHudMessage"%i^n^n"fDamage );
        }
    }
}

public 
logevent_RoundStart(  ) {
    
    new 
szPlayers32 ], iNum;
    
get_playersszPlayersiNum"ch" );
    
    for( new 
0iNumi++)  {

        
g_bUserHasszPlayers] ][ Speed ] = false;
        
g_bUserHasszPlayers] ][ Jump ] = false;
        
g_iMultiJumpsszPlayers] ] = 0;
        
iJumpNumszPlayers] ] = 0;

        if( 
task_existsszPlayers] + TASK_SECRET_MSG ) )
            
remove_taskszPlayers] + TASK_SECRET_MSG );
        
        
set_taskget_pcvar_floatg_cvar_show_msgs ), "task_ShowMessage"szPlayers] + TASK_SECRET_MSG );
    }
}

public 
logevent_RoundEnd(  ) {
    
    new 
szPlayers32 ], iNum;
    
get_playersszPlayersiNum"ch" );
    
    for( new 
0iNumi++ )
        
remove_taskszPlayers] );
}

public 
forward_PlayerPreThinkid ) {

    if( !
is_user_aliveid ) || !g_iMultiJumpsid ] )
        return 
0;

    if( ( 
pevidpev_button ) & IN_JUMP ) && !( pevidpev_flags ) & FL_ONGROUND ) && !( pevidpev_oldbuttons ) & IN_JUMP ) ) {

        if( 
iJumpNumid ] < g_iMultiJumpsid ] ) {

            
g_bUserHasid ][ Jump ] = true;
            
iJumpNumid ]++;

            return 
0;
        }
    }

    if( ( 
pevidpev_button ) & IN_JUMP ) && ( pevidpev_flags ) & FL_ONGROUND ) ) {

        
iJumpNumid ] = 0;
        return 
0;
    }

    return 
0;
}

public 
forward_PlayerPostThinkid ) {

    if( !
is_user_aliveid ) || !g_iMultiJumpsid ] )
        return 
0;

    if( 
g_bUserHasid ][ Jump ] ) {

        new 
Float:fVelocity];

        
pevidpev_velocityfVelocity );

        
fVelocity] = random_float265.0285.0 );

        
set_pevidpev_velocityfVelocity );

        
g_bUserHasid ][ Jump ] = false;
        return 
0;
    }

    return 
0;
}

public 
Ham_PlayerSpawnPostid ) {
    
    if( !
is_user_aliveid ) && !is_user_vipid ) )
        return 
HAM_IGNORED;
    
    if( 
is_user_vipid ) && !is_user_botid ) )
        
set_task1.0"task_GiveSkillsAllVips"id );
    
    return 
HAM_IGNORED;
}

public 
task_GiveSkillsAllVipsid ) {

    
//drop_prim( id );

    
g_bUserHasid ][ Speed ] = true;
    
fm_set_user_maxspeedidget_pcvar_floatg_cvar_speed_spawn ) );

    new 
szCommand128 ];
    
formatexszCommandsizeofszCommand ) - 1"cl_forwardspeed %.1f;cl_sidespeed %.1f;cl_backspeed %.1f"get_pcvar_floatg_cvar_speed_spawn ), get_pcvar_floatg_cvar_speed_spawn ), get_pcvar_floatg_cvar_speed_spawn ) );
    
client_cmdidszCommand );

    if( 
get_pcvar_numg_cvar_enable_vip_multijump ) > )
        if( 
g_iMultiJumpsid ] < g_iMaxJumps || !g_iMaxJumps )
            
g_iMultiJumpsid ]++;

    
set_user_healthidget_pcvar_numg_cvar_health_spawn ) );
    
set_user_armoridget_pcvar_numg_cvar_armor_spawn ) );
    
set_user_gravityidget_pcvar_floatg_cvar_gravity_spawn ) );

    
fm_give_itemid"weapon_hegrenade" );
    
fm_give_itemid"weapon_flashbang" );
    
fm_give_itemid"weapon_flashbang" );
    
fm_give_itemid"weapon_smokegrenade" );

    
//GiveRifle( id );
}

public 
GiveRifleid ) {

    
fm_give_itemid"weapon_m4a1" );
    
cs_set_user_bpammoidCSW_M4A1300 );

    
fm_give_itemid"weapon_ak47" );
    
cs_set_user_bpammoidCSW_AK47300 );

    
fm_give_itemid"weapon_awp" );
    
cs_set_user_bpammoidCSW_AWP100 );

    
fm_give_itemid"weapon_deagle" );
    
cs_set_user_bpammoidCSW_DEAGLE70 );
}

public 
task_ShowMessagetaskid ) {

    new 
id taskid TASK_SECRET_MSG;

    
ColorChatidGREEN"%s^x01 Vrei sa cumperi si tu^x03 Membru V.I.P^x01? Contacteaza-l pe^x03 %s^x01 la^x03 %s^x01 !!!"g_szTagYourNickYourMessenger );

    
set_taskget_pcvar_floatg_cvar_show_msgs ) * 0.5"task_ShowMessage2"id );

    if( 
task_existstaskid ) )
        
remove_tasktaskid );
}

public 
task_ShowMessage2id ) {

    
ColorChatidGREEN"%s^x01 Vrei sa faci rost de^x03 Membru VIP^x01 si nu stii cum? Tasteaza^x03 /wantvip^x01 !!!"g_szTag );

    
set_taskget_pcvar_floatg_cvar_show_msgs ) * 1.2"task_PrintVipList"id );
}

public 
task_PrintVipListuser ) {

    new 
szAdminNames33 ][ 32 ];
    new 
szMessage256 ];
    new 
iCountiLen;
    
    for( new 
id id <= g_iMaxPlayers id++ )
        if( 
is_user_connectedid ) )
            if( 
is_user_vipid ) )
                
get_user_nameidszAdminNamesiCount++ ], 31 );

    
iLen formatszMessage255"%sVIP's Online: "COLORG );

    if( 
iCount ) {

        for( new 
iCount i++ ) {

            
iLen += formatszMessageiLen ], 255 iLen"^x03%s^x01 | "szAdminNames], COLORTCOLORD );

            if( 
iLen 96 ) {

                
print_messageuserszMessage );
                
iLen formatszMessage255"%s"COLORG );
            }
        }

        
print_messageuserszMessage );
    } else {

        
iLen += formatszMessageiLen ], 255 iLen"^x01Nu sunt VIP-i online."COLORD );
        
print_messageuserszMessage );
    }
}

public 
Ham_ResetMaxSpeedPostid ) {

    if( 
is_user_aliveid ) && is_user_vipid ) && get_user_maxspeedid ) != 1.0 ) {

          new 
Float:flMaxSpeed;

          if( 
g_bUserHasid ][ Speed ] )
               
flMaxSpeed floatget_pcvar_numg_cvar_speed_spawn ) );

          if( 
flMaxSpeed 0.0 )
               
set_pevidpev_maxspeedflMaxSpeed );
    }
}

public 
Ham_TakeDamagePreiVictimiInflictoriAttackerFloat:fDamage ) {

    if( 
iVictim == iAttacker || !is_user_playeriAttacker ) || !is_user_aliveiAttacker ) || is_user_botiAttacker ) )
        return 
HAM_HANDLED;

    if( 
is_user_vipiAttacker ) && is_user_playeriAttacker ) )
        
SetHamParamFloat4fDamage get_pcvar_floatg_cvar_multidmg ) );

    return 
HAM_IGNORED;
}

public 
MessageScoreAttribiMsgIdiMsgDestid ) {

    if( 
get_pcvar_numg_cvar_ebable_vip_scoreboard ) > ) {

        new 
iPlayer get_msg_arg_intSCOREATTRIB_ARG_PLAYERID );
        
        if( 
accessiPlayerread_flagsg_szVipFlags ) ) )
            
set_msg_arg_intSCOREATTRIB_ARG_FLAGSARG_BYTESCOREATTRIB_FLAG_VIP );
    }
}

public 
MessageScreenFadeiMsgIdiMsgDestid ) {

    if( 
is_user_vipid ) && is_user_aliveid ) && get_pcvar_numg_cvar_enable_vip_noflash ) ) {

        static 
szData];

        
szData] = get_msg_arg_int);
        
szData] = get_msg_arg_int);
        
szData] = get_msg_arg_int);
        
szData] = get_msg_arg_int);
        
        if( 
szData] == 255 && szData] == 255 && szData] == 255 && szData3] > 199 )
            return 
1;
    }

    return 
0;
}

public 
check_time(  ) {

    static 
preluare_ora], ora;
    
get_time"%H"preluare_ora);

    
ora str_to_numpreluare_ora );

    if( 
FIRST_HOUR >= ora || ora LAST_HOUR ) {

        if( !
VipEvent )
            
ColorChat0GREEN"^x04%s^x01 Eventul^x03 Free VIP^x01 a fost activat!"g_szTag );

        
VipEvent true;
        
server_cmd"amx_default_access ^"t^"" );
    } else {

        if( 
VipEvent )
            
ColorChat0GREEN"^x04%s^x01 Eventul^x03 Free VIP^x01 a fost activat!"g_szTag );

        
VipEvent false;
        
server_cmd"amx_default_access ^"z^"" );
    }

    
server_cmd"amx_reloadadmins" );
}

public 
hud_mess(  ) {

    if( 
VipEvent ) {

        
set_hudmessage20020010, -1.00.011.01.00.10.1 );
        
show_hudmessage0"Toti jucatorii beneficiaza de VIP free aceasta ora!" );
    }
}

public 
ShowAbilityForVipid ) {

    new 
iCfgDir32 ], iFile192 ];
        
    
get_configsdiriCfgDircharsmaxiCfgDir ) );
    
formatexiFilecharsmaxiFile ), "%s/vip.html"iCfgDir );

    
show_motdidiFile );
}

public 
ClCmdAddVipsidlevelcid ) {

    if( !
cmd_accessidlevelcid) )
        return 
1;

    new 
szTarget32 ];
    
read_argv1szTarget31 );

    new 
iPlayer cmd_targetidszTarget);

    if( !
iPlayer )
        return 
1;

    new 
szPlayerName32 ], szAdminName32 ];
    
get_user_nameiPlayerszPlayerNamecharsmaxszPlayerName ) );
    
get_user_nameidszAdminNamecharsmaxszAdminName ) );

    
AddVIPidszPlayerNameVIP_FLAGSVIP_PASSWORDVIP_FLAGS_TYPEszAdminName );
    
server_cmd"amx_reloadadmins" );

    
console_printid"%s Vip-ul a fost adaugat in lista!"g_szTag );
    
ColorChat0GREEN"^x04%s^x01 Adminul^x03 %s^x01 l-a adaugat ca VIP pe^x03 %s^x01 !"g_szTagszAdminNameiPlayer );
    
ColorChatiPlayerGREEN"^x04%s^x01 Felicitari! Ai fost adaugat ca membru^x03 VIP^x01! VIP-ul se va activa harta viitoare!"g_szTag );

    return 
1;
}

stock bool:is_user_vipid ) {

    if( 
get_user_flagsid ) & read_flagsg_szVipFlags ) )
        return 
true;
    
    return 
false;
}

stock print_messageidMsg[  ] ) {

    
message_beginMSG_ONEget_user_msgid"SayText" ), { 00}, id );
    
write_byteid );
    
write_stringMsg );
    
message_end(  );
}

// stocks from "fakemeta_util"
stock fm_give_itemindex, const item[  ] ) {

    if( !
equalitem"weapon_") && !equalitem"ammo_") && !equalitem"item_") && !equalitem"tf_weapon_"10 ) )
        return 
0;

    new 
ent fm_create_entityitem );

    if( !
pev_valident ) )
        return 
0;

    new 
Float:fOrigin];
    
pevindexpev_originfOrigin );

    
set_peventpev_originfOrigin );
    
set_peventpev_spawnflagspeventpev_spawnflags ) | SF_NORESPAWN );

    
dllfuncDLLFunc_Spawnent );

    new 
save peventpev_solid );

    
dllfuncDLLFunc_Touchentindex );

    if( 
peventpev_solid ) != save )
        return 
ent;

    
engfuncEngFunc_RemoveEntityent );

    return -
1;
}

stock fm_set_user_maxspeedindexFloat:speed = -1.0 ) {

    
engfuncEngFunc_SetClientMaxspeedindexspeed );

    
set_pevindexpev_maxspeedspeed );

    return 
1;
}

stock Float:fm_get_user_maxspeedindex ) {

    new 
Float:speed;
    
pevindexpev_maxspeedspeed );

    return 
speed;
}

stock fm_set_renderingentityfx kRenderFxNone255255255render kRenderNormalamount 16 ) {

    new 
Float:RenderColor];
    
RenderColor] = float);
    
RenderColor] = float);
    
RenderColor] = float);

    
set_peventitypev_renderfxfx );
    
set_peventitypev_rendercolorRenderColor );
    
set_peventitypev_rendermoderender );
    
set_peventitypev_renderamtfloatamount ) );

    return 
1;
}

stock fm_create_entity( const classname[  ] )
    return 
engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocStringclassname ) );

AddVIPidname[  ], accessflags[  ], password[  ], flags[  ], comment[  ]="" ) {

#if defined USING_SQL
    
new error128 ], errno;

    new 
Handle:info SQL_MakeStdTuple(  );
    new 
Handle:sql SQL_Connectinfoerrnoerror127 );

    if( 
sql == Empty_Handle ) {

        
server_print"[AMXX] %L"LANG_SERVER"SQL_CANT_CON"error );
#endif
        // Make sure that the users.ini file exists.
        
new configsDir64 ];
        
get_configsdirconfigsDir63 );
        
formatconfigsDir63"%s/users.ini"configsDir );

        if( !
file_existsconfigsDir ) ) {

            
console_printid"%s File ^"%s^" doesn't exist."g_szTagconfigsDir );
            return;
        }

        
// Make sure steamid isn't already in file.
        
new line 0textline256 ], len;
        const 
SIZE 63;
        new 
line_steamidSIZE ], line_passwordSIZE ], line_accessflagsSIZE ], line_flagsSIZE ], parsedParams;

        
// <name|ip|steamid> <password> <access flags> <account flags>
        
while( ( line read_fileconfigsDirlinetextline255len ) ) ) {

            if ( 
len == || equaltextline";") )
                continue; 
// comment line

            
parsedParams parsetextlineline_steamidSIZEline_passwordSIZEline_accessflagsSIZEline_flagsSIZE );

            if( 
parsedParams != )
                continue;    
// Send warning/error?
            
            
if( containiline_flagsflags ) != -&& equalline_steamidname ) ) {

                
console_printid"%s %s already exists!"g_szTagname );
                return;
            }
        }
    
        
// If we came here, steamid doesn't exist in users.ini. Add it.
        
new linetoadd512 ];
        
        if( 
comment]==)
            
formatexlinetoadd511"^r^n^"%s^" ^"%s^" ^"%s^" ^"%s^""namepasswordaccessflagsflags );

        else
            
formatexlinetoadd511"^r^n^"%s^" ^"%s^" ^"%s^" ^"%s^" ; %s"namepasswordaccessflagsflagscomment );

        
console_printid"Adding:^n%s"linetoadd );
        
        if( !
write_fileconfigsDirlinetoadd ) )
            
console_printid"%s Failed writing to %s!"g_szTagconfigsDir );
#if defined USING_SQL
    
}
    
    new 
table32 ];

    
get_cvar_string"amx_sql_table"table31 );

    new 
Handle:query SQL_PrepareQuerysql"SELECT * FROM `%s` WHERE (`auth` = '%s')"tablename );
    
    if( !
SQL_Executequery ) ) {

        
SQL_QueryErrorqueryerror127 );
        
server_print"[AMXX] %L"LANG_SERVER"SQL_CANT_LOAD_ADMINS"error );
        
console_printid"[AMXX] %L"LANG_SERVER"SQL_CANT_LOAD_ADMINS"error );
    } 
        
    else if( 
SQL_NumResultsquery ) )
        
console_printid"%s %s already exists!"g_szTagname );

    else {

        
console_printid"Adding to database:^n^"%s^" ^"%s^" ^"%s^" ^"%s^""namepasswordaccessflagsflags );

        
SQL_QueryAndIgnoresql"REPLACE INTO `%s` (`name`, `password`, `access`, `flags`) VALUES ('%s', '%s', '%s', '%s')"tablenamepasswordaccessflagsflags );
    }

    
SQL_FreeHandlequery );
    
SQL_FreeHandlesql);
    
SQL_FreeHandleinfo );
#endif
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
tHANK yOU
__________________


cosminvl is offline
Send a message via Yahoo to cosminvl
Old 08-31-2019, 14:52
cosminvl
This message has been deleted by asherkin.
Old 08-31-2019, 15:11
LearninG
This message has been deleted by asherkin.
Old 09-01-2019, 02:49
DON KHAN 1
This message has been deleted by asherkin.
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 07:59.


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