Raised This Month: $51 Target: $400
 12% 

Base Builder Zombie Mod v6.5 [01/15/2011]


Post New Thread Reply   
 
Thread Tools Display Modes
GaBy56
Junior Member
Join Date: Jan 2013
Old 03-14-2013 , 03:20   Re: Base Builder Zombie Mod v6.5 [01/15/2011]
Reply With Quote #1011

Who can help me with the bug of basebuilder 6.4 too close track when you bring salt up and down.

Forget code to give it a little addons changed:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <fun>
#include <csx>

// Plugin Version
new VERSION[]="6.4"
new formatmodname[] = "^x01[^x04 BaseBuilder^x01 ]"

//Models
new const g_ZombieModel1[] = "basebuilder82"

//Sounds
new g_RoundStart[] = "basebuilder82/round_start.wav"
new g_ZombKill1[] = "basebuilder82/zombie_kill1.wav"

new g_WinZomb[] = "basebuilder82/zombies_win.wav"
new g_WinHum[] = "basebuilder82/humans_win.wav"

#define AFTER_BUILD ADMIN_IMMUNITY
#define DEAD_BUILD ADMIN_IMMUNITY
#define REMOVE_BLOCK ADMIN_IMMUNITY
#define DEAD_REMOVE ADMIN_IMMUNITY
#define LOCK_BLOCKS ADMIN_LEVEL_E
#define PAIN_SHOCK_FREE ADMIN_IMMUNITY
#define BAD_SPAWN ADMIN_KICK
#define BUILD_BAN ADMIN_KICK
#define REVIVE ADMIN_IMMUNITY
#define SWAP ADMIN_KICK
#define START_ROUND ADMIN_BAN
#define RESET ADMIN_BAN
#define MEMBERSHIP ADMIN_LEVEL_E
#define ADMIN_GUNS ADMIN_IMMUNITY
#define ADMIN_RESET ADMIN_IMMUNITY

#define BUILD_TASK 10000
#define MODELSET_TASK 20000

#define MAX_PLAYERS 32
#define AMMO_SLOT 376
#define MODELCHANGE_DELAY 0.5
#define MAXENTS 1365
#define AUTO_TEAM_JOIN_DELAY 0.1
#define TEAM_SELECT_VGUI_MENU_ID 2

#if cellbits == 32
    #define OFFSET_BUYZONE 235
#else
    #define OFFSET_BUYZONE 268
#endif

#define LockBlock(%1)     ( entity_set_int( %1, EV_INT_iuser1, 1 ) )
#define UnlockBlock(%1)   ( entity_set_int( %1, EV_INT_iuser1, 0 ) )
#define IsBlockLocked(%1) ( entity_get_int( %1, EV_INT_iuser1 ) == 1 )

// CS Weapon CBase Offsets (win32)
const OFFSET_WEAPONOWNER 41
// Linux diff's
const OFFSET_LINUX_WEAPONS 4

new gmsgStatusTextgmsgSayText
new gHudSyncInfog_MaxPlayersg_ModName[32]
const 
fPainShock 108

new bool:g_CanBuildbool:g_ZombiesReleased
new g_RoundNumcount_downg_iEntBarrier
new bool:g_BuildBan[MAX_PLAYERS+1]
new 
g_pEnt[MAX_PLAYERS+1], Float:g_pDist[MAX_PLAYERS+1], bool:g_MovingEnt[MAXENTS], g_EntMover[MAXENTS],
    
g_LastMover[MAXENTS], g_EntOwner[MAXENTS], bool:g_InvisEnt[MAXENTS], g_OwnedEnts[MAX_PLAYERS+1]
new 
CsTeams:g_pTeam[MAX_PLAYERS+1], CsTeams:g_pCurTeam[MAX_PLAYERS+1]
new 
g_CurrentWeapon[MAX_PLAYERS+1], g_PrimaryWeapon[MAX_PLAYERS+1], Float:MaxHP[MAX_PLAYERS+1]

//Cached Stuff for Players
new g_isconnected[MAX_PLAYERS+1], g_isalive[MAX_PLAYERS+1], g_isbot[MAX_PLAYERS+1],
    
g_iszombie[MAX_PLAYERS+1], g_friend[MAX_PLAYERS+1]

//Custom Model Stuff
new Float:g_ModelsTargetTimeFloat:g_RoundStartTime
new g_HasCustomModel[MAX_PLAYERS+1], g_PlayerModel[MAX_PLAYERS+1][32]

// Allowed weapons for zombies
const ZOMBIE_ALLOWED_WEAPONS_BITSUM = (1<<CSW_KNIFE)

//CVARS
new g_pcvar_buildtimeg_pcvar_zombiehpg_pcvar_maxroundsg_pcvar_basecalcg_pcvar_resetent,
    
g_pcvar_showmoversg_pcvar_knockbackg_pcvar_allowedwepsg_pcvar_givenades,
    
g_pcvar_entmindistg_pcvar_entsetdistg_pcvar_entmaxdistg_pcvar_maxclaimable,
    
g_pcvar_claimableg_pcvar_zresptime

new g_fwRoundStartg_fwGrabEntg_fwDropEntg_fwNewGameStartg_fwGameStartg_fwSwapTeams
new g_fwiFakeReturn
    
//CSDM-Style Weapons Menu
new bool:firsttime[MAX_PLAYERS+1]
new 
weapon_picked[2][MAX_PLAYERS+1],cur_offset[MAX_PLAYERS+1],options_on_menu[8][MAX_PLAYERS+1]

//Weapon Names (For Guns Menu)
static const WEAPONNAMES[24][23] = { "Schmidt Scout""XM1014 M4""Ingram MAC-10""Steyr AUG A1""UMP 45""SG-550 Auto-Sniper",
            
"IMI Galil""Famas""AWP Magnum Sniper""MP5 Navy""M249 Para Machinegun""M3 Super 90""M4A1 Carbine",
            
"Schmidt TMP""G3SG1 Auto-Sniper""SG-552 Commando""AK-47 Kalashnikov""ES P90""P228 Compact",
            
"Dual Elite Berettas""Fiveseven""USP .45 ACP Tactical""Glock 18C""Desert Eagle .50 AE"
}

