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

Basebuilder 5.4 with /colors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-04-2023 , 05:10   Basebuilder 5.4 with /colors
Reply With Quote #1

Hello, I am using Base Builder 5.4 and i wanna add /colors on it.
Do not saying go use 6.5, i don't wanna use that version, im using 5.4 better. About colors my old friend added it in his old server in 2015/16. If someone can edit it and adding /colors into my basebuilder.sma
(/colors = about the color of grabbing)

Thanks.
Attached Files
File Type: sma Get Plugin or Get Source (basebuilder54.sma - 56 views - 50.3 KB)
__________________
CS:CZ > CS 1.6

Last edited by Ace67; 03-04-2023 at 05:11.
Ace67 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-11-2023 , 11:26   Re: Basebuilder 5.4 with /colors
Reply With Quote #2

bump
__________________
CS:CZ > CS 1.6
Ace67 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-11-2023 , 18:56   Re: Basebuilder 5.4 with /colors
Reply With Quote #3

if anyone is willing to do this
line 805: DispatchKeyValue(ent, "rendercolor", "135.0 206.0 235.0");
3rd param will set block color
good luck
__________________
bigdaddy424 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-12-2023 , 03:10   Re: Basebuilder 5.4 with /colors
Reply With Quote #4

Quote:
Originally Posted by bigdaddy424 View Post
if anyone is willing to do this
line 805: DispatchKeyValue(ent, "rendercolor", "135.0 206.0 235.0");
3rd param will set block color
good luck
It is possible to do maybe Flags colors ?
Admin with purple, Vip with yellow, Normal user with Red
If yes? Can you send me first step if you know

I did this but there is a problem, the one with admin_vote its not doing it with ADMIN, doing it for normal users
PHP Code:
    DispatchKeyValue(ent"rendermode""1");
    
DispatchKeyValue(ent"renderamt""100");
    
DispatchKeyValue(ent"rendercolor""254.0 254.0 034.0"); 
    {
         if(!(
get_user_flags(id) & ADMIN_VOTE))
         
DispatchKeyValue(ent"rendercolor""255.0 0.0 0.0");
    } 

Problem DispatchKeyValue(ent, "rendercolor", "254.0 254.0 034.0"); -- Its taking this for ADMIN not the down one
{
if(!(get_user_flags(id) & ADMIN_VOTE))
DispatchKeyValue(ent, "rendercolor", "255.0 0.0 0.0");
}
__________________
CS:CZ > CS 1.6

Last edited by Ace67; 03-12-2023 at 09:13.
Ace67 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-12-2023 , 11:08   Re: Basebuilder 5.4 with /colors
Reply With Quote #5

https://www.colorspire.com/rgb-color-wheel/
Code:
switch (get_user_flags(id)){     case ADMIN_LEVEL_C : DispatchKeyValue(ent, "rendercolor", "135.0 206.0 235.0");     case ADMIN_LEVEL_B : DispatchKeyValue(ent, "rendercolor", "135.0 206.0 235.0");     case ADMIN_LEVEL_A : DispatchKeyValue(ent, "rendercolor", "135.0 206.0 235.0");     default : DispatchKeyValue(ent, "rendercolor", "135.0 206.0 235.0") }

ideally you would want this to run once @ client_putinserver and you can save their color on a 2d array string
__________________

Last edited by bigdaddy424; 03-12-2023 at 11:17.
bigdaddy424 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-12-2023 , 12:45   Re: Basebuilder 5.4 with /colors
Reply With Quote #6

Quote:
Originally Posted by bigdaddy424 View Post
https://www.colorspire.com/rgb-color-wheel/
Code:
switch (get_user_flags(id)){     case ADMIN_LEVEL_C : DispatchKeyValue(ent, "rendercolor", "135.0 206.0 235.0");     case ADMIN_LEVEL_B : DispatchKeyValue(ent, "rendercolor", "135.0 206.0 235.0");     case ADMIN_LEVEL_A : DispatchKeyValue(ent, "rendercolor", "135.0 206.0 235.0");     default : DispatchKeyValue(ent, "rendercolor", "135.0 206.0 235.0") }

ideally you would want this to run once @ client_putinserver and you can save their color on a 2d array string
There is a problem. Its only working if i preset only "ADMIN_LEVEL_C"

"STEAM_0:0:570028950" "" "o" "ce" Its only working when there is only 1 flag
"STEAM_0:0:570028950" "" "ojbqri" "ce" After i tried to add others flags for seen if its working, didn't worked

Would we can talking on Steam or Discord suxa#0490 / https://steamcommunity.com/id/ace67cz/
__________________
CS:CZ > CS 1.6

Last edited by Ace67; 03-12-2023 at 12:59.
Ace67 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-12-2023 , 17:50   Re: Basebuilder 5.4 with /colors
Reply With Quote #7

you need something like this
Code:
#include <amxmodx> enum colorsData{     color[24],     access } new colors[][colorsData] = {     { "165.0 206.0 235.0", ADMIN_LEVEL_C }, // highest rank     { "155.0 206.0 235.0", ADMIN_LEVEL_B },     { "145.0 206.0 235.0", ADMIN_LEVEL_A },     { "135.0 206.0 235.0", ADMIN_USER } // lowest rank } new my_color[MAX_PLAYERS + 1] public client_putinserver(id){     my_color[id] = 0     new flags = get_user_flags(id)         for (new i = 0; i < sizeof(colors); i++){         if (flags & colors[i][access]){             my_color[id] = i             break         }     } } # line 805 DispatchKeyValue(ent, "rendercolor", colors[my_color[id]][color]);
__________________
bigdaddy424 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-12-2023 , 18:05   Re: Basebuilder 5.4 with /colors
Reply With Quote #8

Quote:
Originally Posted by bigdaddy424 View Post
you need something like this
Code:
#include <amxmodx> enum colorsData{     color[24],     access } new colors[][colorsData] = {     { "165.0 206.0 235.0", ADMIN_LEVEL_C }, // highest rank     { "155.0 206.0 235.0", ADMIN_LEVEL_B },     { "145.0 206.0 235.0", ADMIN_LEVEL_A },     { "135.0 206.0 235.0", ADMIN_USER } // lowest rank } new my_color[MAX_PLAYERS + 1] public client_putinserver(id){     my_color[id] = 0     new flags = get_user_flags(id)         for (new i = 0; i < sizeof(colors); i++){         if (flags & colors[i][access]){             my_color[id] = i             break         }     } } # line 805 DispatchKeyValue(ent, "rendercolor", colors[my_color[id]][color]);
PHP Code:
//// basebuilder54.sma
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuilder54.sma(805) : error 017: undefined symbol "colors"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuilder54.sma(805) : error 017: undefined symbol "my_color"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuilder54.sma(805) : warning 215: expression has no effect
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuilder54.sma(805) : error 001: expected token: ";", but found "]"
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\basebuilder54.sma(805) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\compiled\basebuilder54.amx (compile failed).
//
// Compilation Time: 0,42 sec
// ----------------------------------------

Press enter to exit ... 
__________________
CS:CZ > CS 1.6
Ace67 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-12-2023 , 20:37   Re: Basebuilder 5.4 with /colors
Reply With Quote #9

show me ur code in not a mastermind
__________________
bigdaddy424 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 03-13-2023 , 12:00   Re: Basebuilder 5.4 with /colors
Reply With Quote #10

Quote:
Originally Posted by bigdaddy424 View Post
show me ur code in not a mastermind
PHP Code:
/*
Base Builder Zombie Mod
By: Tirant
*/

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <basebuilder>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <fun>
#include <csstats>
#include <csx>
#include <xs>

// Plugin Version
new VERSION[]="5.4"
new formatmodname[] = "^x01 [^x04 Base Builder^x01 ]"

//Models
new const g_ZombieModel[] = "classic2"
new const g_ZombieKnifeModel[] = "models/bb/x_knife.mdl"

//Sounds
new g_RoundStart[] = "basebuilder/round_start.wav"

#define MAX_PLAYERS 32
#define AMMO_SLOT 376
#define MODELSET_TASK 100
#define MODELCHANGE_DELAY 0.5
#define MAXENTS 1365
#define TASK_ROUND 1023
#define AUTO_TEAM_JOIN_DELAY 0.1
#define TEAM_SELECT_VGUI_MENU_ID 2

#define AFTER_BUILD ADMIN_LEVEL_E
#define DEAD_BUILD ADMIN_LEVEL_B
#define REMOVE_BLOCK ADMIN_LEVEL_C
#define DEAD_REMOVE ADMIN_LEVEL_D
#define LOCK_BLOCKS ADMIN_RESERVATION
#define PAIN_SHOCK_FREE ADMIN_KICK
#define BAD_SPAWN ADMIN_KICK
#define BUILD_BAN ADMIN_KICK
#define REVIVE ADMIN_KICK
#define SWAP ADMIN_KICK
#define START_ROUND ADMIN_BAN

#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 gmsgStatusText
new gmsgSayText
new gHudSyncInfo
new g_MaxPlayers
const fPainShock 108

new bool:g_CanBuild
new bool:g_ZombiesReleased
new g_RoundNum
new g_iEntBarrier
new bool:g_BuildBan[MAX_PLAYERS+1]
new 
g_pEnt[MAX_PLAYERS+1], g_pDist[MAX_PLAYERS+1]
new 
bool:g_MovingEnt[MAXENTS]
new 
g_EntMover[MAXENTS]
new 
g_LastMover[MAXENTS]
new 
g_EntOwner[MAXENTS]
new 
g_OwnedEnts[33]

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

new 
g_ModName[32]
new 
g_CurrentWeapon[MAX_PLAYERS+1]
new 
g_PrimaryWeapon[MAX_PLAYERS+1]

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

new 
g_pcvar_teamg_pcvar_classg_pcvar_buildtimeg_pcvar_zombiehpg_pcvar_maxroundsg_pcvar_basecalc,
    
g_pcvar_givenadesg_pcvar_allowedwepsg_pcvar_tournymodeg_pcvar_showmoversg_pcvar_healthtime,
    