// Weapon entity names
new const WEAPONENTNAMES[][] = { """weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10",
            
"weapon_aug""weapon_smokegrenade""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
            
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
            
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552",
            
"weapon_ak47""weapon_knife""weapon_p90" }

public 
plugin_init()
{
    
register_plugin("Base Builder Zombie Mod"VERSION"Tirant")
    
register_cvar("base_builder"VERSIONFCVAR_SPONLY|FCVAR_SERVER)
    
set_cvar_string("base_builder"VERSION)
    
    
//Basic mod functions/timers
    
g_pcvar_buildtime register_cvar("bb_build_time""210.0")
    
g_pcvar_zombiehp register_cvar("bb_zombie_health""3000.0")
    
g_pcvar_basecalc register_cvar("bb_calc_maxbase""0")
    
g_pcvar_showmovers register_cvar("bb_show_moving""1")
    
g_pcvar_knockback register_cvar("bb_pain_shock_free""1")
    
g_pcvar_entmaxdist register_cvar("bb_max_move_dist""1000")
    
g_pcvar_entmindist register_cvar("bb_min_move_dist""25")
    
g_pcvar_entsetdist register_cvar("bb_min_dist_set""50")
    
g_pcvar_resetent register_cvar("bb_reset_blocks""1")
    
g_pcvar_maxclaimable register_cvar("bb_claim_max""900")
    
g_pcvar_claimable register_cvar("bb_claim_mode""1")
    
g_pcvar_zresptime register_cvar("bb_zombie_respawn_time""1.0")
    
    
//Guns Menu
    
g_pcvar_givenades register_cvar("bb_give_nades","hfs")     //h f s, put multiple letters for multiple nades
    
g_pcvar_allowedweps register_cvar("bb_weapons","abcdefghijlmnopqrstuvwx")
    
    
register_dictionary("basebuilder.txt");
    
    
//Client Commands
    
register_clcmd("+grab","cmdMoveEnt")                             //command to move stuff around
    
register_clcmd("-grab","cmdStopEnt")                             //command to move stuff around
    
    
register_clcmd("say""cmdSay",0"<target> ")
    
register_clcmd("say_team""cmdSay",0"<target> ")

    
//Admin Commands
    
register_concmd("removeaim","cmdRemoveEnt",0," - Deletes an object")             //Removes an object (C alive, D dead)
    
register_concmd("lockaim","cmdLockBlock",0," - Locks/Unlocks an object form moving")
    
register_concmd("unclaimaim","cmdRemoveClaim",0," - Removes a claim on an object")    //Makes block claimable by everyone
    
register_concmd("resetaim","cmdResetAim",0," - Resets an object")
    
register_concmd("say /remove","cmdRemoveEnt",0," - Deletes an object")             //Removes an object (C alive, D dead)
    
register_concmd("say /lock","cmdLockBlock",0," - Locks/Unlocks an object form moving")
    
register_concmd("say /removeaim","cmdRemoveEnt",0," - Deletes an object")             //Removes an object (C alive, D dead)
    
register_concmd("say /lock","cmdLockBlock",0," - Locks/Unlocks an object form moving")
    
register_concmd("say /unclaimaim","cmdRemoveClaim",0," - Removes a claim on an object")    //Makes block claimable by everyone
    
register_concmd("say /resetaim","cmdResetAim",0," - Resets an object")
    
    
register_concmd("bb_buildban","cmdBuildBan",0,"<player>")                 //Bans targeted player from building
    
register_concmd("bb_unbuildban","cmdBuildUnban",0,"<player>")                 //Unbans   "       "     "     "
    
register_concmd("bb_revive","cmdRevive",0,"<player>")
    
register_concmd("bb_guns","cmdGiveGuns",0,"<player>")                    //revives targetted player
    
register_concmd("bb_swap","cmdSwap",0,"<player>")                    //swaps the selected player to the opposite team
    
register_concmd("bb_startround","cmdStartRound",0," - Ends the build phase")        //do i really have to explain this?
    
register_concmd("bb_reset","cmdResetEnts",0," - Resets all entities")
    
register_concmd("bb_clear","cmdClearEnts",0," - Deleted all unused entities")
    
register_concmd("say /buildban","cmdBuildBan",0,"<player>")                 //Bans targeted player from building
    
register_concmd("say /unbuildban","cmdBuildUnban",0,"<player>")                 //Unbans   "       "     "     "
    
register_concmd("say /revive","cmdRevive",0,"<player>")
    
register_concmd("say /guns","cmdGiveGuns",0,"<player>")                    //revives targetted player
    
register_concmd("say /swap","cmdSwap",0,"<player>")                    //swaps the selected player to the opposite team
    
register_concmd("say /start","cmdStartRound",0," - Ends the build phase")        //do i really have to explain this?
    
register_concmd("say /reset","cmdResetEnts",0," - Resets all entities")
    
register_concmd("say /clear","cmdClearEnts",0," - Deleted all unused entities")

    
    
//Blocked Commands
    
register_clcmd("drop""clcmd_drop")
    
register_clcmd("buy""clcmd_buy")
    
    
register_forward(FM_GetGameDescription"fw_GetGameDescription")
    
register_forward(FM_SetClientKeyValue"fw_SetClientKeyValue")
    
register_forward(FM_ClientUserInfoChanged"fw_ClientUserInfoChanged")
    
register_forward(FM_PlayerPreThink"fw_Player_PreThink")
    if (
get_pcvar_num(g_pcvar_showmovers) == 1)
        
register_forward(FM_TraceLine"fw_Traceline")
    
    
RegisterHam(Ham_Touch"weapon_shield""ham_WeaponCleaner_Post"1)
    
RegisterHam(Ham_Touch"weaponbox""ham_WeaponCleaner_Post"1)
    
RegisterHam(Ham_Spawn"player""ham_PlayerSpawn_Post"1)
    
RegisterHam(Ham_TakeDamage"player""ham_TakeDamage")
    
RegisterHam(Ham_TakeDamage"player""ham_TakeDamage_Post"1)
    for (new 
1sizeof WEAPONENTNAMESi++)
        if (
WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "ham_ItemDeploy_Post"1)
    
    
register_message(get_user_msgid("TextMsg"), "msgRoundEnd")
    
register_message(get_user_msgid("StatusIcon"), "msgStatusIcon")
    
register_message(get_user_msgid("StatusValue"), "msgStatusValue");
    
register_message(get_user_msgid("Health"), "msgHealth");
    
register_message(get_user_msgid("ScoreAttrib"), "msgScoreAttrib")
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_event("AmmoX""ev_AmmoX""be""1=1""1=2""1=3""1=4""1=5""1=6""1=7""1=8""1=9""1=10")
    
register_event("StatusValue""ev_SetTeam""be""1=1");
    
register_event("StatusValue""ev_ShowStatus""be""1=2""2!0");
    
register_event("StatusValue""ev_HideStatus""be""1=1""2=0");
    
register_event("Health""ev_Health""be""1>0");
    
    
register_logevent("logevent_round_start",2"1=Round_Start")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
register_menucmd(register_menuid("WeaponMethodMenu"),(1<<0)|(1<<1)|(1<<2),"weapon_method_pushed")
    
register_menucmd(register_menuid("PrimaryWeaponSelect"),(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9),"prim_weapons_pushed")
    
register_menucmd(register_menuid("SecWeaponSelect"),(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7),"sec_weapons_pushed")
    
    
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET)
    
    
//Formats the Mod Name
    
formatex(g_ModNamecharsmax(g_ModName), "Base Builder %s"VERSION)
    
    
gmsgSayText get_user_msgid("SayText")
    
gmsgStatusText get_user_msgid("StatusText");
    
gHudSyncInfo CreateHudSyncObj();
    
g_MaxPlayers get_maxplayers();

    
g_fwNewGameStart CreateMultiForward("bb_new_round",ET_IGNORE)
    
g_fwGameStart CreateMultiForward("bb_timer_started",ET_IGNORE)
    
g_fwRoundStart CreateMultiForward("bb_zombies_released",ET_IGNORE)
    
g_fwSwapTeams CreateMultiForward("bb_teams_swapped",ET_IGNORE)
    
g_fwGrabEnt CreateMultiForward("bb_ent_grabbed",ET_IGNOREFP_CELLFP_CELL)
    
g_fwDropEnt CreateMultiForward("bb_ent_dropped",ET_IGNOREFP_CELLFP_CELL)
    
    
server_cmd("sv_skyname vr_")
    
server_cmd("mp_freezetime 0")
    
server_cmd("mp_flashlight 0")

    
register_clcmd("chooseteam""clcmd_changeteam")
    
register_clcmd("jointeam""clcmd_changeteam")
    
register_message(get_user_msgid("ShowMenu"), "message_show_menu")
    
register_message(get_user_msgid("VGUIMenu"), "message_vgui_menu")
    
server_cmd("mp_limitteams 1")
    
server_cmd("mp_autoteambalance 1")

    
g_iEntBarrier find_ent_by_tname( -1"barrier" );
}

public 
plugin_precache()
{
    
engfunc(EngFunc_PrecacheSoundg_RoundStart)
    
engfunc(EngFunc_PrecacheSoundg_ZombKill1)
    
engfunc(EngFunc_PrecacheSoundg_WinZomb)
    
engfunc(EngFunc_PrecacheSoundg_WinHum)
    
    new 
szModel[64];
    
formatex(szModelcharsmax(szModel), "models/player/%s/%s.mdl"g_ZombieModel1g_ZombieModel1 );
    
engfunc(EngFunc_PrecacheModelszModel)
    
    new 
iBomb create_entity("info_bomb_target");
    
entity_set_origin(iBombFloat:{8192.0,8192.0,8192.0})
    
    new 
iBuyZone create_entity("info_map_parameters");
    
DispatchKeyValue(iBuyZone"buying""3");
    
DispatchSpawn(iBuyZone);
    
    
g_pcvar_maxrounds get_cvar_num("mp_maxrounds")
}

// Event Round Start (This is before freeze time)
public event_round_start()
{
    
arrayset(g_MovingEntfalseMAXENTS)
    
arrayset(g_EntOwner0MAXENTS)
    
arrayset(g_LastMover0MAXENTS)
    
arrayset(g_OwnedEnts0MAX_PLAYERS+1)
    
    
g_RoundStartTime get_gametime()
    
g_ZombiesReleased false
    
    
if (get_pcvar_num(g_pcvar_resetent) == 1)
    {
        new 
cname[10], tname[7];
        for (new 
iEnt g_MaxPlayers+1iEnt MAXENTSiEnt++)
        {
            if (
is_valid_ent(iEnt))
            {
                
entity_get_string(iEntEV_SZ_classnamecname9);
                
entity_get_string(iEntEV_SZ_targetnametname6);
                if (!
IsBlockLocked(iEnt) && iEnt != g_iEntBarrier && equal(cname"func_wall") && !equal(tname"ignore"))
                {
                    if (
g_InvisEnt[iEnt])
                    {
                        
set_pev(iEnt,pev_solid,SOLID_BSP)
                        
set_pev(iEnt,pev_renderamt,Float:{0.0200.00.0})
                        
set_pev(iEnt,pev_rendermode,0)
                        
g_InvisEnt[iEnt] = false
                    
}
                    
engfuncEngFunc_SetOriginiEntFloat:{ 0.00.00.0 } );
                }
            }
        }
    }
    
ExecuteForward(g_fwNewGameStartg_fwiFakeReturn)
}

// Log Event Round Start (This is AFTER freeze time)
public logevent_round_start()
{
    
g_CanBuild true
    
    set_pev
(g_iEntBarrier,pev_solid,SOLID_BSP)
    
set_pev(g_iEntBarrier,pev_rendermode,1)
    
set_pev(g_iEntBarrier,pev_renderamt,Float:{0.0200.00.0})
    
    
    
print_color(0"%s Round: %d of %d"formatmodname, (g_RoundNum+1), g_pcvar_maxrounds)
    
print_color(0"This server is running ^x04Base Builder 8.2^x01 by ^x04GaBy^x01");
    
    
remove_task(BUILD_TASK)
    
    
set_task(1.0"CountDown"BUILD_TASK,__"a"get_pcvar_num(g_pcvar_buildtime));
    
count_down = (get_pcvar_num(g_pcvar_buildtime)-1);
    
    if (
get_pcvar_num(g_pcvar_basecalc) == 1)
        
set_task(5.0"Base_Calc")
    
    
ExecuteForward(g_fwGameStartg_fwiFakeReturn)
}

public 
CountDown()
{
    
count_down--
    new 
mins count_down/60
    
new secs count_down%60
    
if (count_down>=0)
    {
        
set_hudmessage(02000, -1.00.016.012.0)
        
show_hudmessage(0".:: Timp de constructie - %d:%s%d ::."mins, (secs 10 "0" ""), secs)
    }
    
    if (
mins != && secs == 0)
    {
        new 
mmin[32]
        
num_to_word(minsmmin31)
        
        
client_cmd(0"spk ^"fvox/%s minutes remaining^""mmin)
    }
    else if (
mins == && secs == 30)
    {
        new 
msec[32]
        
num_to_word(secsmsec31)

        
client_cmd(0"spk ^"fvox/%s seconds remaining^"",  msec)
    }
    if (
0<count_down<=10)
    {
        new 
msec[32]
        
num_to_word(count_downmsec31)
        
        
client_cmd(0"spk ^"fvox/%s^""msec)
    }
        
    if (
count_down == 0)
    {
        
Release_Zombies()
        
remove_task(BUILD_TASK);
    }
}

public 
logevent_round_end()
{
    if (!
g_CanBuild)
    {
        new 
players[32], numplayer
        get_players
(playersnum)
        for (new 
0numi++)
        {
            
player players[i]
            
            if (
g_pCurTeam[player] == g_pTeam[player])
                
cs_set_user_team(player, (g_pTeam[player] = (g_pTeam[player] == CS_TEAM_T CS_TEAM_CT CS_TEAM_T))) 
            else
                
g_pTeam[player] = g_pTeam[player] == CS_TEAM_T CS_TEAM_CT CS_TEAM_T
        
}
        
print_color(0"^x04%L"LANG_SERVER"TEAMS_SWAPPED")
        
ExecuteForward(g_fwSwapTeamsg_fwiFakeReturn)
    }
    
    
remove_task(BUILD_TASK)
        
    return 
PLUGIN_HANDLED
}

public 
client_death(g_attackerg_victimwpnindexhitplaceTK)
{
    if (
g_pEnt[g_victim])
        
cmdStopEnt(g_victim)
        
    
set_hudmessage(__________4);
    
show_hudmessage(g_victim"");
    
    
g_isalive[g_victim] = false
    
    
if (TK == && g_attacker != g_victim)
    {
        if (
g_iszombie[g_attacker])
        {
            
client_cmd(0"spk %s"g_ZombKill1)
            new 
playername[35]
            
get_user_name(g_victimplayername34)
            
set_hudmessage(02000, -1.00.4501.05.00.10.21)
            
show_hudmessage(0"%L",LANG_SERVER"DEAD_ANNOUNCE"playername);
        }
    }
    
    if (
g_iszombie[g_victim])
    {
        
set_hudmessage(02000, -1.00.4501.010.00.10.21)
        
show_hudmessage(g_victim"%L"LANG_SERVER"DEAD_ZOMBIE"get_pcvar_num(g_pcvar_zresptime));
        
set_task(get_pcvar_float(g_pcvar_zresptime), "Respawn_Zombie"g_victim)
    }
    if (!
g_iszombie[g_victim])
    {
        
set_hudmessage(02000, -1.00.4501.010.00.10.21)
        
show_hudmessage(g_victim"%L"LANG_SERVER"DEAD_SURVIVOR");
        
cs_set_user_team(g_victimcs_get_user_team(g_victim) == CS_TEAM_T CS_TEAM_CT:CS_TEAM_T)
        
g_iszombie[g_victim] = true
        set_task
(5.0"Respawn_Zombie"g_victim)
    }
}

public 
ham_TakeDamage_Post(victiminflictorattackerFloat:damagebits)
{
    if(
get_pcvar_num(g_pcvar_knockback) == && access(victimPAIN_SHOCK_FREE) && g_iszombie[victim])
    {
        
set_pdata_float(victimfPainShock1.05)
    }
}

public 
ham_TakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    if (!
g_isalive[victim] || !g_isconnected[attacker]) return HAM_IGNORED
    
    
if(g_CanBuild || victim == attacker)
        return 
HAM_SUPERCEDE
        
    
return HAM_HANDLED
}

public 
client_disconnect(id)
{
    
cmdStopEnt(id)

    
g_isconnected[id] = false
    g_isalive
[id] = false
    g_isbot
[id] = false
    g_iszombie
[id] = false
    
    
return PLUGIN_CONTINUE
}

//Respawns late joiners, cts only if build time is still on
public client_putinserver(id)
{
    
set_task(7.0,"Respawn_Human",id);
    
g_isconnected[id] = true
    firsttime
[id] = true

    
// Set bot flag
    
if (is_user_bot(id))
        
g_isbot[id] = true
}

public 
Release_Zombies()
{
    
g_CanBuild false
    g_ZombiesReleased 
true
    remove_task
(BUILD_TASK);
    
    new 
weapon[32]
    new 
heflashsmoke
    get_pcvar_string
(g_pcvar_givenades,weapon,31)
    for(new 
i=0;i<strlen(weapon);i++)
    {
        switch(
weapon[i])
        {
            case 
'h'he++
            case 
'f'flash++
            case 
's'smoke++
        }
    }
    
    new 
players[32], num
    get_players
(playersnum)

    new 
player
    
for(new 0numi++)
    {
        
player players[i]
        if (
g_isalive[player])
        {
            if (!
g_iszombie[player])
            {
                
cmdStopEnt(player)

                if(
hegive_item(player,"weapon_hegrenade"), cs_set_user_bpammo(player,CSW_HEGRENADE,he)
                if(
flashgive_item(player,"weapon_flashbang"), cs_set_user_bpammo(player,CSW_FLASHBANG,flash)
                if(
smokegive_item(player,"weapon_smokegrenade"), cs_set_user_bpammo(player,CSW_SMOKEGRENADE,smoke)

                if (
g_PrimaryWeapon[player])
                {
                    
get_weaponname(g_PrimaryWeapon[player],weapon,31)
                    
engclient_cmd(playerweapon);
                }
            }
        }
    }
            
    
set_pev(g_iEntBarrier,pev_solid,SOLID_NOT)
    
set_pev(g_iEntBarrier,pev_renderamt,Float:{0.0200.00.0})
    
    
g_RoundNum++
    
set_hudmessage(02000, -1.00.4501.010.00.10.21)
    
show_hudmessage(0"%L"LANG_SERVER"RELEASE_MSG");
    
client_cmd(0"spk %s"g_RoundStart)
    
    
ExecuteForward(g_fwRoundStart,g_fwiFakeReturn)
}

//Called on zombie death function
public Respawn_Zombie(id)
{
    if (
g_isconnected[id] && cs_get_user_team(id) == CS_TEAM_T)
    {
        if (
get_user_health(id) ==MaxHP[id] || !is_user_alive(id))
            
ExecuteHamB(Ham_CS_RoundRespawnid)
        else
            
client_print(idprint_center"%L"LANG_SERVER"FAIL_RESPAWN");
    }
}

//Called on al pllayers for late joiners, parent is above
public Respawn_Human(id)
{
    if (!
g_isconnected[id] || g_isalive[id] || cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
        return 
PLUGIN_HANDLED
        
    
if (!g_isalive[id] && g_iszombie[id])
        
ExecuteHamB(Ham_CS_RoundRespawnid)
                
    if (!
g_isalive[id] && g_iszombie[id])
        
set_task(3.0,"Respawn_Human",id)
            
    if (
g_CanBuild)
    {
        if (!
g_isalive[id])
            
ExecuteHamB(Ham_CS_RoundRespawnid)
                
        if (!
g_isalive[id])
            
set_task(3.0,"Respawn_Human",id)
    }
    return 
PLUGIN_HANDLED
}

//Sets player health and weapons
public Add_Effects(id)
{
    if (!
g_isconnected[id] || !g_isalive[id])
        return 
PLUGIN_HANDLED
    
    strip_user_weapons
(id)
    
give_item(id"weapon_knife")
    
    if (
g_iszombie[id])
    {
        
MaxHP[id] = get_pcvar_float(g_pcvar_zombiehp)
        
set_pev(idpev_healthMaxHP[id]) // use decimal number
    
}
    else
    {
        
weapon_method_menu(id)
        
MaxHP[id] = 100.0
    
}
    
ev_Health(id)
    return 
PLUGIN_HANDLED
}

//AmmoX Ensures BackPack ammo is always full
public ev_AmmoX(id)
{
    
set_pdata_int(idAMMO_SLOT read_data(1), 2005)


//Sets the "Game" description ie. Counter-Strike, in our case Base Builder
public fw_GetGameDescription()
{
    
// Return the mod name so it can be easily identified
    
forward_return(FMV_STRINGg_ModName)
    
    return 
FMRES_SUPERCEDE;
}

/*-------------------------------------------------------------------------------------------------|
|----------------------------------Begin Player Model Code---[0005]--------------------------------|
|-------------------------------------------------------------------------------------------------*/

public ham_PlayerSpawn_Post(id)
{
    if (!
is_user_alive(id))
        return
    
    
g_isalive[id] = true
    g_pCurTeam
[id] = cs_get_user_team(id)
    
g_iszombie[id] = g_pCurTeam[id] == CS_TEAM_T true false
    
    Add_Effects
(id)
    
remove_task(id MODELSET_TASK)
    if (
g_iszombie[id])
    {
        
copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_ZombieModel1)
        new 
currentmodel[32]
        
fm_get_user_model(idcurrentmodelcharsmax(currentmodel))
        if (!
equal(currentmodelg_PlayerModel[id]))
        {
            if (
get_gametime() - g_RoundStartTime 5.0)
                
set_task(5.0 MODELCHANGE_DELAY"fm_user_model_update"id MODELSET_TASK)
            else
                
fm_user_model_update(id MODELSET_TASK)
        }
    }
    else if (
g_HasCustomModel[id])
    {
        
fm_reset_user_model(id)
    }
}

public 
fw_SetClientKeyValue(id, const infobuffer[], const key[])
{   
    if (
g_HasCustomModel[id] && equal(key"model"))
        return 
FMRES_SUPERCEDE
    
return FMRES_IGNORED
}

public 
fw_ClientUserInfoChanged(id)
{
    if (!
g_HasCustomModel[id])
        return 
FMRES_IGNORED
    
static currentmodel[32]
    
fm_get_user_model(idcurrentmodelcharsmax(currentmodel))
    if (!
equal(currentmodelg_PlayerModel[id]) && !task_exists(id MODELSET_TASK))
        
fm_set_user_model(id MODELSET_TASK)
    return 
FMRES_IGNORED
}

public 
fm_user_model_update(taskid)
{
    static 
Float:current_time
    current_time 
get_gametime()
    
    if (
current_time g_ModelsTargetTime >= MODELCHANGE_DELAY)
    {
        
fm_set_user_model(taskid)
        
g_ModelsTargetTime current_time
    
}
    else
    {
        
set_task((g_ModelsTargetTime MODELCHANGE_DELAY) - current_time"fm_set_user_model"taskid)
        
g_ModelsTargetTime g_ModelsTargetTime MODELCHANGE_DELAY
    
}
}

public 
fm_set_user_model(player)
{
    
player -= MODELSET_TASK
    engfunc
(EngFunc_SetClientKeyValueplayerengfunc(EngFunc_GetInfoKeyBufferplayer), "model"g_PlayerModel[player])
    
g_HasCustomModel[player] = true
}

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

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

/*-------------------------------------------------------------------------------------------------|
|------------------------------------End Player Model Code-----------------------------------------|
|-------------------------------------------------------------------------------------------------*/

/*-------------------------------------------------------------------------------------------------|
|----------------------------------Begin Entity Mover Code---[0004]--------------------------------|
|-------------------------------------------------------------------------------------------------*/
public cmdMoveEnt(id)
{
    if (
g_BuildBan[id] == true)
        return 
PLUGIN_HANDLED
    
    
if (g_iszombie[id] && !access(idAFTER_BUILD))
              return 
PLUGIN_HANDLED 
            
    
if (!g_CanBuild && !access(idAFTER_BUILD))
    {
        
client_print (idprint_center"%L"LANG_SERVER"FAIL_TIME_UP")
        return 
PLUGIN_HANDLED 
    
}
    
    if (!
g_isalive[id] && !access(idDEAD_BUILD))
    {
        
client_print (idprint_center"%L"LANG_SERVER"FAIL_DEAD")
        return 
PLUGIN_HANDLED 
    
}

    if (
g_pEnt[id] && is_valid_ent(g_pEnt[id])) 
        
cmdStopEnt(id)
    
    new 
entbodypart
    get_user_aiming 
(id,ent,bodypart)
    
    if (!
is_valid_ent(ent) || ent == g_iEntBarrier)
    {
        return 
PLUGIN_HANDLED
    
}
    
    if (
ent <= g_MaxPlayers && g_isalive[ent])
    {    
        return 
PLUGIN_HANDLED
    
}
        
    if (
IsBlockLocked(ent) || g_MovingEnt[ent])
    {
        return 
PLUGIN_HANDLED
    
}

    if (
get_pcvar_num(g_pcvar_claimable) == 1)
    {
        if (!
g_EntOwner[ent])
        {
            if ((
g_OwnedEnts[id]<get_pcvar_num(g_pcvar_maxclaimable)) || get_pcvar_num(g_pcvar_maxclaimable) == 0)
            {
                
g_EntOwner[ent] = id
                g_OwnedEnts
[id]++
            }
            else
            {
                
client_print (idprint_center"%L"LANG_SERVER"FAIL_MAXOWNED"get_pcvar_num(g_pcvar_maxclaimable))
            }
        }
        else if (
g_EntOwner[ent] != id && !access(idAFTER_BUILD))
        {
            
client_print (idprint_center"%L"LANG_SERVER"FAIL_ALREADYOWNED")
            return 
PLUGIN_HANDLED 
        
}
    }
    
    new 
tname[7], cname[10];
    
entity_get_string(entEV_SZ_targetnametname6);
    
entity_get_string(entEV_SZ_classnamecname9);
    if (!
equal(cname"func_wall") || equal(tname"ignore"))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
origin[3], Float:entOrigin[3], Float:orig[3], Float:mins[3], Float:maxs[3]
    
    
entity_get_vector(entEV_VEC_originorig);
    
entity_get_vector(entEV_VEC_minsmins);
    
entity_get_vector(entEV_VEC_maxsmaxs);

    
entOrigin[0] = (mins[0] + maxs[0]) / 2.0 orig[0];
    
entOrigin[1] = (mins[1] + maxs[1]) / 2.0 orig[1];
    
entOrigin[2] = (mins[2] + maxs[2]) / 2.0 orig[2];
    
    
get_user_origin(idorigin);
    
IVecFVec(originorig)

    
g_pDist[id] = get_distance_f(origentOrigin);
    
    if (
get_pcvar_num(g_pcvar_entmindist)) //maximum
    
{
        if (
g_pDist[id] < get_pcvar_float(g_pcvar_entmindist)) //minimum
            
g_pDist[id] = get_pcvar_float(g_pcvar_entsetdist);
        
/*if (g_pDist[id] < get_pcvar_float(g_pcvar_entminoffset))
        {
            g_pOffset[id][0] = orig[0] - entOrigin[0]
            g_pOffset[id][1] = orig[1] - entOrigin[1]
            g_pOffset[id][2] = orig[2] - entOrigin[2]
        }*/
    
}

    if (
get_pcvar_num(g_pcvar_entmaxdist)) //maximum
    
{
        if (
g_pDist[id] > get_pcvar_float(g_pcvar_entmaxdist))
            return 
PLUGIN_HANDLED
    
}
    
    
//set_pev(ent,pev_solid, SOLID_NOT)
    
set_pev(ent,pev_rendermode,1)
    
set_pev(ent,pev_renderamt,Float:{100.0})
    
set_pev(ent,pev_rendercolor,Float:{0.0200.00.0})

    
g_MovingEnt[ent] = true
    g_EntMover
[ent] = id
    g_pEnt
[id] = ent

    ExecuteForward
(g_fwGrabEnt,g_fwiFakeReturnident)
    
    if (!
g_CanBuild && access(idAFTER_BUILD))
    {
        new 
adminauthid[35],adminname[35]
        
get_user_authid (id,adminauthid,34)
        
get_user_name(id,adminname,34)
        
Log("[BaseBuilder 8.2] Admin: %s || SteamID: %s moved an entity"adminnameadminauthid)
    }
    
    return 
PLUGIN_HANDLED
}

public 
fw_Player_PreThink(id)
{
    if (!
g_pEnt[id] || !is_valid_ent(g_pEnt[id]))
        return 
FMRES_HANDLED
        
    
new buttons pev(idpev_button)
    if (
buttons IN_ATTACK)
    {
        
g_pDist[id] += 3.0;
        
        if (
g_pDist[id] > get_pcvar_float(g_pcvar_entmaxdist))
        {
            
g_pDist[id] = get_pcvar_float(g_pcvar_entmaxdist)
            
client_print(idprint_center"%L"LANG_SERVER"OBJECT_MAX")
        }
        else
            
client_print(idprint_center"%L"LANG_SERVER"OBJECT_PUSH")
    }
    else if (
buttons IN_ATTACK2)
    {
        
g_pDist[id] -= 3.0;
            
        if (
g_pDist[id] < get_pcvar_float(g_pcvar_entsetdist))
        {
            
g_pDist[id] = get_pcvar_float(g_pcvar_entsetdist)
            
client_print(idprint_center"%L"LANG_SERVER"OBJECT_MIN")
        }
        else
            
client_print(idprint_center"%L"LANG_SERVER"OBJECT_PULL")
    }
    
    new 
origin[3], Float:aiming[3], Float:pOrigin[3], Float:mins[3], Float:maxs[3], Float:neworigin[3]
    
    if (!
g_isconnected[id] || (g_pEnt[id] <= g_MaxPlayers)? !g_isconnected[id]:!is_valid_ent(g_pEnt[id]))
    {
        
cmdStopEnt(id)
        return 
PLUGIN_HANDLED
    
}
    
    
entity_get_vector(g_pEnt[id], EV_VEC_minsmins);
    
entity_get_vector(g_pEnt[id], EV_VEC_maxsmaxs);
    
    
get_user_origin(idorigin3);
    
IVecFVec(originaiming);
    
get_user_origin(idorigin);
    
IVecFVec(originpOrigin);
    
    
aiming[0] -= pOrigin[0];
    
aiming[1] -= pOrigin[1];
    
aiming[2] -= pOrigin[2];

    new 
Float:scalar g_pDist[id] / vector_length(aiming);
    
    
IVecFVec(originneworigin);

    
neworigin[0] += aiming[0] * scalar - (mins[0] + maxs[0]) / 2.0;
    
neworigin[1] += aiming[1] * scalar - (mins[1] + maxs[1]) / 2.0;
    
neworigin[2] += aiming[2] * scalar - (mins[2] + maxs[2]) / 2.0;
        
    
entity_set_origin(g_pEnt[id], neworigin);
    
    return 
FMRES_HANDLED
}

public 
cmdStopEnt(id)
{
    new 
ent g_pEnt[id]
    
g_MovingEnt[ent] = false
    
//set_pev(ent,pev_solid, SOLID_BSP)
    
set_pev(ent,pev_rendermode,0)
    
set_pev(ent,pev_renderamt,Float:{255.0})
    
set_pev(ent,pev_rendercolor,Float:{0.0200.00.0})

    
ExecuteForward(g_fwDropEnt,g_fwiFakeReturnident)
    
    
g_EntMover[ent] = 0
    g_LastMover
[ent] = id
    g_pEnt
[id] = 0
}

public 
fw_Traceline(Float:start[3], Float:end[3], conditionsidtrace)
{
    if (!
is_user_alive(id))  return PLUGIN_HANDLED
    
    
new ent get_tr2(traceTR_pHit)
    
    if (
is_valid_ent(ent))
    {
        new 
ent,body
        get_user_aiming
(id,ent,body)
        
        new 
cname[10], tname[7];
        
entity_get_string(entEV_SZ_classnamecname9);
        
entity_get_string(entEV_SZ_targetnametname6);
        if (
equal(cname"func_wall") && !equal(tname"ignore") && ent != g_iEntBarrier && get_pcvar_num(g_pcvar_showmovers) == 1)
        {
            if (
g_CanBuild || access(idADMIN_KICK))
            {
                if (
IsBlockLocked(ent))
                {
                    
set_hudmessage(02000, -1.00.5510.013.00.010.01);
                    
ShowSyncHudMsg(idgHudSyncInfo"%L"LANG_SERVER"OBJECT_LOCKED");
                    return 
PLUGIN_HANDLED
                
}
                
set_hudmessage(02000, -1.00.5510.013.00.010.01);
                if (
get_pcvar_num(g_pcvar_claimable) == 0)
                {
                    new 
currentmover[35], lastmover[35]
                    if (
g_EntMover[ent])
                    {
                        
get_user_name(g_EntMover[ent],currentmover,34)
                        if (!
g_LastMover[ent]) ShowSyncHudMsg(idgHudSyncInfo"%L"LANG_SERVER"OBJECT_INFO1"currentmover);
                    }
                    if (
g_LastMover[ent])
                    {
                        
get_user_name(g_LastMover[ent],lastmover,34)
                        if (!
g_EntMover[ent]) ShowSyncHudMsg(idgHudSyncInfo"%L"LANG_SERVER"OBJECT_INFO2"lastmover);
                    }
                    if (
g_LastMover[ent] && g_EntMover[ent]) ShowSyncHudMsg(idgHudSyncInfo"%L"LANG_SERVER"OBJECT_INFO3"currentmoverlastmover);
                    else if (!
g_LastMover[ent] && !g_EntMover[ent]) ShowSyncHudMsg(idgHudSyncInfo"%L"LANG_SERVER"OBJECT_INFO4");
                }
                else
                {
                    if (
g_EntOwner[ent])
                    {
                        new 
entowner[35]
                        
get_user_name(g_EntOwner[ent],entowner,34)
                        
ShowSyncHudMsg(idgHudSyncInfo"%L"LANG_SERVER"OBJECT_OWNER"entowner);
                    }
                    else 
                    {
                        
ShowSyncHudMsg(idgHudSyncInfo"%L"LANG_SERVER"OBJECT_OWNER_NONE");
                    }
                }
            }
        }
    }
    else 
ClearSyncHud(idgHudSyncInfo);
    
    return 
PLUGIN_HANDLED
}

public 
cmdLockBlock(id)
{
    if (!
access(idLOCK_BLOCKS))
        return 
PLUGIN_HANDLED
        
    
new entbodypart
    get_user_aiming 
(id,ent,bodypart)
    
    new 
tname[7], cname[10];
    
entity_get_string(entEV_SZ_targetnametname6);
    
entity_get_string(entEV_SZ_classnamecname9);

    if (!
ent || !is_valid_ent(ent) || is_user_alive(ent) || ent == g_iEntBarrier || !equal(cname"func_wall") || equal(tname"ignore")) return PLUGIN_HANDLED
    
    
if (!IsBlockLocked(ent) && !g_MovingEnt[ent])
    {
        
LockBlock(ent)
        
set_pev(ent,pev_rendermode,1)
        
set_pev(ent,pev_rendercolor,Float:{0.00.0255.0})
        
        
g_OwnedEnts[g_EntOwner[ent]]--
        
g_EntOwner[ent] = 0
    
}
    else if (
IsBlockLocked(ent))
    {
        
UnlockBlock(ent)
        
set_pev(ent,pev_rendermode,0)
    }
    return 
PLUGIN_HANDLED
}

public 
cmdRemoveClaim(id)
{
    if (!
access(idLOCK_BLOCKS))
              return 
PLUGIN_HANDLED 
        
    
new entbodypart
    get_user_aiming 
(id,ent,bodypart)
    
    new 
tname[7], cname[10];
    
entity_get_string(entEV_SZ_targetnametname6);
    
entity_get_string(entEV_SZ_classnamecname9);

    if (!
ent || !is_valid_ent(ent) || is_user_alive(ent) || ent == g_iEntBarrier || !equal(cname"func_wall") || equal(tname"ignore") || IsBlockLocked(ent)) return PLUGIN_HANDLED

    g_OwnedEnts
[g_EntOwner[ent]]--
    
g_EntOwner[ent] = 0
    
    
return PLUGIN_HANDLED
}

public 
cmdRemoveEnt(id)
{
    if (!
access(idREMOVE_BLOCK))
              return 
PLUGIN_HANDLED 

    
if (!g_isalive[id] && !access(idDEAD_REMOVE))
    {
        
client_print (idprint_center"%L"LANG_SERVER"FAIL_REMOVE")
        return 
PLUGIN_HANDLED 
    
}
          
    new 
entbodypart
    get_user_aiming 
(id,ent,bodypart)
    
    if(!
is_valid_ent(ent) || ent == g_iEntBarrier || (ent <= g_MaxPlayers && g_isalive[ent]))
        return 
PLUGIN_HANDLED
    
    
if(IsBlockLocked(ent) || g_MovingEnt[ent])
        return 
PLUGIN_HANDLED

    
new tname[7], cname[10];
    
entity_get_string(entEV_SZ_targetnametname6);
    
entity_get_string(entEV_SZ_classnamecname9);
    if(!
equal(cname"func_wall"))
        return 
PLUGIN_HANDLED
    
    
if(equal(tname"ignore"))
        return 
PLUGIN_HANDLED
    
    g_OwnedEnts
[g_EntOwner[ent]]--
    
g_EntOwner[ent] = 0
    
    remove_entity
(ent)
    
    new 
adminauthid[35],adminname[35]
    
get_user_authid (id,adminauthid,34)
    
get_user_name(id,adminname,34)
    
Log("[BaseBuilder 8.2] Admin: %s || SteamID: %s removed an entity"adminnameadminauthid)
    
    return 
PLUGIN_HANDLED
}

public 
cmdResetEnts(id)
{
    if (!
access(idADMIN_RESET))
        return 
PLUGIN_HANDLED
    
    
new cname[10], tname[7];
    for (new 
iEnt g_MaxPlayers+1iEnt MAXENTSiEnt++)
    {
        if (
is_valid_ent(iEnt))
        {
            
entity_get_string(iEntEV_SZ_classnamecname9);
            
entity_get_string(iEntEV_SZ_targetnametname6);
            if (!
IsBlockLocked(iEnt) && iEnt != g_iEntBarrier && equal(cname"func_wall") && !equal(tname"ignore"))
                
engfuncEngFunc_SetOriginiEntFloat:{ 255.0255.0255.0 } );
        }
    }
    
    new 
adminauthid[35],adminname[35]
    
get_user_authid (id,adminauthid,34)
    
get_user_name(id,adminname,34)
    
Log("[CServers] Admin: %s || SteamID: %s reset the entities"adminnameadminauthid)
    
    return 
PLUGIN_HANDLED
}

public 
cmdResetAim(id)
{
    if (!
access(idADMIN_RESET))
              return 
PLUGIN_HANDLED 

    
new entbodypart
    get_user_aiming 
(id,ent,bodypart)
    
    if(!
is_valid_ent(ent) || ent == g_iEntBarrier || (ent <= g_MaxPlayers && g_isalive[ent]))
    {
        
client_print (idprint_center"%L"LANG_SERVER"FAIL_RESET")
        return 
PLUGIN_HANDLED
    
}
    
    if(
IsBlockLocked(ent) || g_MovingEnt[ent])
    {
        
client_print (idprint_center"%L"LANG_SERVER"FAIL_RESET")
        return 
PLUGIN_HANDLED
    
}

    new 
tname[7], cname[10];
    
entity_get_string(entEV_SZ_targetnametname6);
    
entity_get_string(entEV_SZ_classnamecname9);
    if(!
equal(cname"func_wall") || equal(tname"ignore"))
    {
        
client_print (idprint_center"%L"LANG_SERVER"FAIL_RESET")
        return 
PLUGIN_HANDLED
    
}
    
    
engfuncEngFunc_SetOriginentFloat:{ 0.00.00.0 } );
    
    new 
adminauthid[35],adminname[35], targetauthid[35],targetname[35]
    
get_user_authid (id,adminauthid,34)
    
get_user_name(id,adminname,34)
    
get_user_authid(g_EntOwner[ent],targetauthid,34)
    
get_user_name(g_EntOwner[ent],targetname,34)
    
Log("[BaseBuilder 8.2] Admin: %s || SteamID: %s reset a block belonging to Player: %s || SteamID: %s"adminnameadminauthidtargetauthidtargetname)
    
    
g_OwnedEnts[g_EntOwner[ent]]--
    
g_EntOwner[ent] = 0
    
    
return PLUGIN_HANDLED
}


public 
cmdClearEnts(id)
{
    if (!
access(idADMIN_RESET))
        return 
PLUGIN_HANDLED
    
    
new cname[10], tname[7];
    for (new 
iEnt g_MaxPlayers+1iEnt MAXENTSiEnt++)
    {
        if (
is_valid_ent(iEnt))
        {
            
entity_get_string(iEntEV_SZ_classnamecname9);
            
entity_get_string(iEntEV_SZ_targetnametname6);
            if (!
IsBlockLocked(iEnt) && iEnt != g_iEntBarrier && equal(cname"func_wall") && !equal(tname"ignore") && !g_LastMover[iEnt])
            {
                
set_pev(iEnt,pev_solid,SOLID_NOT)
                
set_pev(iEnt,pev_rendermode,1)
                
set_pev(iEnt,pev_renderamt,Float:{0.0})
                
g_InvisEnt[iEnt] = true
            
}
        }
    }
    
    new 
adminauthid[35],adminname[35]
    
get_user_authid (id,adminauthid,34)
    
get_user_name(id,adminname,34)
    
Log("[BaseBuilder 8.2] Admin: %s || SteamID: %s reset the entities"adminnameadminauthid)
    
    return 
PLUGIN_HANDLED
}

/*-------------------------------------------------------------------------------------------------|
|------------------------------------End Entity Mover Code-----------------------------------------|
|-------------------------------------------------------------------------------------------------*/

// Ham Weapon Deploy Forward (forces knife only)
public ham_ItemDeploy_Post(weapon_ent)
{
    static 
owner
    owner 
get_pdata_cbase(weapon_entOFFSET_WEAPONOWNEROFFSET_LINUX_WEAPONS);
    
    static 
weaponid
    weaponid 
cs_get_weapon_id(weapon_ent)
    
    
g_CurrentWeapon[owner] = weaponid
    
    
if (g_iszombie[owner] && !((1<<weaponid) & ZOMBIE_ALLOWED_WEAPONS_BITSUM))
    {
        
g_CurrentWeapon[owner] = CSW_KNIFE
        engclient_cmd
(owner"weapon_knife")
    }
    else if (
g_CanBuild && !g_iszombie[owner])
    {
        
g_CurrentWeapon[owner] = CSW_KNIFE
        engclient_cmd
(owner"weapon_knife")
        
client_print(ownerprint_center"%L"LANG_SERVER"FAIL_KNIFE_ONLY");
    }
}

public 
msgRoundEnd(const MsgId, const MsgDest, const MsgEntity)
{
    static 
Message[192]
    
get_msg_arg_string(2Message191)
    
    
set_hudmessage(02000, -1.00.4006.06.00.10.21)
    
    if(
equal(Message"#Game_bomb_drop"))
        return 
PLUGIN_HANDLED
    
    
if (equal(Message"#Terrorists_Win"))
    {
        
show_hudmessage(0"Zombii au cucerti lumea!")
        
set_msg_arg_string(2"")
        
client_cmd(0"spk %s"g_WinZomb)
    }
    else if (
equal(Message"#Target_Saved") || equal(Message"#CTs_Win"))
    {
        
show_hudmessage(0"Oameni au salvat lumea!")
        
set_msg_arg_string(2"")
        
client_cmd(0"spk %s"g_WinHum)
    }
    return 
PLUGIN_HANDLED
}

public 
ham_WeaponCleaner_Post(iEntity)
{
    
call_think(iEntity)
}

/*-------------------------------------------------------------------------------------------------|
|----------------------------Begin Auto Join on Connect Code----[0003]-----------------------------|
|-------------------------------------------------------------------------------------------------*/

public message_show_menu(msgiddestid
{
    if (!(!
get_user_team(id) && !g_isbot[id] && !access(idADMIN_IMMUNITY)))//
        
return PLUGIN_CONTINUE

    
static team_select[] = "#Team_Select"
    
static menu_text_code[sizeof team_select]
    
get_msg_arg_string(4menu_text_codesizeof menu_text_code 1)
    if (!
equal(menu_text_codeteam_select))
        return 
PLUGIN_CONTINUE

    
static param_menu_msgid[2]
    
param_menu_msgid[0] = msgid
    set_task
(AUTO_TEAM_JOIN_DELAY"task_force_team_join"idparam_menu_msgidsizeof param_menu_msgid)

    return 
PLUGIN_HANDLED
}

public 
message_vgui_menu(msgiddestid
{
    if (
get_msg_arg_int(1) != TEAM_SELECT_VGUI_MENU_ID || !(!get_user_team(id) && !g_isbot[id] && !access(idADMIN_IMMUNITY)))// 
        
return PLUGIN_CONTINUE
        
    
static param_menu_msgid[2]
    
param_menu_msgid[0] = msgid
    set_task
(AUTO_TEAM_JOIN_DELAY"task_force_team_join"idparam_menu_msgidsizeof param_menu_msgid)

    return 
PLUGIN_HANDLED
}

public 
task_force_team_join(menu_msgid[], id
{
    if (
get_user_team(id))
        return

    static 
msg_block
    msg_block 
get_msg_block(menu_msgid[0])
    
set_msg_block(menu_msgid[0], BLOCK_SET)
    
engclient_cmd(id"jointeam""5")
    
engclient_cmd(id"joinclass""5")
    
set_msg_block(menu_msgid[0], msg_block)
    
    
g_pTeam[id] = cs_get_user_team(id)
    
g_pCurTeam[id] = cs_get_user_team(id)
}

/*-------------------------------------------------------------------------------------------------|
|----------------------------End Auto Join on Connect Code-----------------------------------------|
|-------------------------------------------------------------------------------------------------*/

public clcmd_changeteam(id)
{
    if (!
access(idADMIN_IMMUNITY))
    {
        if (
g_iszombie[id])
            
client_print (idprint_center"%L"LANG_SERVER"FAIL_ZOMBIE")
        else if (
g_CanBuild
            
weapon_method_menu(id)
        else 
            
client_print (idprint_center"%L"LANG_SERVER"FAIL_WEAPONS")
            
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
clcmd_drop(id)
{
    
client_print (idprint_center"%L"LANG_SERVER"FAIL_DROP")
    return 
PLUGIN_HANDLED
}

public 
clcmd_buy(id)
{
    
client_print (idprint_center"%L"LANG_SERVER"FAIL_BUY")
    return 
PLUGIN_HANDLED
}

public 
Base_Calc()
{
    new 
players[32], numctbasenum
    get_players
(playersnum)
    new 
player
    
for(new 0numi++)
    {
        
player players[i]
        if (
cs_get_user_team(player) == CS_TEAM_CT)
            
ct++

        if (
ct 6)
            
basenum 2
        
else
            
basenum = (ct/3)
    }
    
print_color(0"%s %L"formatmodnameLANG_SERVER"BASE_CALC"basenum)
}

public 
Fix_Spawns()
{
    new 
players[32], num
    get_players
(playersnum)
            
    new 
player
    
for(new 0numi++)
    {
        
player players[i]
        if (
cs_get_user_team(player) == CS_TEAM_CT && !is_user_alive(player) && g_isconnected[player] && g_CanBuild)
            
ExecuteHamB(Ham_CS_RoundRespawnplayer)
    }
}

public 
msgScoreAttrib(msgiddestid)
{
    static 
attrib 
    attrib 
get_msg_arg_int(2)
    
    if(
attrib == (1<<1))
        
set_msg_arg_int(2ARG_BYTE0)
}

public 
msgStatusIcon(const iMsgId, const iMsgDest, const iPlayer)
{
    if(
g_isalive[iPlayer] && g_isconnected[iPlayer]) 
    {
        static 
szMsg[8]
        
get_msg_arg_string(2szMsg7)
    
            if (
szMsg[0] == 'c' && szMsg[1] == '4') return PLUGIN_HANDLED
        
else return PLUGIN_CONTINUE
    
        
if(equal(szMsg"buyzone"))
        {
            
set_pdata_int(iPlayerOFFSET_BUYZONEget_pdata_int(iPlayerOFFSET_BUYZONE) & ~(1<<0))
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE


/*public fw_CreateNamedEntity(entclassname)
{
    static classname[10]
    engfunc(EngFunc_SzFromIndex, entclassname, classname, 9)
    
    return (classname[7] == 'c' && classname[8] == '4') ? FMRES_SUPERCEDE : FMRES_IGNORED
}*/

public cmdBuildBan(id)
{
    if (
access(idBUILD_BAN))
    {
        new 
arg[32]
        
read_argv(1arg31)
        new 
player cmd_target(idargCMDTARGET_ALLOW_SELF)
        
g_BuildBan[player] = true
        cmdStopEnt
(player)
        
        new 
adminauthid[35],adminname[35],playername[35],playerauthid[35]
        
get_user_name(id,adminname,34)
        
get_user_authid (id,adminauthid,34)
        
get_user_name(playerplayername34)
        
get_user_authid (player,playerauthid,34)
        
Log("[BaseBuilder 8.2] Admin: %s || SteamID: %s banned Player: %s || SteamID: %s from building"adminnameadminauthidplayernameplayerauthid)
        
        
client_print(idprint_console"%L"LANG_SERVER"BUILD_BAN1"playername)
        
client_print(playerprint_center"%L"LANG_SERVER"BUILD_BAN2")
    }
}

public 
cmdBuildUnban(id)
{
    if (
access(idBUILD_BAN))
    {
        new 
arg[32], playername[35]
    
        
read_argv(1arg31)
        new 
player cmd_target(idargCMDTARGET_ALLOW_SELF)
        
get_user_name(playerplayername34)
        
client_print(idprint_console"%L"LANG_SERVER"UNBUILD_BAN1"playername)
        
g_BuildBan[player] = false
        print_color
(player"%s %L"formatmodnameLANG_SERVER"UNBUILD_BAN2")
    }
}

public 
cmdRevive(id)
{
    if (
access(idREVIVE))
    {
        new 
arg[32]
        
read_argv(1arg31)
        new 
player cmd_target(idargCMDTARGET_ALLOW_SELF)

        if (
is_user_alive(player))
        {
            
client_print(idprint_console"%L"LANG_SERVER"FAIL_REVIVE")
            return 
PLUGIN_HANDLED
        
}
        
        
ExecuteHamB(Ham_CS_RoundRespawnplayer)
        
        new 
adminauthid[35],adminname[35],playername[35],playerauthid[35]
        
get_user_name(id,adminname,34)
        
get_user_authid (id,adminauthid,34)
        
get_user_name(playerplayername34)
        
get_user_authid (player,playerauthid,34)
        
Log("[BaseBuilder 8.2] Admin: %s || SteamID: %s revived Player: %s || SteamID: %s"adminnameadminauthidplayernameplayerauthid)
        
        
client_print(idprint_console"%L"LANG_SERVER"REVIVE1"playername)
        
client_print(playerprint_center"%L"LANG_SERVER"REVIVE2")
    }
    return 
PLUGIN_HANDLED
}


public 
cmdGiveGuns(id)
{
    if (
access(idADMIN_GUNS))
    {
        new 
arg[32]
        
read_argv(1arg31)
        new 
player cmd_target(idargCMDTARGET_ALLOW_SELF)
        
        new 
playername[35]
        
get_user_name(playerplayername34)
        
        if (
g_isalive[player])
        {
            
weapon_method_menu(player)
            
            
client_print(idprint_console"%L"LANG_SERVER"GIVEGUNS1"playername)
            
client_print(playerprint_center"%L"LANG_SERVER"GIVEGUNS2")
        }
        else
        {
            
client_print(idprint_console"%L"LANG_SERVER"GIVEGUNS3"playername)
        }
    }
    return 
PLUGIN_HANDLED
}

public 
cmdSwap(id)
{
    if (
access(idSWAP))
    {
        new 
arg[32]
        
read_argv(1arg31)
        new 
player cmd_target(idargCMDTARGET_ALLOW_SELF)

        if (!
is_user_connected(player)) return PLUGIN_HANDLED
        
        cs_set_user_team
(playercs_get_user_team(player) == CS_TEAM_T CS_TEAM_CT:CS_TEAM_T)
            
        
g_iszombie[id] = cs_get_user_team(id) == CS_TEAM_T true false
        
        
if (is_user_alive(player))
            
ExecuteHamB(Ham_CS_RoundRespawnplayer)
        
        new 
adminauthid[35],adminname[35],playername[35],playerauthid[35]
        
get_user_name(id,adminname,34)
        
get_user_authid (id,adminauthid,34)
        
get_user_name(playerplayername34)
        
get_user_authid (player,playerauthid,34)
        
Log("[BaseBuilder 8.2] Admin: %s || SteamID: %s swapped Player: %s || SteamID: %s"adminnameadminauthidplayernameplayerauthid)
        
        
client_print(idprint_console"%L"LANG_SERVER"SWAP1"playername)
        
client_print(playerprint_center"%L"LANG_SERVER"SWAP2")
    }
    return 
PLUGIN_HANDLED
}

public 
cmdStartRound(id)
{
    if (
access(idSTART_ROUND))
    {
        if (
count_down<10)
        {
            
client_print(idprint_console"%L"LANG_SERVER"FAIL_START_ROUND")
            return 
PLUGIN_HANDLED
        
}
        
        
Release_Zombies()
        
        new 
adminauthid[35],adminname[35]
        
get_user_name(id,adminname,34)
        
get_user_authid (id,adminauthid,34)
        
Log("[BaseBuilder 8.2] Admin: %s || SteamID: %s started the round"adminnameadminauthid)
        
        
client_print(idprint_center"%L"LANG_SERVER"START_ROUND")
        
client_print(idprint_chat"^x04%L"LANG_SERVER"START_ROUND")
    }
    return 
PLUGIN_HANDLED
}


public 
cmdSay(id)
{
    new 
arg[64], arg1[31], arg2[32]
    
read_args(arg1charsmax(arg1));
    
remove_quotes(arg1);
    
read_args(arg,63)
    
remove_quotes(arg)
    
strtok(arg,arg1,255,arg2,255,' ',1)
    
trim(arg2)
    
    if(
arg1[0] == '/')
    {
        if (
equali(arg1"/cmds") == || equali(arg1"/commands") == 1)
        {
            
print_color(id"%s /fixspawn, /respawn, /help, /round, /guns"formatmodname)
            if (
access(idADMIN_KICK))
                
print_color(id"%s Admin: /respawns, removeaim, lockaim, unclaimaim"formatmodname)
            return 
PLUGIN_HANDLED
        
}

        if (
equali(arg1"/respawn") == || equali(arg1"/revive") == 1)
        {
            
Respawn_Zombie(id)
            return 
PLUGIN_HANDLED
        
}
        
        if (
equali(arg1"/fixspawn") == 1)
        {
            if (
g_isconnected[id] && !g_iszombie[id] && g_CanBuild)
                
ExecuteHamB(Ham_CS_RoundRespawnid)
                
            return 
PLUGIN_HANDLED
        
}
        if (
equali(arg1"/help") == || equali(arg1"/rules") == 1)
        {
            
set_hudmessage(02000, -1.00.4501.015.00.10.22)
            new 
nLenszHelp[512]
            
nLen += formatszHelp[nLen], 511-nLen"%L"LANG_SERVER"WELCOME_MSG"VERSION);
            
nLen += formatszHelp[nLen], 511-nLen"%L"LANG_SERVER"BIND_KEY");
            
nLen += formatszHelp[nLen], 511-nLen"%L"LANG_SERVER"RULE1");
            
nLen += formatszHelp[nLen], 511-nLen"%L"LANG_SERVER"RULE2");
            
nLen += formatszHelp[nLen], 511-nLen"%L"LANG_SERVER"RULE3");
            
nLen += formatszHelp[nLen], 511-nLen"%L"LANG_SERVER"RULE4");
            
nLen += formatszHelp[nLen], 511-nLen"%L"LANG_SERVER"RULE5");
            
show_hudmessage(idszHelp);
            
            return 
PLUGIN_HANDLED
        
}

        if (
equali(arg1"/round") == 1)
        {
            if (
g_ZombiesReleasedprint_color(id"%s Round: %d of %d"formatmodname, (g_RoundNum), g_pcvar_maxrounds)
            else if (!
g_ZombiesReleasedprint_color(id"%s Round: %d of %d"formatmodname, (g_RoundNum+1), g_pcvar_maxrounds)
            
            return 
PLUGIN_HANDLED
        
}
    
        if (
equali(arg1"/guns") == 1)
        {
            if(!
g_isalive[id] || !g_isconnected[id] || g_iszombie[id])
                return 
PLUGIN_HANDLED
            
            
if(!g_CanBuild && !access(idADMIN_GUNS))
                return 
PLUGIN_HANDLED    
        
            weapon_method_menu
(id)
            
            return 
PLUGIN_HANDLED
        
}
    
        if (
equali(arg1"/fixspawns") == && access(idBAD_SPAWN))
        {
            new 
players[32], num
            get_players
(playersnum)
                
            new 
player
            
for(new 0numi++)
            {
                
player players[i]
                if (
cs_get_user_team(player) == CS_TEAM_CT && !is_user_alive(player) && g_isconnected[player] && g_CanBuild)
                    
ExecuteHamB(Ham_CS_RoundRespawnplayer)
            }
            return 
PLUGIN_HANDLED
        
}
        
        if (
equali(arg1"/respawns") == && access(idBAD_SPAWN))
        {
            new 
players[32], num
            get_players
(playersnum)
                
            new 
player
            
for(new 0numi++)
            {
                
player players[i]
                if (
cs_get_user_team(player) == CS_TEAM_T && !is_user_alive(player) && g_isconnected[player])
                    
ExecuteHamB(Ham_CS_RoundRespawnplayer)
            }
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE
}

/*-------------------------------------------------------------------------------------------------|
|----------------------------------Begin Status Text Code---[0006]---------------------------------|
|-------------------------------------------------------------------------------------------------*/
public msgStatusValue()
{
    
//Block the name info, of person you aim at
    
set_msg_block(gmsgStatusTextBLOCK_SET);
}

public 
ev_SetTeam(id)
{
    
g_friend[id] = read_data(2)
}

public 
ev_ShowStatus(id//called when id looks at someone
{
    new 
name[32], pid read_data(2);
    
    
get_user_name(pidname31);
    new 
color1 0color2 0;

    if (
get_user_team(pid) == 1)
        
color1 255;
    else
        
color2 255;

    new 
Float:height=0.30
    
//height=0.60

    
if (g_friend[id] == 1)    // friend
    
{
        new 
clipammowpnid get_user_weapon(pidclipammo);
        new 
wpnname[32];

        if (
wpnid)
            
xmod_get_wpnname(wpnidwpnname31);

        
set_hudmessage(color150color2, -1.0height10.013.00.010.01);
        new 
nLenszStatus[512]
        
nLen += formatszStatus[nLen], 511-nLen"%L"LANG_SERVER"PLAYER_INFO1"nameget_user_health(pid), wpnname);
        
ShowSyncHudMsg(idgHudSyncInfoszStatus);
    } 
    if (
g_friend[id] != 1//enemy
    
{
        
set_hudmessage(color150color2, -1.0height10.013.00.010.01);
        
ShowSyncHudMsg(idgHudSyncInfo"%L"LANG_SERVER"PLAYER_INFO2"name);
    }
}

public 
ev_HideStatus(id)
{
    
ClearSyncHud(idgHudSyncInfo);
}
/*-------------------------------------------------------------------------------------------------|
|------------------------------------------End Player Model Code-----------------------------------|
|-------------------------------------------------------------------------------------------------*/

/*-------------------------------------------------------------------------------------------------|
|-------------------------------Begin Guns Menu Code-[0001]----------------------------------------|
|-------------------------------------------------------------------------------------------------*/

//Call this on player spawn
public weapon_method_menu(id)
{
    if(
firsttime[id])
    {
        
firsttime[id] = false
        prim_weapons_menu
(id,0)
    }
    else
    {
        
cur_offset[id] = 0
        show_menu
(id,(1<<0)|(1<<1),"Alegeti armele^n^n1. Arme Noi^n2. Armele Anterioare",-1,"WeaponMethodMenu")
    }
}

public 
weapon_method_pushed(id,key)
{
    switch(
key)
    {
        case 
0prim_weapons_menu(id,0)
        case 
1give_weapons(id)
    }
    return 
PLUGIN_HANDLED;
}

public 
prim_weapons_menu(id,offset)
{
    if(
offset<0offset 0

    
new cvar_value[32]
    
get_pcvar_string(g_pcvar_allowedweps,cvar_value,31)
    new 
flags read_flags(cvar_value)

    new 
keyscurnummenu[2048]
    for(new 
i=offset;i<19;i++)
    {
        if(
flags power(2,i))
        {
            
options_on_menu[curnum][id] = i
            keys 
+= (1<<curnum)
    
            
curnum++
            
format(menu,2047,"%s^n%d. %s",menu,curnum,WEAPONNAMES[i])
    
            if(
curnum==8)
            break;
        }
    }

    
format(menu,2047,"Arme Primare:^n%s^n",menu)
    if(
curnum==&& offset<12)
    {
        
keys += (1<<8)
        
format(menu,2047,"%s^n9. Urmatorul",menu)
    }
    if(
offset)
    {
        
keys += (1<<9)
        
format(menu,2047,"%s^n0. Anteriorul",menu)
    }

    
show_menu(id,keys,menu,-1,"PrimaryWeaponSelect")
}

public 
prim_weapons_pushed(id,key)
{
    if(
key<8)
    {
        
weapon_picked[0][id] = options_on_menu[key][id]
        
cur_offset[id] = 0
        sec_weapons_menu
(id,0)
    }
    else
    {
        if(
key==8)
            
cur_offset[id] += 8
        
if(key==9)
            
cur_offset[id] -= 8
        prim_weapons_menu
(id,cur_offset[id])
    }
    return ;
}

public 
sec_weapons_menu(id,offset)
{
    if(
offset<0offset 0

    
new cvar_value[32]
    
get_pcvar_string(g_pcvar_allowedweps,cvar_value,31)
    new 
flags read_flags(cvar_value)

    new 
keyscurnummenu[2048]
    for(new 
i=18;i<24;i++)
    {
        if(
flags power(2,i))
        {
        
options_on_menu[curnum][id] = i
        keys 
+= (1<<curnum)

        
curnum++
        
format(menu,2047,"%s^n%d. %s",menu,curnum,WEAPONNAMES[i])
        }
    }

    
format(menu,2047,"Arme Secundare:^n%s",menu)

    
show_menu(id,keys,menu,-1,"SecWeaponSelect")
}

public 
sec_weapons_pushed(id,key)
{
    if(
key<8)
    {
        
weapon_picked[1][id] = options_on_menu[key][id]
    }
    
give_weapons(id)
    return ;
}

public 
give_weapons(id)
{
    
strip_user_weapons(id)
    
give_item(id,"weapon_knife")
   
    new 
weapon[32]
    new 
csw csw_contant(weapon_picked[0][id])
    
get_weaponname(csw,weapon,31)
    
give_item(id,weapon)
    
cs_set_user_bpammo(id,csw,999)
    
g_PrimaryWeapon[id] = csw

    csw 
csw_contant(weapon_picked[1][id])
    
get_weaponname(csw,weapon,31)
    
give_item(id,weapon)
    
cs_set_user_bpammo(id,csw,999)
}

public 
csw_contant(weapon)
{
    new 
num 29
    
switch(weapon)
    {
        case 
0num 3
        
case 1num 5
        
case 2num 7
        
case 3num 8
        
case 4num 12
        
case 5num 13
        
case 6num 14
        
case 7num 15
        
case 8num 18
        
case 9num 19
        
case 10num 20
        
case 11num 21
        
case 12num 22
        
case 13num 23
        
case 14num 24
        
case 15num 27
        
case 16num 28
        
case 17num 30
        
case 18num 1
        
case 19num 10
        
case 20num 11
        
case 21num 16
        
case 22num 17
        
case 23num 26
        
case 24:
        {
            new 
s_weapon[32]
        
            
get_pcvar_string(g_pcvar_allowedweps,s_weapon,31)
           
            new 
flags read_flags(s_weapon)
            do
            {
                
num random_num(0,18)
                if(!(
num flags))
                {
                    
num = -1
                
}
            }
            while(
num==-1)
            
num csw_contant(num)
        }
        case 
25:
        {
            new 
s_weapon[32]

            
get_pcvar_string(g_pcvar_allowedweps,s_weapon,31)
        
            new 
flags read_flags(s_weapon)
            do
            {
                
num random_num(18,23)
                if(!(
num flags))
                {
                    
num = -1
                
}
            }
            while(
num==-1)
            
num csw_contant(num)
        }
    }
    return 
num;
}

/*-------------------------------------------------------------------------------------------------|
|---------------------------------End Guns Menu Code-----------------------------------------------|
|-------------------------------------------------------------------------------------------------*/

public ev_Health(id)
{
    if (
is_user_alive(id))
    {
        
set_hudmessage(02000, -1.00.9012.012.00.10.24);
        
show_hudmessage(id"%L"LANG_SERVER"PLAYER_HEALTH"get_user_health(id));
        
        
set_task(11.9"ev_Health"id);
    }
}

public 
msgHealth(msgiddestid)
{
    if(!
is_user_alive(id))
        return 
PLUGIN_CONTINUE;
    
    static 
hp;
    
hp get_msg_arg_int(1);
    
    if(
hp 255 && (hp 256) == 0)
        
set_msg_arg_int(1ARG_BYTE, ++hp);
    
    return 
PLUGIN_CONTINUE;
}

Log(const message_fmt[], any:...)
{
    static 
message[256];
    
vformat(messagesizeof(message) - 1message_fmt2);
    
    static 
filename[96];
    static 
dir[64];
    if( !
dir[0] )
    {
        
get_basedir(dirsizeof(dir) - 1);
        
add(dirsizeof(dir) - 1"/logs");
    }
    
    
format_time(filenamesizeof(filename) - 1"%m-%d-%Y");
    
format(filenamesizeof(filename) - 1"%s/BaseBuilder82_%s.log"dirfilename);
    
    
log_to_file(filename"%s"message);
}

print_color(target, const message[], any:...)
{
    static 
buffer[512], iargscount
    argscount 
numargs()
    
    
// Send to everyone
    
if (!target)
    {
        static 
player
        
for (player 1player <= g_MaxPlayersplayer++)
        {
            if (!
g_isconnected[player])
                continue;

            static 
changed[5], changedcount
            changedcount 
0

            
for (2argscounti++)
            {
                if (
getarg(i) == LANG_PLAYER)
                {
                    
setarg(i0player)
                    
changed[changedcount] = i
                    changedcount
++
                }
            }
            
vformat(buffercharsmax(buffer), message3)

            
message_begin(MSG_ONE_UNRELIABLEgmsgSayText_player)
            
write_byte(player)
            
write_string(buffer)
            
message_end()
            
            for (
0changedcounti++)
                
setarg(changed[i], 0LANG_PLAYER)
        }
    }
    
// Send to specific target
    
else
    {
        
vformat(buffercharsmax(buffer), message3)

        
message_begin(MSG_ONEgmsgSayText_target)
        
write_byte(target)
        
write_string(buffer)
        
message_end()
    }


Last edited by GaBy56; 03-16-2013 at 03:12.
GaBy56 is offline
SoldierPRO
Junior Member
Join Date: Mar 2013
Location: Monterrey N.L
Old 03-30-2013 , 21:44   Re: Base Builder Zombie Mod v6.5 [01/15/2011]
Reply With Quote #1012

Tanks you Good job
__________________
SoldierPRO Helping people to have a good server
SoldierPRO is offline
Send a message via MSN to SoldierPRO Send a message via Skype™ to SoldierPRO
razvan009
Member
Join Date: Jan 2013
Old 04-09-2013 , 14:33   Re: Base Builder Zombie Mod v6.5 [01/15/2011]
Reply With Quote #1013

When i write /class in chat,nothing happend
__________________
razvan009 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 04-10-2013 , 10:43   Re: Base Builder Zombie Mod v6.5 [01/15/2011]
Reply With Quote #1014

Hum, my bb is crazy xD
HE can kill the zombies
__________________
Jhob94 is offline
adiif1
Member
Join Date: Apr 2013
Old 04-21-2013 , 15:17   Re: Base Builder Zombie Mod v6.5 [01/15/2011]
Reply With Quote #1015

Anyone know how to make the blocks disappear after a time to build?
adiif1 is offline
wEEk
Senior Member
Join Date: Sep 2012
Old 04-22-2013 , 20:29   Re: Base Builder Zombie Mod v6.5 [01/15/2011]
Reply With Quote #1016

Someone would be kind enough to help? is that aggregates new classes, but when I upload it I pulled the server. The models and I have in their respective folders.

PHP Code:
/*================================================================================
    
    -----------------------------------
    -*- [BB] Default Zombie Classes -*-
    -----------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This plugin adds the default zombie classes from Zombie Plague
    into Base Builder. All credit belongs to MeRcyLeZZ.
    
    All classes have been balanced, but feel free to edit them if
    you are not satisfied. 
    
    
================================================================================*/

#include <amxmodx>
#include <basebuilder>
#include <hamsandwich>
#include <fun>
#include <cstrike>

/*================================================================================
 [Plugin Customization]
=================================================================================*/

// Classic Zombie Attributes
new const zclass1_name[] = { "Zombie Clasico" }
new const 
zclass1_info[] = { "=Balanced=" }
new const 
zclass1_model[] = { "bb_classic" }
new const 
zclass1_clawmodel[] = { "v_bloodyhands" }
const 
zclass1_health 3000
const zclass1_speed 260
const Float:zclass1_gravity 1.0
const zclass1_adminflags ADMIN_ALL

// Fast Zombie Attributes
new const zclass2_name[] = { "Zombie Rapido" }
new const 
zclass2_info[] = { "HP-- Speed++" }
new const 
zclass2_model[] = { "bb_fast" }
new const 
zclass2_clawmodel[] = { "v_bloodyhands" }
const 
zclass2_health 2000
const zclass2_speed 325
const Float:zclass2_gravity 1.0
const zclass2_adminflags ADMIN_ALL

// Jumper Zombie Attributes
new const zclass3_name[] = { "Zombie Gravitatorio" }
new const 
zclass3_info[] = { "HP- Jump+" }
new const 
zclass3_model[] = { "bb_jumper" }
new const 
zclass3_clawmodel[] = { "v_bloodyhands" }
const 
zclass3_health 2500
const zclass3_speed 285
const Float:zclass3_gravity 0.5
const zclass3_adminflags ADMIN_ALL

// Tanker Zombie Attributes
new const zclass4_name[] = { "Zombie Tanker" }
new const 
zclass4_info[] = { "HP++ Speed-" }
new const 
zclass4_model[] = { "bb_tanker" }
new const 
zclass4_clawmodel[] = { "v_bloodyhands" }
const 
zclass4_health 4000
const zclass4_speed 210
const Float:zclass4_gravity 1.0
const zclass4_adminflags ADMIN_ALL
#define TANK_ARMOR 200  
 
//Alien Zombie
new const zclass5_name[] = { "Zombie Alien" }
new const 
zclass5_info[] = { "HP+ Speed++" }
new const 
zclass5_model[] = { "bb_alien" }
new const 
zclass5_clawmodel[] = { "v_bloodyhands" }
const 
zclass5_health 2800
const zclass5_speed 320
const Float:zclass5_gravity 1.0
const zclass5_adminflags ADMIN_ALL 

//Zombie Predator
new const zclass6_name[] = { "Zombie Predator" 
new const 
zclass6_info[] = { "HP++ Speed++" 
new const 
zclass6_model[] = { "bb_nemesis" 
new const 
zclass6_clawmodel[] = { "v_bb_predator_knife.mdl" 
const 
zclass6_health 4500 
const zclass6_speed 320
const Float:zclass6_gravity 1.0 
const zclass6_adminflags ADMIN_KICK


/*============================================================================*/

new g_zclass_tanker

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
    
register_plugin("[BB] Default Zombie Classes""6.5""Tirant")
    
    
// Register all classes
    
bb_register_zombie_class(zclass1_namezclass1_infozclass1_modelzclass1_clawmodelzclass1_healthzclass1_speedzclass1_gravity0.0zclass1_adminflags)
    
bb_register_zombie_class(zclass2_namezclass2_infozclass2_modelzclass2_clawmodelzclass2_healthzclass2_speedzclass2_gravity0.0zclass2_adminflags)
    
bb_register_zombie_class(zclass3_namezclass3_infozclass3_modelzclass3_clawmodelzclass3_healthzclass3_speedzclass3_gravity0.0zclass3_adminflags)
    
g_zclass_tanker bb_register_zombie_class(zclass4_namezclass4_infozclass4_modelzclass4_clawmodelzclass4_healthzclass4_speedzclass4_gravity0.0zclass4_adminflags)  
    
bb_register_zombie_class(zclass5_namezclass5_infozclass5_modelzclass5_clawmodelzclass5_healthzclass5_speedzclass5_gravity0.0zclass5_adminflags)  
    
bb_register_zombie_class(zclass6_namezclass6_infozclass6_modelzclass6_clawmodelzclass6_healthzclass6_speedzclass6_gravity0.0zclass6_adminflags
}

#if defined TANK_ARMOR
public plugin_init()
{
    
RegisterHam(Ham_Spawn"player""ham_PlayerSpawn_Post"1)
}

public 
ham_PlayerSpawn_Post(id)
{
    if (!
is_user_alive(id))
        return ;
        
    if (
bb_is_user_zombie(id) && bb_get_user_zombie_class(id) == g_zclass_tanker)
    {
        
give_item(id"item_assaultsuit");
        
cs_set_user_armor(idTANK_ARMORCS_ARMOR_VESTHELM);
    }
}
#endif 
wEEk is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-24-2013 , 09:39   Re: Base Builder Zombie Mod v6.5 [01/15/2011]
Reply With Quote #1017

Quote:
Originally Posted by adiif1 View Post
Anyone know how to make the blocks disappear after a time to build?
I don't have the setup to test this but it should work. Add the following snippet into the plugin and then add remove_unowned_ents() into Release_Zombies() function, and see how it goes.
Code:
remove_unowned_ents() {     new iEnt = -1, szName[ 8 ];         while( ( iEnt = engfunc( EngFunc_FindEntityByString, iEnt, "classname", "func_wall" ) ) )     {         pev( iEnt, pev_targetname, szName, charsmax( szName ) );                 if( !equal( szName, "ignore" ) && !g_EntOwner[ iEnt ] ) )             engfunc( EngFunc_RemoveEntity, iEnt );     } }
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
wEEk
Senior Member
Join Date: Sep 2012
Old 04-27-2013 , 22:11   Re: Base Builder Zombie Mod v6.5 [01/15/2011]
Reply With Quote #1018

Hi, I have a problem with the BaseBuilder.

When I put in modules.ini this

cstrike
csx

I closed the cs, and when I put it so

;cstrike
;csx

doing well but I only see the standard Counter-Strike
wEEk is offline
Gnaskern
Junior Member
Join Date: Apr 2013
Old 04-28-2013 , 05:18   Re: Base Builder Zombie Mod v6.5 [01/15/2011]
Reply With Quote #1019

Does this plugin work to counter-strike: source?
Gnaskern is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-28-2013 , 08:13   Re: Base Builder Zombie Mod v6.5 [01/15/2011]
Reply With Quote #1020

Quote:
Originally Posted by Gnaskern View Post
Does this plugin work to counter-strike: source?
No, it doesn't. Check the SourceMod section for plugins that you can use.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 04-28-2013 at 08:14.
hornet is offline
Reply



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 22:30.


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