g_pcvar_blockgravg_pcvar_knockbackg_pcvar_entmindistg_pcvar_entsetdistg_pcvar_entmaxdist,
    
g_pcvar_roundnumg_pcvar_roundtimeg_pcvar_resetentg_pcvar_zresptimeg_pcvar_maxclaimable,
    
g_pcvar_claimable
    
new g_friend[MAX_PLAYERS+1]

//Cached Stuff for Players
new g_isconnected[MAX_PLAYERS+1]
new 
g_isalive[MAX_PLAYERS+1
new 
g_ishuman[MAX_PLAYERS+1]
new 
g_iszombie[MAX_PLAYERS+1]

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

new 
count_down

// 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" }
            
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"
}

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)
    
    
g_pcvar_buildtime register_cvar("bb_build_time""150")
    
g_pcvar_zombiehp register_cvar("bb_zombie_health""6500")
    
g_pcvar_basecalc register_cvar("bb_calc_maxbase""0")
    
g_pcvar_tournymode register_cvar("bb_tournament_mode""0")
    
g_pcvar_showmovers register_cvar("bb_show_moving""1")
    
g_pcvar_blockgrav register_cvar("bb_block_gravity""0")
    
g_pcvar_knockback register_cvar("bb_pain_shock_free""0")
    
g_pcvar_entmaxdist register_cvar("bb_max_move_dist""99999999")
    
g_pcvar_entmindist register_cvar("bb_min_move_dist""5")
    
g_pcvar_entsetdist register_cvar("bb_min_dist_set""1")
    
g_pcvar_healthtime register_cvar("bb_health_time""12")
    
g_pcvar_resetent register_cvar("bb_reset_blocks""1")
    
g_pcvar_roundtime register_cvar("bb_roundtime""8")
    
g_pcvar_zresptime register_cvar("bb_zombie_respawn_time""0.01")
    
g_pcvar_roundnum register_cvar("bb_rounds""6")
    
g_pcvar_maxrounds get_cvar_num("mp_maxrounds")
    
g_pcvar_maxclaimable register_cvar("bb_claim_max""6")
    
g_pcvar_claimable register_cvar("bb_claim_mode""0")
        
    
//AJC for auto team (if needed)
    
g_pcvar_team register_cvar("bb_team""5")
    
g_pcvar_class register_cvar("bb_class""5")
        
    
//Guns Menu
    
g_pcvar_givenades register_cvar("bb_give_nades","h"//h f s, put multiple letters for multiple nades
    
g_pcvar_allowedweps register_cvar("bb_weapons","abcdeghijlmnqrstuvwx")
    
    
//Client Commands
    
register_clcmd("+grab","cmdMoveEnt",_," - Starts moving the selected object")         //command to move stuff around
    
register_clcmd("-grab","cmdStopEnt",_," - Stops moving the selected object")         //command to move stuff around
    
register_clcmd("say /respawn","Respawn_Zombie",_," - Respawn while dead (Zombie)")    //command to respawn (zombies only)
    
register_clcmd("say /fixspawn","cmdBadSpawn",_," - Respawn while dead (Survivor)")    //command to respawn (humans only before buildtime)
    
register_clcmd("say respawn","Respawn_Zombie",_," - Respawn while dead (Zombie)")    //command to respawn (zombies only)
    
register_clcmd("say fixspawn","cmdBadSpawn",_," - Respawn while dead (Survivor)")    //command to respawn (humans only before buildtime)
    
register_clcmd("say /help","cmdHelp",_," - Displays the help hud")             //command to see /help menu
    
register_clcmd("say /rules","cmdHelp",_," - Displays the help hud")             //command to see /help menu
    
register_clcmd("say /round","cmdCheckRound",_," - Displays the round number")        //command to see the current round number
    
register_clcmd("say round","cmdCheckRound",_," - Displays the round number")        //command to see the current round number
    
    //Guns Menu
    
register_clcmd("say guns","cmdGuns",_," - Opens the guns menu")                 //Guns Menu CMD
    
register_clcmd("say_team guns","cmdGuns",_," - Opens the guns menu")            //Guns Menu CMD
    
register_clcmd("say /guns","cmdGuns",_," - Opens the guns menu")            //Guns Menu CMD
    
register_clcmd("say_team /guns","cmdGuns",_," - Opens the guns menu")            //Guns Menu CMD
    
    //Admin Commands
    
register_concmd("removeaim","cmdRemoveEnt",_," - Deletes an object")             //Removes an object (C alive, D dead)
    
register_concmd("lockaim","cmdLockBlock",_," - Locks/Unlocks an object from moving")    //Once to lock, again to unlock
    
register_concmd("unclaimaim","cmdRemoveClaim",_," - Removes a claim on an object")    //Makes block claimable by everyone
    
register_concmd("say /fixspawns","cmdBadSpawn_Survivor",_," - Respawns all dead CTs")     //Global /fixspawn command (Kick)
    
register_concmd("say /respawns","cmdBadSpawn_Zombie",_," - Respawns all dead Ts")     //Global /respawn command (Kick)
    
register_concmd("bb_buildban","cmdBuildBan",_,"<player>")                 //Bans targeted player from building
    
register_concmd("bb_unbuildban","cmdBuildUnban",_,"<player>")                 //Unbans   "       "     "     "
    
register_concmd("bb_revive","cmdRevive",_,"<player>")                    //revives targetted player
    
register_concmd("bb_swap","cmdSwap",_,"<player>")                    //swaps the selected player to the opposite team
    
register_concmd("bb_startround","cmdStartRound",_," - Ends the build phase")        //do i really have to explain this?
    
    //Blocked Commands
    
register_clcmd("drop""clcmd_drop")
    
register_clcmd("buy""clcmd_buy")
    
    new 
tournymode get_pcvar_num(g_pcvar_tournymode)
    if (
tournymode != 1)
    {
        
register_clcmd("chooseteam""clcmd_changeteam")
        
register_clcmd("jointeam""clcmd_changeteam")
    }
    
    
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")
    
register_forward(FM_ClientKill"fw_Suicide")
    
//register_forward(FM_CmdStart, "fw_CmdStart")
    
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)
    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");
    if (
tournymode != 1)
    {
        
register_message(get_user_msgid("ShowMenu"), "message_show_menu")
        
register_message(get_user_msgid("VGUIMenu"), "message_vgui_menu")
    }
    
    
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_event("CurWeapon""CurrentWeapon""be""1=1");
    
    
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)
    
    
register_dictionary("basebuilder.txt");
    
    
gmsgSayText get_user_msgid("SayText")
    
gmsgStatusText get_user_msgid("StatusText");
    
gHudSyncInfo CreateHudSyncObj();
    
g_MaxPlayers get_maxplayers()

    if (
tournymode != 1)
    {
        
server_cmd("mp_limitteams 1")
        
server_cmd("mp_autoteambalance 1")
    }
    else
    {
        
server_cmd("mp_limitteams 0")
        
server_cmd("mp_autoteambalance 0")        
    }
    new 
roundnum get_pcvar_num(g_pcvar_roundnum)
    
server_cmd("mp_freezetime 0")
    
server_cmd("mp_flashlight 0")
    
server_cmd("mp_maxrounds %d"roundnum)
    
server_cmd("mp_winlimit %d"roundnum)
    
server_cmd("mp_roundtime %d"get_pcvar_num(g_pcvar_roundtime))
    
    
g_iEntBarrier find_ent_by_tname( -1"barrier" );
}

public 
plugin_natives()
{    
    
register_native("bb_build_time","native_build_time"1)
}


public 
plugin_precache()
{
    new 
szModel64 ];
    
formatexszModelcharsmaxszModel ), "models/player/%s/%s.mdl"g_ZombieModelg_ZombieModel );
    
engfuncEngFunc_PrecacheModelszModel );
    
    new 
szKnifeModel64 ];
    
formatexszKnifeModelcharsmaxszKnifeModel ), "%s"g_ZombieKnifeModel );
    
engfuncEngFunc_PrecacheModelszKnifeModel );
    
    
engfuncEngFunc_PrecacheSoundg_RoundStart )

    new 
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_bomb_target"))
    if (
ent
    {
        
dllfunc(DLLFunc_Spawnent)
        
set_pev(entpev_solidSOLID_NOT)
    }
    
    new 
iBuyZone create_entity("info_map_parameters");
    
DispatchKeyValue(iBuyZone"bombradius""0");
    
DispatchKeyValue(iBuyZone"buying""3");
    
DispatchSpawn(iBuyZone);
}

public 
CurrentWeapon(id)
{
    if (
g_iszombie[id])
    {
          
set_pev(idpev_viewmodel2g_ZombieKnifeModel);
    }
    return 
PLUGIN_HANDLED;
}

// Event Round Start (This is before freeze time)
public event_round_start()
{
    
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"))
                    
engfuncEngFunc_SetOriginiEntFloat:{ 0.00.00.0 } );
            }
        }
    }
}

public 
cmdHelp(id)
{
    
set_hudmessage(255255255, -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);
}

// Log Event Round Start (This is AFTER freeze time)
public logevent_round_start()
{
    
set_pev(g_iEntBarrier,pev_solid,SOLID_BSP)
    
set_pev(g_iEntBarrier,pev_rendermode,1)
    
DispatchKeyValue(g_iEntBarrier"renderamt""255");
    
    
set_hudmessage(255255255, -1.00.4501.010.00.10.21)
    new 
nLenszMsg[128]
    
nLen += formatszMsg[nLen], 127-nLen"%L"LANG_SERVER"WELCOME_MSG"VERSION);
    
nLen += formatszMsg[nLen], 127-nLen"%L"LANG_SERVER"BIND_KEY");
    
show_hudmessage(0szMsg);
    
    
print_color(0"%s %s ^x04- ^x01%L"formatmodnameVERSIONLANG_SERVER"ROUND_MSG")
    
print_color(0"%s Round: %d of %d"formatmodname, (g_RoundNum+1), g_pcvar_maxrounds)
    
    
remove_task(TASK_ROUND)
    
remove_task(30000)
    
    new 
iBuildTime get_pcvar_numg_pcvar_buildtime );
    
set_task(1.0"CountDown"30000""0"a"iBuildTime);
    
count_down = (iBuildTime-1);
    
set_task(float(iBuildTime), "Release_Zombies"TASK_ROUND)
    
    if (
get_pcvar_num(g_pcvar_basecalc) == 1)
        
set_task(5.0"Base_Calc")
        
    
set_task(5.0"Fix_Spawns")
    
    
g_CanBuild true

    arrayset
(g_MovingEntfalseMAXENTS)
    
arrayset(g_EntOwner0MAXENTS)
    
arrayset(g_OwnedEnts0g_MaxPlayers+1)
}

public 
native_build_time() return g_CanBuild

public CountDown()
{
    
set_hudmessage(255255255, -1.00.000.10.90.10.23)
    
show_hudmessage(0"%L"LANG_SERVER"BUILD_TIME"count_down--);
    
    if (
count_down 0)
    {
        
remove_task(30000);
    }
}

//Resets stuff and swaps teams so they respawn correctly
public logevent_round_end()
{
    if (!
g_CanBuild && get_pcvar_num(g_pcvar_tournymode) != 1)
    {
        new 
players[32], num
        get_players
(playersnum)
        
        new 
player
        
for (new 0numi++)
        {
            
player players[i]
            
cs_set_user_team(playercs_get_user_team(player) == CS_TEAM_T CS_TEAM_CT:CS_TEAM_T)
            
            if (
cs_get_user_team(player) == CS_TEAM_T)
            {
                
g_iszombie[player] = true
                g_ishuman
[player] = false
            
}
            if (
cs_get_user_team(player) == CS_TEAM_CT)
            {
                
g_ishuman[player] = true
                g_iszombie
[player] = false
            
}
        }
        
print_color(0"^x04%L"LANG_SERVER"TEAMS_SWAPPED")
    }
    
    
remove_task(TASK_ROUND)
    
remove_task(30000)
        
    return 
PLUGIN_HANDLED
}

//Death events for respanws and HUD information
public client_death(g_attackerg_victimwpnindexhitplaceTK)
{
    
cmdStopEnt(g_victim)
    
    
set_hudmessage(__________4);
    
show_hudmessage(g_victim"");
    
    
g_isalive[g_victim] = false
    
    
if (g_iszombie[g_victim])
    {
        
set_hudmessage(255255255, -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_ishuman[g_victim])
    {
        
set_hudmessage(255255255, -1.00.4501.010.00.10.21)
        
show_hudmessage(g_victim"%L"LANG_SERVER"DEAD_SURVIVOR");
    }
}

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 
client_disconnect(id)
{
    
cmdStopEnt(id)

    
g_isconnected[id] = false
    g_isalive
[id] = false
    g_ishuman
[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
    ask
[id] = true
}

public 
Release_Zombies()
{
    
g_CanBuild false
    g_ZombiesReleased 
true
    remove_task
(30000);
    
    new 
players[32], num
    get_players
(playersnum)

    new 
player
    
for(new 0numi++)
    {
        
player players[i]
        if (
g_isalive[player])
        {
            if (
get_user_godmode(player))
                
set_user_godmode(player0)
            if (
g_ishuman[player])
            {
                
cmdStopEnt(player)

                new 
weapon[32]
                
get_pcvar_string(g_pcvar_givenades,weapon,31)
            
                new 
heflashsmoke
                
for(new i=0;i<strlen(weapon);i++)
                {
                    switch(
weapon[i])
                    {
                        case 
'h'he++
                        case 
'f'flash++
                        case 
's'smoke++
                    }
                }
                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)
    
DispatchKeyValue(g_iEntBarrier"renderamt""0");
    
    
g_RoundNum++
    
set_hudmessage(255255255, -1.00.4501.010.00.10.21)
    
show_hudmessage(0"%L"LANG_SERVER"RELEASE_MSG");
    
client_cmd(0"spk %s"g_RoundStart)
}

//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) == get_pcvar_float(g_pcvar_zombiehp) || !is_user_alive(id))
            
ExecuteHamB(Ham_CS_RoundRespawnid)
        else
            
client_print(idprint_center"%L"LANG_SERVER"FAIL_RESPAWN");
    }
}

//Called on all players 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 (
cs_get_user_team(id) == CS_TEAM_T)
    {
        if (
g_CanBuild)
            
set_user_godmode(id1)

        
set_pev(idpev_healthget_pcvar_float(g_pcvar_zombiehp)) // use decimal number
    
}
    if (
cs_get_user_team(id) == CS_TEAM_CT)
    {
        
weapon_method_menu(id)
    }
    
ShowHealth(id)
    return 
PLUGIN_HANDLED
}

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


public 
fw_GetGameDescription()
{
    
forward_return(FMV_STRINGg_ModName)
    
    return 
FMRES_SUPERCEDE;
}

public 
ham_PlayerSpawn_Post(id)
{
    if (!
is_user_alive(id) || !cs_get_user_team(id))
        return
        
    
set_task(1.0"Add_Effects"id)
    if (
cs_get_user_team(id) == CS_TEAM_CT)
    {
        
g_ishuman[id] = true
        g_iszombie
[id] = false
    
}
    if (
cs_get_user_team(id) == CS_TEAM_T)
    {
        
g_iszombie[id] = true
        g_ishuman
[id] = false
    
}
        
    
g_isalive[id] = true
    remove_task
(id MODELSET_TASK)
    if (
g_iszombie[id])
    {
        
copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_ZombieModel)
        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))
}

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))
                
//return PLUGIN_HANDLED 
            
}
        }
        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], entOrigin[3], Float:orig[3], Float:mins[3], Float:maxs[3], dist
    
    entity_get_vector
(entEV_VEC_originorig);
    
entity_get_vector(entEV_VEC_minsmins);
    
entity_get_vector(entEV_VEC_maxsmaxs);

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

    
dist get_distance(originentOrigin);
    
    new 
max get_pcvar_num(g_pcvar_entmaxdist)
    new 
min get_pcvar_num(g_pcvar_entmindist)
    if (
min//min
    
{
        if(
dist min//minimum
            
dist get_pcvar_num(g_pcvar_entsetdist);
    }

    if (
max//maximum
    
{
        if (
dist max)
            return 
PLUGIN_HANDLED
    
}
    
    
DispatchKeyValue(ent"rendermode""1");
    
DispatchKeyValue(ent"renderamt""100");
    
DispatchKeyValue(ent"rendercolor""135.0 206.0 235.0");

    
g_MovingEnt[ent] = true
    g_EntMover
[ent] = id
    g_pEnt
[id] = ent
    g_pDist
[id] = dist
    
    
if (!g_CanBuild && access(idAFTER_BUILD))
    {
        new 
adminauthid[35],adminname[35]
        
get_user_authid (id,adminauthid,34)
        
get_user_name(id,adminname,34)
        
Log("[MOVE] Admin: %s || SteamID: %s moved an entity"adminnameadminauthid)
    }
    
    return 
PLUGIN_HANDLED
}

/*public fw_CmdStart(id, uc, random)
{
    new buttons = get_uc(uc, UC_Buttons)
    if(g_CanBuild && (buttons & IN_ATTACK))
    {
        buttons &= ~IN_ATTACK
        set_uc(uc, UC_Buttons, buttons)
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}*/

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;
        
        if (
g_pDist[id] > get_pcvar_num(g_pcvar_entmaxdist))
        {
            
g_pDist[id] = get_pcvar_num(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;
            
        if (
g_pDist[id] < get_pcvar_num(g_pcvar_entsetdist))
        {
            
g_pDist[id] = get_pcvar_num(g_pcvar_entsetdist)
            
client_print(idprint_center"%L"LANG_SERVER"OBJECT_MIN")
        }
        else
            
client_print(idprint_center"%L"LANG_SERVER"OBJECT_PULL")
    }
    
    
GrabThink(id)
    
    return 
FMRES_HANDLED
}

public 
GrabThink(id)
{
    new 
Float:aiming[3], origin[3], Float:mins[3], Float:maxs[3], Float:neworigin[3], ent
    
    ent 
g_pEnt[id]

    if (!
g_isconnected[id] || (ent <= g_MaxPlayers)? !g_isconnected[id]:!is_valid_ent(ent))
    {
        
cmdStopEnt(id)
        return 
PLUGIN_HANDLED
    
}
    
    
entity_get_vector(entEV_VEC_minsmins);
    
entity_get_vector(entEV_VEC_maxsmaxs);
    
    
get_user_origin(idorigin3);
    
IVecFVec(originaiming);
    
get_user_origin(idorigin);
    
    
aiming[0] -= float(origin[0]);
    
aiming[1] -= float(origin[1]);
    
aiming[2] -= float(origin[2]);

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

    
origin[0] += floatround(aiming[0] * scalar - (mins[0] + maxs[0]) / 2);
    
origin[1] += floatround(aiming[1] * scalar - (mins[1] + maxs[1]) / 2);
    
origin[2] += floatround(aiming[2] * scalar - (mins[2] + maxs[2]) / 2);
    
    
IVecFVec(originneworigin);
    
entity_set_origin(entneworigin);
    
    return 
PLUGIN_CONTINUE
}

public 
cmdStopEnt(id)
{
    
g_MovingEnt[g_pEnt[id]] = false
    DispatchKeyValue
(g_pEnt[id], "rendermode""0");
    
DispatchKeyValue(g_pEnt[id], "renderamt""255");
    
DispatchKeyValue(g_pEnt[id], "rendercolor""0.0 0.0 0.0");
    if (
get_pcvar_num(g_pcvar_blockgrav) == 1)
        
drop_to_floor(g_pEnt[id])
    
g_EntMover[g_pEnt[id]] = 0
    g_LastMover
[g_pEnt[id]] = id
    g_pEnt
[id] = 0
}

public 
fw_Traceline(Float:start[3], Float:end[3], conditionsidtrace)
{
    if (!
is_user_connected(id)) return PLUGIN_HANDLED
    
    
new ent get_tr2(traceTR_pHit)
    
    if (
pev_valid(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(25500, -1.00.5510.013.00.010.01);
                    
ShowSyncHudMsg(idgHudSyncInfo"%L"LANG_SERVER"OBJECT_LOCKED");
                    return 
PLUGIN_HANDLED
                
}
                
set_hudmessage(050255, -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");
                    }
                }
            }
        }
    }
    if (!
pev_valid(ent)) 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)
        
DispatchKeyValue(ent"rendermode""1");
        
DispatchKeyValue(ent"rendercolor""125.0 0.0 0.0");
        
        
g_OwnedEnts[g_EntOwner[ent]]--
        
g_EntOwner[ent] = 0
    
}
    else if (
IsBlockLocked(ent))
    {
        
UnlockBlock(ent)
        
DispatchKeyValue(ent"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("[REMOVE] Admin: %s || SteamID: %s removed an entity"adminnameadminauthid)
    
    return 
PLUGIN_HANDLED
}

// 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_ishuman[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(255255255, -1.00.4006.06.00.10.21)
    
    if(
equal(Message"#Game_bomb_drop"))
        return 
PLUGIN_HANDLED
    
    
if (equal(Message"#Terrorists_Win"))
    {
        
show_hudmessage(0"Zombies Win!")
        
set_msg_arg_string(2"")
        switch (
random_num(14))
        {
            case 
1client_cmd(0"spk ambience/the_horror1.wav")
            case 
2client_cmd(0"spk ambience/the_horror2.wav")
            case 
3client_cmd(0"spk ambience/the_horror3.wav")
            case 
4client_cmd(0"spk ambience/the_horror4.wav")
        }
        return 
PLUGIN_HANDLED
    
}
    else if (
equal(Message"#Target_Saved") || equal(Message"#CTs_Win"))
    {
        
show_hudmessage(0"Builders Win!")
        
set_msg_arg_string(2"")
        switch (
random_num(13))
        {
            case 
1client_cmd(0"spk barney/ba_another.wav")
            case 
2client_cmd(0"spk barney/ba_firepl.wav")
            case 
3client_cmd(0"spk barney/ba_seethat.wav")
        }
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}

public 
ham_WeaponCleaner_Post(iEntity)
{
    
call_think(iEntity)
}

public 
message_show_menu(msgiddestid
{
    if (!
should_autojoin(id))
        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

    set_force_team_join_task
(idmsgid)

    return 
PLUGIN_HANDLED
}

public 
message_vgui_menu(msgiddestid
{
    if (
get_msg_arg_int(1) != TEAM_SELECT_VGUI_MENU_ID || !should_autojoin(id))
        return 
PLUGIN_CONTINUE
        
    set_force_team_join_task
(idmsgid)

    return 
PLUGIN_HANDLED
}

bool:should_autojoin(id
{
    return (!
get_user_team(id))
}

set_force_team_join_task(idmenu_msgid
{
    static 
param_menu_msgid[2]
    
param_menu_msgid[0] = menu_msgid
    set_task
(AUTO_TEAM_JOIN_DELAY"task_force_team_join"idparam_menu_msgidsizeof param_menu_msgid)
}

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

    static 
team[2], class[2]
    
get_pcvar_string(g_pcvar_teamteamsizeof team 1)
    
get_pcvar_string(g_pcvar_class, class, sizeof class - 1)
    
force_team_join(idmenu_msgid[0], team, class)
}

stock force_team_join(idmenu_msgid/* const */ team[] = "5"/* const */ class[] = "0"
{
    static 
jointeam[] = "jointeam"
    
if (class[0] == '0') {
        
engclient_cmd(idjointeamteam)
        return
    }

    static 
msg_blockjoinclass[] = "joinclass"
    
msg_block get_msg_block(menu_msgid)
    
set_msg_block(menu_msgidBLOCK_SET)
    
engclient_cmd(idjointeamteam)
    
engclient_cmd(idjoinclass, class)
    
set_msg_block(menu_msgidmsg_block)
}

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

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 
fw_Suicide(id)
{
    
client_print (idprint_center"%L"LANG_SERVER"FAIL_SUICIDE")
    
console_print (id"%L"LANG_SERVER"FAIL_SUICIDE")
    return 
FMRES_SUPERCEDE;
}

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 
cmdBadSpawn_Survivor(id)
{
    if (
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)
        }
    }
}

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 
cmdBadSpawn(id)
{
    if (
g_isconnected[id] && g_ishuman[id] && g_CanBuild)
        
ExecuteHamB(Ham_CS_RoundRespawnid)
}

public 
cmdBadSpawn_Zombie(id)
{
    if (
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)
        }
    }
}

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

public 
cmdBuildBan(id)
{
    if (
access(idBUILD_BAN))
    {
        new 
arg[32]
        
read_argv(1arg31)
        new 
player cmd_target(idargCMDTARGET_OBEY_IMMUNITY)
        
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("[MOVE] 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_OBEY_IMMUNITY)
        
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_OBEY_IMMUNITY)

        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("[REVIVE] 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 
cmdSwap(id)
{
    if (
access(idSWAP))
    {
        new 
arg[32]
        
read_argv(1arg31)
        new 
player cmd_target(idargCMDTARGET_OBEY_IMMUNITY)

        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)
            
        if (
cs_get_user_team(player) == CS_TEAM_T)
        {
            
g_iszombie[player] = true
            g_ishuman
[player] = false
        
}
        if (
cs_get_user_team(player) == CS_TEAM_CT)
        {
            
g_ishuman[player] = true
            g_iszombie
[player] = 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("[TEAM-SWAP] 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("[START_ROUND] 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 
cmdCheckRound(id)
{
    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)
}

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);
    new 
stats[8],bodyhits[8]
    
    
get_user_name(pidname31);
    new 
color1 0color2 0;

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

    new 
Float:height=0.35
    
//height=0.60

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

        if (
wpnid)
            
xmod_get_wpnname(wpnidwpnname31);

        new 
rank get_user_stats(pidstatsbodyhits)
        
        if(
g_iszombie[id])
        {
            
set_hudmessage(color150color2, -1.0height10.013.00.010.01);
            
ShowSyncHudMsg(idgHudSyncInfo"> ZOMBIE <^n%L"LANG_SERVER"PLAYER_INFO1"namerankget_user_health(pid), wpnname);
        }
        else if(
g_ishuman[id])
        {
            
set_hudmessage(color150color2, -1.0height10.013.00.010.01);
            
ShowSyncHudMsg(idgHudSyncInfo"> BUILDER <^n%L"LANG_SERVER"PLAYER_INFO1"namerankget_user_health(pid), wpnname);
        }
            
    } 
    if (
g_friend[id] != 1//enemy
    
{
        new 
clipammowpnid get_user_weapon(pidclipammo);
        new 
wpnname[32];

        if (
wpnid)
            
xmod_get_wpnname(wpnidwpnname31);

        new 
rank get_user_stats(pidstatsbodyhits)
        
        if(
g_iszombie[id])
        {
            
set_hudmessage(color150color2, -1.0height10.013.00.010.01);
            
ShowSyncHudMsg(idgHudSyncInfo"> BUILDER <^n%L"LANG_SERVER"PLAYER_INFO2"namerankget_user_health(pid), wpnname);
        }
        else if(
g_ishuman[id])
        {
            
set_hudmessage(color150color2, -1.0height10.013.00.010.01);
            
ShowSyncHudMsg(idgHudSyncInfo"> ZOMBIE <^n%L"LANG_SERVER"PLAYER_INFO2"namerankget_user_health(pid), wpnname);
        }
    }
}

public 
ev_HideStatus(id)
{
    
ClearSyncHud(idgHudSyncInfo);
}

public 
weapon_method_menu(id)
{
    if(
firsttime[id])
    {
        
firsttime[id] = false
        prim_weapons_menu
(id,0)
    }
    else
    {
        
cur_offset[id] = 0
        
if(ask[id])
        {
            
show_menu(id,(1<<0)|(1<<1)|(1<<2),"Weapon Selection Method^n^n1. New Guns^n2. Last Guns^n3. Last Guns + Save",-1,"WeaponMethodMenu")
        }
        else
        {
            
give_weapons(id)
        }
    }
}

public 
weapon_method_pushed(id,key)
{
    switch(
key)
    {
        case 
0:
        {
            
ask[id] = true
            prim_weapons_menu
(id,0)
        }    
        case 
1:
        {
            
ask[id] = true
            give_weapons
(id)
        }
        case 
2:
        {
            
print_color(id"%s %L"formatmodnameLANG_SERVER"GUNS_MSG")
            
ask[id] = false
            give_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,"\yPrimary Weapon:\w^n%s^n",menu)
    if(
curnum==&& offset<12)
    {
        
keys += (1<<8)
        
format(menu,2047,"%s^n9. Next",menu)
    }
    if(
offset)
    {
        
keys += (1<<9)
        
format(menu,2047,"%s^n0. Back",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,"\ySecondary Weapon:\w^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;
}


public 
cmdGuns(id)
{
    if(!
g_isalive[id] || !g_isconnected[id] || !g_CanBuild)
        return 
PLUGIN_HANDLED
    
    
if(!g_ishuman[id])
        return 
PLUGIN_HANDLED    

    ask
[id] = true
    weapon_method_menu
(id)
    return 
PLUGIN_HANDLED
}

public 
ev_Health(id)
{
    
ShowHealth(id);
}

public 
ShowHealth(id)
{
    if (
is_user_alive(id))
    {
        new 
Float:hud_time get_pcvar_float(g_pcvar_healthtime);
        
        
set_hudmessage(255255255, -1.00.90hud_timehud_time0.10.24);
        
show_hudmessage(id"%L"LANG_SERVER"PLAYER_HEALTH"get_user_health(id));
        
        
set_task(hud_time 0.1"ShowHealth"id);
    }
}

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/BB_ACTIVITY_%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()
    }
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1030\\ f0\\ fs16 \n\\ par }
*/ 
You can download it from attachments too
Attached Files
File Type: sma Get Plugin or Get Source (basebuilder54 (4).sma - 25 views - 50.3 KB)
File Type: inc basebuilder.inc (9.4 KB, 16 views)
__________________
CS:CZ > CS 1.6

Last edited by Ace67; 03-13-2023 at 12:06.
Ace67 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 05:38.


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