Raised This Month: $ Target: $400
 0% 

Exolent Hidenseek 3.0 BETA


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D-TOX
Member
Join Date: Mar 2008
Old 11-23-2009 , 11:38   Exolent Hidenseek 3.0 BETA
Reply With Quote #1

Because I don't get any answer from exolent ill try to make a thread.
I've got this bug where T's switches to CT if they kill all the CT's :S
Or sometimes totally random T's switches to the CT team even if they won.


http://forums.alliedmods.net/showpos...&postcount=811

Theres the thread unt ze .sma

Thanks in advance !
__________________
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░█▀▀ ░█▀█ ░█ ░█▀▀ ░░█▀▀ ░█▀█ ░█ ░█░░░
░█▀▀ ░█▀▀ ░█ ░█ ░░░░█▀▀ ░█▀█ ░█ ░█░░░
░▀▀▀ ░▀ ░░░▀ ░▀▀▀ ░░▀ ░░░▀░▀ ░▀ ░▀▀▀░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
D-TOX is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-23-2009 , 11:53   Re: Exolent Hidenseek 3.0 BETA
Reply With Quote #2

Try this version.
PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < engine >
#include < fun >
#include < fakemeta >
#include < hamsandwich >

new const PLUGIN_NAME[ ] = "HideNSeek";
new const 
PLUGIN_VERS[ ] = "3.0.0";
new const 
PLUGIN_AUTH[ ] = "Exolent";

const 
FFADE_IN 0x0000;

const 
m_pPlayer 41;
const 
OFFSET_WEAPONS 4;

const 
m_iHideHUD 361;
const 
HIDE_MONEY = ( << );

const 
m_pActiveItem 373;

enum // StatusValue flags for first argument
{
    
SV_FLAG_TEAMMATE 1,
    
SV_FLAG_PLAYERID,
    
SV_FLAG_PLAYERHP
};

enum // StatusValue values for the SV_FLAG_TEAMMATE flag
{
    
SV_TEAMVALUE_FRIEND 1,
    
SV_TEAMVALUE_ENEMY,
    
SV_TEAMVALUE_HOSTAGE
};

enum NadeTypes
{
    
NADE_HE,
    
NADE_FL,
    
NADE_SM
};

new const 
g_szNadeNamesNadeTypes ][ ] =
{
    
"HE Grenade",
    
"Flashbang",
    
"Smoke Grenade"
};

new const 
g_iNadeIdsNadeTypes ] =
{
    
CSW_HEGRENADE,
    
CSW_FLASHBANG,
    
CSW_SMOKEGRENADE
};

new const 
g_iNadeLimitNadeTypes ] =
{
    
1,
    
2,
    
1
};

new const 
g_szNadeWeaponNamesNadeTypes ][ ] =
{
    
"weapon_hegrenade",
    
"weapon_flashbang",
    
"weapon_smokegrenade"
};

enum NadeInfo
{
    
NADE_COUNT,
    
NADE_CHANCE
};

enum ArmorInfo
{
    
ARMOR_VALUE,
    
CsArmorType:ARMOR_TYPE
};

new const 
g_szTeamToCvarCsTeams ][ ] =
{
    
"",
    
"hider",
    
"seeker",
    
""
};

new const 
g_szNadeTypeToCvarNadeTypes ][ ] =
{
    
"grenade",
    
"flash",
    
"smoke"
};

new const 
g_szNadeInfoToCvarNadeInfo ][ ] =
{
    
"count",
    
"chance"
};

new const 
g_szArmorInfoToCvarArmorInfo ][ ] =
{
    
"value",
    
"type"
};

enum
{
    
R,
    
G,
    
B,
    
A
};

enum ( += 1000 )
{
    
TASK_ID_BLANK 0,
    
    
TASK_ID_HIDETIMER,
    
TASK_ID_SWAPTEAMS,
    
    
TASK_ID_CHECKMODEL,
    
TASK_ID_GIVEWEAPONS,
    
TASK_ID_PLUGININFO
};

new const 
g_iPlayerTasks[ ] =
{
    
TASK_ID_CHECKMODEL,
    
TASK_ID_GIVEWEAPONS,
    
TASK_ID_PLUGININFO
};

new 
g_iHideTimer;

const 
SWAP_PER_INTERVAL 5;
const 
Float:SWAP_INTERVAL 0.5;
new 
g_iSwapStartIndex;

new 
bool:g_bSpawnedOnce33 ];

new 
bool:g_bWeaponsGiven;

new 
g_iRoundsLost;
new 
bool:g_bDisableSlash true;

new 
Trie:g_tTeamModelsCsTeams ];

new 
Trie:g_tRemoveEntities;

new 
g_iMsgId_SayText;
new 
g_iMsgId_ScoreInfo;
new 
g_iMsgId_ScreenFade;
new 
g_iMsgId_StatusText;
new 
g_iMsgId_StatusValue;

new 
g_iMaxPlayers;

new 
pCvar_NoSlow;
new 
pCvar_HideTime;
new 
pCvar_Money;
new 
pCvar_SilentFeet;
new 
pCvar_NubSlash;
new 
pCvar_TimerSpeech;
new 
pCvar_DisableKill;
new 
pCvar_HiderSurviveFrags;
new 
pCvar_GameType;
new 
pCvar_ChatPrefix;
new 
pCvar_ColorHud;
new 
pCvar_ColorBlind;
new 
pCvar_HiderKnifeVisible;
new 
pCvar_NadeInfoCsTeams ][ NadeTypes ][ NadeInfo ];
new 
pCvar_ArmorInfoCsTeams ][ ArmorInfo ];

/* Cached cvar variables + their default values */

new bool:g_bNoSlow false;

new 
g_iHideTime 10;

new 
g_iMoneyValue 0// -1 = don't change money, 0 = hide money and set to 0, > 0 = set to that value

new g_iSilentFeet = ( << _:CS_TEAM_T );

new 
g_iNubSlashRounds 3// 0 to allow slashing, -1 for forever disable slashing

new bool:g_bTimerSpeech true;

new 
bool:g_bDisableKillCommand true;

new 
g_iHiderSurviveFrags 1;

new 
g_szGameType32 ] = "HideNSeek";

new 
g_szChatPrefix16 ] = "[ HNS ]";

new 
g_iHudColors] =
{
    
0,    // Red
    
255,    // Green
    
0    // Blue
};

new 
g_iBlindColors] =
{
    
0,    // Red
    
0,    // Green
    
0,    // Blue
    
255    // Alpha
};

new 
bool:g_bVisibleTerrKnife true;

new 
g_iNadeInfoCsTeams ][ NadeTypes ][ NadeInfo ] =
{
    
// Spectator
    
{
        
// HE
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Flash
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Smoke
        
{
            
0,    // Count
            
0    // Chance
        
}
    },
    
// Hider
    
{
        
// HE
        
{
            
1,    // Count
            
100    // Chance
        
},
        
// Flash
        
{
            
2,    // Count
            
100    // Chance
        
},
        
// Smoke
        
{
            
1,    // Count
            
100    // Chance
        
}
    },
    
// Seeker
    
{
        
// HE
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Flash
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Smoke
        
{
            
0,    // Count
            
0    // Chance
        
}
    },
    
// Spectator
    
{
        
// HE
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Flash
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Smoke
        
{
            
0,    // Count
            
0    // Chance
        
}
    }
};

new 
g_iArmorInfoCsTeams ][ ArmorInfo ] =
{
    
// Spectator
    
{
        
// Value
        
0,
        
// Type
        
CS_ARMOR_NONE
    
},
    
// Hider
    
{
        
// Value
        
100,
        
// Type
        
CS_ARMOR_VESTHELM
    
},
    
// Seeker
    
{
        
// Value
        
100,
        
// Type
        
CS_ARMOR_VESTHELM
    
},
    
// Spectator
    
{
        
// Value
        
0,
        
// Type
        
CS_ARMOR_NONE
    
}
};

/* End of cvars */

RegisterCvars( )
{
    new 
szValue32 ];
    
    
num_to_str_:g_bNoSlowszValue31 );
    
pCvar_NoSlow register_cvar"hns_noslow"szValue );
    
    
num_to_strg_iHideTimeszValue31 );
    
pCvar_HideTime register_cvar"hns_hidetime"szValue );
    
    
num_to_strg_iMoneyValueszValue31 );
    
pCvar_Money register_cvar"hns_money"szValue );
    
    
num_to_strg_iSilentFeetszValue31 );
    
pCvar_SilentFeet register_cvar"hns_silentfeet"szValue );
    
    
num_to_strg_iNubSlashRoundsszValue31 );
    
pCvar_NubSlash register_cvar"hns_nubslash"szValue );
    
    
num_to_str_:g_bTimerSpeechszValue31 );
    
pCvar_TimerSpeech register_cvar"hns_timer_speech"szValue );
    
    
num_to_str_:g_bDisableKillCommandszValue31 );
    
pCvar_DisableKill register_cvar"hns_disable_kill"szValue );
    
    
num_to_strg_iHiderSurviveFragsszValue31 );
    
pCvar_HiderSurviveFrags register_cvar"hns_hider_survive_frags"szValue );
    
    
pCvar_GameType register_cvar"hns_gametype"g_szGameType );
    
    
pCvar_ChatPrefix register_cvar"hns_chat_prefix"g_szChatPrefix );
    
    new 
iLen;
    for( new 
0sizeofg_iHudColors ); i++ )
    {
        
iLen += formatexszValueiLen ], 31 iLen"%s%i"iLen " " ""g_iHudColors] );
    }
    
pCvar_ColorHud register_cvar"hns_color_hud"szValue );
    
    
iLen 0;
    for( new 
0sizeofg_iBlindColors ); i++ )
    {
        
iLen += formatexszValueiLen ], 31 iLen"%s%i"iLen " " ""g_iBlindColors] );
    }
    
pCvar_ColorBlind register_cvar"hns_color_blind"szValue );
    
    
num_to_str_:g_bVisibleTerrKnifeszValue31 );
    
pCvar_HiderKnifeVisible register_cvar"hns_hider_knife_visible"szValue );
    
    new 
NadeTypes:iNadeTypeNadeInfo:iNadeInfoszCvar64 ];
    for( new 
CsTeams:iTeam CS_TEAM_TiTeam <= CS_TEAM_CTiTeam++ )
    {
        for( 
iNadeType NadeTypes:0iNadeType NadeTypesiNadeType++ )
        {
            for( 
iNadeInfo NadeInfo:0iNadeInfo NadeInfoiNadeInfo++ )
            {
                
formatexszCvar63"hns_%s_%s_%s"g_szTeamToCvariTeam ], g_szNadeTypeToCvariNadeType ], g_szNadeInfoToCvariNadeInfo ] );
                
num_to_strg_iNadeInfoiTeam ][ iNadeType ][ iNadeInfo ], szValue31 );
                
                
pCvar_NadeInfoiTeam ][ iNadeType ][ iNadeInfo ] = register_cvarszCvarszValue );
            }
        }
    }
    
    new 
ArmorInfo:iArmorInfo;
    for( new 
CsTeams:iTeam CS_TEAM_TiTeam <= CS_TEAM_CTiTeam++ )
    {
        for( 
iArmorInfo ArmorInfo:0iArmorInfo ArmorInfoiArmorInfo++ )
        {
            
formatexszCvar63"hns_%s_armor_%s"g_szTeamToCvariTeam ], g_szArmorInfoToCvariArmorInfo ] );
            
num_to_strg_iArmorInfoiTeam ][ iArmorInfo ], szValue31 );
            
            
pCvar_ArmorInfoiTeam ][ iArmorInfo ] = register_cvarszCvarszValue );
        }
    }
}

CacheCvars( )
{
    static 
szColor16 ], szPart], iCsTeams:iTeamNadeTypes:iNadeTypeNadeInfo:iNadeInfoArmorInfo:iArmorInfo;
    
    
g_bNoSlow bool:get_pcvar_numpCvar_NoSlow );
    
g_iHideTime get_pcvar_numpCvar_HideTime );
    
g_iMoneyValue get_pcvar_numpCvar_Money );
    
g_bVisibleTerrKnife bool:get_pcvar_numpCvar_HiderKnifeVisible );
    
g_iSilentFeet get_pcvar_numpCvar_SilentFeet );
    
g_iNubSlashRounds get_pcvar_numpCvar_NubSlash );
    
g_bTimerSpeech bool:get_pcvar_numpCvar_TimerSpeech );
    
g_bDisableKillCommand bool:get_pcvar_numpCvar_DisableKill );
    
g_iHiderSurviveFrags get_pcvar_numpCvar_HiderSurviveFrags );
    
get_pcvar_stringpCvar_GameTypeg_szGameType31 );
    
get_pcvar_stringpCvar_ChatPrefixg_szChatPrefix15 );
    
    
get_pcvar_stringpCvar_ColorHudszColor15 );
    
//parse( szColor, szParts[ R ], 3, szParts[ G ], 3, szParts[ B ], 3 );
    
for( 0sizeofg_iHudColors ); i++ )
    {
        
strbreakszColorszPart3szColor15 );
        
g_iHudColors] = clampstr_to_numszPart ), 0255 );
    }
    
    
get_pcvar_stringpCvar_ColorBlindszColor15 );
    
//parse( szColor, szParts[ R ], 3, szParts[ G ], 3, szParts[ B ], 3, szParts[ A ], 3 );
    
for( 0sizeofg_iBlindColors ); i++ )
    {
        
strbreakszColorszPart3szColor15 );
        
g_iBlindColors] = clampstr_to_numszPart ), 0255 );
    }
    
    for( 
iTeam CS_TEAM_TiTeam <= CS_TEAM_CTiTeam++ )
    {
        for( 
iNadeType NadeTypes:0iNadeType NadeTypesiNadeType++ )
        {
            for( 
iNadeInfo NadeInfo:0iNadeInfo NadeInfoiNadeInfo++ )
            {
                
g_iNadeInfoiTeam ][ iNadeType ][ iNadeInfo ] = get_pcvar_numpCvar_NadeInfoiTeam ][ iNadeType ][ iNadeInfo ] );
            }
        }
        
        for( 
iArmorInfo ArmorInfo:0iArmorInfo ArmorInfoiArmorInfo++ )
        {
            
g_iArmorInfoiTeam ][ iArmorInfo ] = get_pcvar_numpCvar_ArmorInfoiTeam ][ iArmorInfo ] );
        }
    }
}

public 
plugin_precache( )
{
    new 
iEntity create_entity"hostage_entity" );
    
entity_set_originiEntityFloat:{ 0.00.0, -55000.0 } );
    
entity_set_sizeiEntityFloat:{ -1.0, -1.0, -1.0 }, Float:{ 1.01.01.0 } );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"player_weaponstrip" );
    
DispatchKeyValueiEntity"targetname""stripper" );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"game_player_equip" );
    
DispatchKeyValueiEntity"weapon_knife""1" );
    
DispatchKeyValueiEntity"targetname""equipment" );
    
    
iEntity create_entity"multi_manager" );
    
DispatchKeyValueiEntity"stripper""0" );
    
DispatchKeyValueiEntity"equipment""0.5" );
    
DispatchKeyValueiEntity"targetname""game_playerspawn" );
    
DispatchKeyValueiEntity"spawnflags""1" );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"info_map_parameters" );
    
DispatchKeyValueiEntity"buying""3" );
    
DispatchSpawniEntity );
    
    new const 
szRemoveEntities[][] =
    {
        
"func_bomb_target",
        
"info_bomb_target",
        
"hostage_entity",
        
"monster_scientist",
        
"func_hostage_rescue",
        
"info_hostage_rescue",
        
"info_vip_start",
        
"func_vip_safetyzone",
        
"func_escapezone",
        
"armoury_entity",
        
"info_map_parameters",
        
"player_weaponstrip",
        
"game_player_equip",
        
"func_buyzone"
    
};
    
    
g_tRemoveEntities TrieCreate( );
    
    for( new 
0sizeofszRemoveEntities ); i++ )
    {
        
TrieSetCellg_tRemoveEntitiesszRemoveEntities], );
    }
    
    
register_forwardFM_Spawn"FwdSpawn" );
}

public 
FwdSpawniEntity )
{
    static 
szClassname32 ];
    
entity_get_stringiEntityEV_SZ_classnameszClassname31 );
    
    if( 
TrieKeyExistsg_tRemoveEntitiesszClassname ) )
    {
        
remove_entityiEntity );
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

public 
pfn_keyvalueiEntity )
{
    static 
szClassname32 ], szKey32 ], szValue32 ];
    
copy_keyvalueszClassname31szKey31szValue31 );
    
    if( 
equalszClassname"multi_manager" )
    && 
equalszKey"targetname" )
    && 
equalszValue"game_playerspawn" ) )
    {
        
remove_entityiEntity );
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
plugin_init( )
{
    
register_pluginPLUGIN_NAMEPLUGIN_VERSPLUGIN_AUTH );
    
register_cvarPLUGIN_NAMEPLUGIN_VERS, ( FCVAR_SERVER FCVAR_SPONLY ) );
    
    
register_event"HLTV""EventNewRound""a""1=0""2=0" );
    
register_event"TextMsg""EventRoundRestart""a""2&#Game_C""2&#Game_w" );
    
register_event"SendAudio""EventHidersWin""a""2=%!MRAD_terwin" );
    
register_event"ResetHUD""EventResetHud""be" );
    
register_event"Money""EventMoney""be" );
    
    
register_logevent"EventRoundStart"2"1=Round_Start" );
    
register_logevent"EventRoundEnd"2"1=Round_End" );
    
    
RegisterHamHam_Item_Deploy"weapon_knife""FwdKnifeDeploy");
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_knife""FwdKnifePrimAttack" );
    
RegisterHamHam_Weapon_SecondaryAttack"weapon_knife""FwdKnifeSecAttack" );
    
    
RegisterHamHam_Spawn"player""FwdPlayerSpawn");
    
    
register_forwardFM_GetGameDescription"FwdGetGameDescription" );
    
    
g_iMsgId_SayText get_user_msgid"SayText" );
    
g_iMsgId_ScoreInfo get_user_msgid"ScoreInfo" );
    
g_iMsgId_ScreenFade get_user_msgid"ScreenFade" );
    
g_iMsgId_StatusText get_user_msgid"StatusText" );
    
g_iMsgId_StatusValue get_user_msgid"StatusValue" );
    
    
set_msg_blockget_user_msgid"HostagePos" ), BLOCK_SET );
    
set_msg_blockg_iMsgId_StatusTextBLOCK_SET );
    
set_msg_blockg_iMsgId_StatusValueBLOCK_SET );
    
    
register_messageget_user_msgid"HideWeapon" ), "MessageHideWeapon" );
    
register_messageg_iMsgId_ScreenFade"MessageScreenFade" );
    
register_messageget_user_msgid"TextMsg" ), "MessageTextMsg" );
    
    
RegisterCvars( );
    
    
g_iMaxPlayers get_maxplayers( );
    
    new const 
szTeamModelsCsTeams ][ ][ ] =
    {
        { 
"""""""" },
        { 
"leet""arctic""terror""guerilla" },
        { 
"gign""sas""gsg9""urban" },
        { 
"""""""" }
    };
    
    new 
i;
    for( new 
CsTeams:iTeam CS_TEAM_TiTeam <= CS_TEAM_CTiTeam++ )
    {
        
g_tTeamModelsiTeam ] = TrieCreate( );
        
        for( 
04i++ )
        {
            
TrieSetCellg_tTeamModelsiTeam ], szTeamModelsiTeam ][ ], );
        }
    }
}

public 
plugin_end( )
{
    for( new 
CsTeams:iTeam CS_TEAM_TiTeam <= CS_TEAM_CTiTeam++ )
    {
        
TrieDestroyg_tTeamModelsiTeam ] );
    }
}

public 
client_disconnectclient )
{
    static 
i;
    for( 
0sizeofg_iPlayerTasks ); i++ )
    {
        
remove_taskclient g_iPlayerTasks] );
    }
    
    
g_bSpawnedOnceclient ] = false;
}

public 
client_PreThinkclient )
{
    if( 
is_user_aliveclient ) )
    {
        if( 
g_bNoSlow )
        {
            
entity_set_floatclientEV_FL_fuser20.0 );
        }
        
        static 
CsTeams:iTeam;
        
iTeam cs_get_user_teamclient );
        
        if( 
g_iSilentFeet & ( << _:iTeam ) )
        {
            
entity_set_intclientEV_INT_flTimeStepSound999 );
        }
        
        if( 
iTeam == CS_TEAM_CT )
        {
            if( 
g_iHideTimer )
            {
                
entity_set_floatclientEV_FL_maxspeed, -1.0 );
                
                static 
Float:vVelocity];
                
entity_get_vectorclientEV_VEC_velocityvVelocity );
                
                
vVelocity] = 0.0;
                
vVelocity] = 0.0;
                
                
entity_set_vectorclientEV_VEC_velocityvVelocity );
                
                
set_user_godmodeclient);
            }
            else if( 
g_iHideTimer == )
            {
                
set_user_godmodeclient);
            }
        }
        
        static 
iTargetiBody;
        
get_user_aimingclientiTargetiBody );
        
        static 
iOldTarget33 ], iResetCount33 ];
        
        if( ( 
<= iTarget <= g_iMaxPlayers ) && is_user_aliveiTarget ) )
        {
            static 
iOldbool:bIsTeammate;
            
iOld iOldTargetclient ];
            
bIsTeammate bool:( cs_get_user_teamiTarget ) == iTeam );
            
            if( !
iOld )
            {
                if( 
bIsTeammate )
                {
                    
UTIL_StatusValueclientSV_FLAG_TEAMMATESV_TEAMVALUE_FRIEND );
                }
                else
                {
                    
UTIL_StatusValueclientSV_FLAG_TEAMMATESV_TEAMVALUE_ENEMY );
                }
            }
            
            if( 
iOld != iTarget )
            {
                
iOldTargetclient ] = iTarget;
                
                
UTIL_StatusValueclientSV_FLAG_PLAYERIDiTarget );
            }
            
            if( !
iOld )
            {
                if( 
bIsTeammate )
                {
                    static 
szMessage192 ];
                    
formatexszMessage191"Friend: %%p2 - Health: %i%%%%"get_user_healthiTarget ) );
                    
                    
UTIL_StatusTextclientszMessage );
                }
                else
                {
                    
UTIL_StatusTextclient"Enemy: %p2" );
                }
            }
        }
        else if( 
iOldTargetclient ] )
        {
            
iOldTargetclient ] = 0;
            
iResetCountclient ] = 100;
        }
        else if( 
iResetCountclient ] > && --iResetCountclient ] == )
        {
            
UTIL_StatusValueclientSV_FLAG_PLAYERID);
            
UTIL_StatusTextclient"" );
        }
    }
}

public 
client_killclient )
{
    if( 
g_bDisableKillCommand )
    {
        static 
Float:fLastMessage33 ], Float:fGametime;
        
        
fGametime get_gametime( );
        
        if( 
fLastMessageclient ] >= ( fGametime 1.0 ) )
        {
            
console_printclient"You cannot kill yourself in HideNSeek!" );
            
PrintChatclient"You^3 cannot kill yourself^1 in HideNSeek!" );
            
            
fLastMessageclient ] = fGametime;
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
EventNewRound( )
{
    
CacheCvars( );
    
    if( 
g_bDisableSlash
    
&& ( g_iRoundsLost >= g_iNubSlashRounds || !g_iNubSlashRounds ) )
    {
        
g_bDisableSlash false;
        
        if( 
g_iNubSlashRounds )
        {
            
PrintChat0"The seekers have^3 lost %i round%s^1 and can now^3 use slash^1!"g_iNubSlashRoundsg_iNubSlashRounds == "" "s" );
        }
    }
    else if( !
g_bDisableSlash && g_iNubSlashRounds == -)
    {
        
g_bDisableSlash true;
    }
    
    
g_bWeaponsGiven false;
}

public 
EventRoundRestart( )
{
    
g_iHideTimer = -1;
    
    
g_iRoundsLost 0;
    
g_bDisableSlash true;
}

public 
EventHidersWin( )
{
    if( 
g_bDisableSlash )
    {
        
g_iRoundsLost++;
    }
    
    if( 
g_iHiderSurviveFrags )
    {
        static 
iiFrags;
        for( 
1<= g_iMaxPlayersi++ )
        {
            if( 
is_user_alive) && cs_get_user_team) == CS_TEAM_T )
            {
                
iFrags get_user_frags) + g_iHiderSurviveFrags;
                
                
set_user_fragsiiFrags );
                
                
UTIL_ScoreInfoiiFragscs_get_user_deaths), CS_TEAM_T );
                
                
PrintChati"You earned^3 %i frag%s^1 for surviving the round!"g_iHiderSurviveFragsg_iHiderSurviveFrags == "" "s" );
            }
        }
    }
}

public 
EventResetHudclient )
{
    if( !
g_iMoneyValue )
    {
        
UTIL_HideWeaponclientHIDE_MONEY );
    }
}

public 
EventMoneyclient )
{
    if( 
g_iMoneyValue >= )
    {
        
cs_set_user_moneyclientg_iMoneyValue_:( g_iMoneyValue ) );
        
        if( !
g_iMoneyValue )
        {
            
UTIL_HideWeaponclientHIDE_MONEY );
        }
    }
}

public 
EventRoundStart( )
{
    
remove_taskTASK_ID_HIDETIMER );
    
    
g_iHideTimer g_iHideTime;
    
    
TaskHideTimer( );
}

public 
EventRoundEnd( )
{
    
remove_taskTASK_ID_HIDETIMER );
}

public 
FwdKnifeDeployiEntity )
{
    if( !
g_bVisibleTerrKnife )
    {
        static 
client;
        
client get_pdata_cbaseiEntitym_pPlayerOFFSET_WEAPONS );
        
        if( 
cs_get_user_teamclient ) == CS_TEAM_T )
        {
            
entity_set_stringclientEV_SZ_viewmodel"" );
            
entity_set_stringclientEV_SZ_weaponmodel"" );
        }
    }
}

public 
FwdKnifePrimAttackiEntity )
{
    static 
client;
    
client get_pdata_cbaseiEntitym_pPlayerOFFSET_WEAPONS );
    
    if( 
is_user_aliveclient ) )
    {
        switch( 
cs_get_user_teamclient ) )
        {
            case 
CS_TEAM_T:
            {
                return 
HAM_SUPERCEDE;
            }
            case 
CS_TEAM_CT:
            {
                if( 
g_bDisableSlash )
                {
                    
ExecuteHamBHam_Weapon_SecondaryAttackiEntity );
                    
                    return 
HAM_SUPERCEDE;
                }
            }
        }
    }
    
    return 
HAM_IGNORED;
}

public 
FwdKnifeSecAttackiEntity )
{
    static 
client;
    
client get_pdata_cbaseiEntitym_pPlayerOFFSET_WEAPONS );
    
    if( 
is_user_aliveclient ) && cs_get_user_teamclient ) == CS_TEAM_T )
    {
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;
}

public 
FwdPlayerSpawnclient )
{
    if( 
is_user_aliveclient ) )
    {
        static 
CsTeams:iTeam;
        
iTeam cs_get_user_teamclient );
        
        if( 
iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT )
        {
            static 
iParams];
            
iParams] = _:iTeam;
            
            
set_task0.3"TaskCheckModel"client TASK_ID_CHECKMODELiParams);
            
            if( 
g_bWeaponsGiven )
            {
                
set_task0.6"TaskGiveWeapons"client TASK_ID_GIVEWEAPONSiParams);
            }
        }
        
        if( !
g_bSpawnedOnceclient ] )
        {
            
TaskShowPluginInfoclient TASK_ID_PLUGININFO );
            
            
g_bSpawnedOnceclient ] = true;
        }
    }
}

public 
FwdGetGameDescription( )
{
    if( 
g_szGameType] )
    {
        
forward_returnFMV_STRINGg_szGameType );
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

public 
MessageHideWeaponiMsgIdiDestclient )
{
    if( !
g_iMoneyValue )
    {
        
set_msg_arg_int1ARG_BYTE, ( get_msg_arg_int) | HIDE_MONEY ) );
        
        
//UTIL_HideWeapon( client, HIDE_MONEY );
    
}
}

public 
MessageScreenFadeiMsgIdiDestclient )
{
    if( 
get_msg_arg_int) == 255
    
&& get_msg_arg_int) == 255
    
&& get_msg_arg_int) == 255 )
    {
        switch( 
cs_get_user_teamclient ) )
        {
            case 
CS_TEAM_T:
            {
                return 
PLUGIN_HANDLED;
            }
            case 
CS_TEAM_CT:
            {
                if( 
g_iHideTimer )
                {
                    return 
PLUGIN_HANDLED;
                }
            }
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
MessageTextMsgiMsgIdiDestclient )
{
    static const 
szTerroristMessage[ ] = "#Terrorists_Win";
    static const 
szHostageMessage[ ] = "#Hostages_Not_Rescued";
    static const 
szCTMessage[ ] = "#CTs_Win";
    
    static 
szMessage192 ];
    
get_msg_arg_string2szMessage31 );
    
    if( 
equalszMessageszTerroristMessage )
    || 
equalszMessageszHostageMessage ) )
    {
        
set_msg_arg_string2"Hiders Win!" );
        
copyszMessage191"Hiders Won Round^nNo Team Change" );
    }
    else if( 
equalszMessageszCTMessage ) )
    {
        
set_msg_arg_string2"Seekers Win!" );
        
copyszMessage191"Seekers Won Round^nSwitching Teams" );
        
        
SwapTeams( );
    }
    else
    {
        return;
    }
    
    
set_hudmessageg_iHudColors], g_iHudColors], g_iHudColors], -1.0, -1.000.05.00.10.1);
    
show_hudmessage0"%s"szMessage );
}

public 
TaskHideTimer( )
{
    if( 
g_iHideTimer )
    {
        static 
iHideriSeeker;
        
GetHiderAndSeekeriHideriSeeker );
        
        if( !
iHider || !iSeeker )
        {
            
g_iHideTimer 0;
        }
    }
    
    static 
CsTeams:iTeamclient;
    
    if( 
g_iHideTimer )
    {
        static 
szSound16 ];
        if( 
g_bTimerSpeech )
        {
            
num_to_wordg_iHideTimerszSound15 );
        }
        
        for( 
client 1client <= g_iMaxPlayersclient++ )
        {
            if( 
is_user_connectedclient ) )
            {
                
iTeam cs_get_user_teamclient );
                
                if( 
iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT )
                {
                    if( 
iTeam == CS_TEAM_CT && is_user_aliveclient ) )
                    {
                        
UTIL_ScreenFadeclient1.5g_iBlindColors], g_iBlindColors], g_iBlindColors], g_iBlindColors] );
                    }
                    
                    
set_hudmessageg_iHudColors], g_iHudColors], g_iHudColors], -1.0, -1.000.01.10.10.1);
                    
show_hudmessageclient"Hiders have %i second%s to hide!"g_iHideTimerg_iHideTimer == "" "s" );
                    
                    if( 
g_bTimerSpeech )
                    {
                        
client_cmdclient"spk vox/%s.wav"szSound );
                    }
                }
            }
        }
    }
    else if( 
g_iHideTimer == )
    {
        static 
iParams];
        
        for( 
client 1client <= g_iMaxPlayersclient++ )
        {
            if( 
is_user_connectedclient ) )
            {
                
iTeam cs_get_user_teamclient );
                
                if( 
iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT )
                {
                    if( 
iTeam == CS_TEAM_CT && is_user_aliveclient ) )
                    {
                        
UTIL_ScreenFadeclient0.0000);
                        
                        
ResetMaxspeedclient );
                    }
                    
                    
set_hudmessageg_iHudColors], g_iHudColors], g_iHudColors], -1.0, -1.000.01.10.10.1);
                    
show_hudmessageclient"Ready or not, Here we come!" );
                    
                    
iParams] = _:iTeam;
                    
TaskGiveWeaponsiParamsclient TASK_ID_GIVEWEAPONS );
                }
            }
        }
        
        
g_bWeaponsGiven true;
    }
    else
    {
        for( 
client 1client <= g_iMaxPlayersclient++ )
        {
            if( 
is_user_connectedclient ) )
            {
                if( 
is_user_aliveclient ) && cs_get_user_teamclient ) == CS_TEAM_CT )
                {
                    
UTIL_ScreenFadeclient0.0000);
                    
                    
ResetMaxspeedclient );
                }
            }
        }
        
        return;
    }
    
    
g_iHideTimer--;
    
set_task1.0"TaskHideTimer"TASK_ID_HIDETIMER );
}

public 
TaskSwapTeams( )
{
    static 
iCountclient;
    
    
iCount 0;
    
    for( 
client g_iSwapStartIndexclient <= g_iMaxPlayersclient++ )
    {
        if( 
is_user_connectedclient ) )
        {
            if( 
iCount >= SWAP_PER_INTERVAL )
            {
                
g_iSwapStartIndex client;
                
set_taskSWAP_INTERVAL"TaskSwapTeams"TASK_ID_SWAPTEAMS );
                
                return;
            }
            
            switch( 
cs_get_user_teamclient ) )
            {
                case 
CS_TEAM_T:
                {
                    
cs_set_user_teamclientCS_TEAM_CTCS_CT_GIGN );
                    
                    
iCount++;
                }
                case 
CS_TEAM_CT:
                {
                    
cs_set_user_teamclientCS_TEAM_TCS_T_LEET );
                    
                    
iCount++;
                }
            }
        }
    }
}

public 
TaskCheckModeliParams[ ], iTaskId )
{
    static 
CsTeams:iTeamclient;
    
    
iTeam CsTeams:iParams];
    
client iTaskId TASK_ID_CHECKMODEL;
    
    static 
szModel32 ];
    
cs_get_user_modelclientszModel31 );
    
    if( !
TrieKeyExistsg_tTeamModelsiTeam ], szModel ) )
    {
        static const 
szDefaultModelsCsTeams ][ ] =
        {
            
"",
            
"leet",
            
"gign",
            
""
        
};
        
        
cs_set_user_modelclientszDefaultModelsiTeam ] );
    }
}

public 
TaskGiveWeaponsiParams[ ], iTaskId )
{
    static 
CsTeams:iTeamclient;
    
    
iTeam CsTeams:iParams];
    
client iTaskId TASK_ID_GIVEWEAPONS;
    
    static 
NadeTypes:iNadeiLimitiGiveMaxiChanceiTriesiGiven;
    
    for( 
iNade NadeTypes:0iNade NadeTypesiNade++ )
    {
        
iLimit g_iNadeLimitiNade ];
        
iGiveMax g_iNadeInfoiTeam ][ iNade ][ NADE_COUNT ];
        
iChance g_iNadeInfoiTeam ][ iNade ][ NADE_CHANCE ];
        
iGiven 0;
        
        for( 
iTries 0iTries iGiveMaxiTries++ )
        {
            if( 
iChance == 100 || random_num1100 ) <= iChance )
            {
                
iGiven++;
            }
        }
        
        if( 
iGiven )
        {
            for( 
iTries 0iTries iGiveniTries++ )
            {
                if( 
iTries iLimit )
                {
                    
give_itemclientg_szNadeWeaponNamesiNade ] );
                }
                else
                {
                    
cs_set_user_bpammoclientg_iNadeIdsiNade ], iGiven );
                    
                    break;
                }
            }
            
            if( 
iChance != 100 )
            {
                
PrintChatclient"You received^3 %i^1 of^3 %i %s%s^1! (%i%% chance per)",\
                    
iGiven,\
                    
iGiveMax,\
                    
g_szNadeNamesiNade ],\
                    
iGiveMax == "" "s",\
                    
iChance
                    
);
            }
        }
    }
    
    
cs_set_user_armorclientg_iArmorInfoiTeam ][ ARMOR_VALUE ], g_iArmorInfoiTeam ][ ARMOR_TYPE ] );
}

public 
TaskShowPluginInfoiTaskId )
{
    
PrintChatiTaskId TASK_ID_PLUGININFO"This server is using^3 %s^4 v%s^1, by^3 %s^1!"PLUGIN_NAMEPLUGIN_VERSPLUGIN_AUTH );
    
    
set_task360.0"TaskShowPluginInfo"iTaskId );
}

GetHiderAndSeeker( &iHider, &iSeeker, &iHiderAlive=)
{
    
iHider 0;
    
iSeeker 0;
    
iHiderAlive 0;
    
    static 
i;
    for( 
1<= g_iMaxPlayersi++ )
    {
        if( 
is_user_connected) )
        {
            switch( 
cs_get_user_team) )
            {
                case 
CS_TEAM_T:
                {
                    if( !
iHider )
                    {
                        
iHider i;
                        
                        if( !
iHiderAlive && is_user_alive) )
                        {
                            
iHiderAlive i;
                            
                            if( 
iSeeker )
                            {
                                return 
1;
                            }
                        }
                    }
                }
                case 
CS_TEAM_CT:
                {
                    if( !
iSeeker )
                    {
                        
iSeeker i;
                        
                        if( 
iHider && iHiderAlive )
                        {
                            return 
1;
                        }
                    }
                }
            }
        }
    }
    
    return 
0;
}

SwapTeams( )
{
    
g_iRoundsLost 0;
    
g_bDisableSlash true;
    
    
g_iSwapStartIndex 1;
    
TaskSwapTeams( );
}

ResetMaxspeed( const client )
{
    static 
Float:fMaxSpeed;
    
    
// Jon
    
ExecuteHamBHam_CS_Item_GetMaxSpeedget_pdata_cbaseclientm_pActiveItem ), fMaxSpeed );
    
    
/*switch( get_user_weapon( client ) )
    {
        case CSW_SG550, CSW_AWP, CSW_G3SG1:
        {
            fMaxSpeed = 210.0;
        }
        case CSW_M249:
        {
            fMaxSpeed = 220.0;
        }
        case CSW_AK47:
        {
            fMaxSpeed = 221.0;
        }
        case CSW_M3, CSW_M4A1:
        {
            fMaxSpeed = 230.0;
        }
        case CSW_SG552:
        {
            fMaxSpeed = 235.0;
        }
        case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS:
        {
            fMaxSpeed = 240.0;
        }
        case CSW_P90:
        {
            fMaxSpeed = 245.0;
        }
        case CSW_SCOUT:
        {
            fMaxSpeed = 260.0;
        }
        default:
        {
            fMaxSpeed = 250.0;
        }
    }*/
    
    
entity_set_floatclientEV_FL_maxspeedfMaxSpeed );
}

SecondsToScreenFadeUnits( const Float:fSeconds, const bool:bClamp=true )
{
    static 
iUnits;
    
iUnits floatroundfSeconds float<< 12 ) );
    
    if( 
bClamp )
    {
        
iUnits clampiUnits00xFFFF );
    }
    
    return 
iUnits;
}

PrintChat( const client, const szMessageFormat[ ], any:... )
{
    static 
szMessage192 ], iLen;
    
iLen formatexszMessage191"^4%s^1 "g_szChatPrefix );
    
vformatszMessageiLen ], 191 iLenszMessageFormat);
    
    if( 
client )
    {
        
UTIL_SayTextclientclientszMessage );
    }
    else
    {
        static 
i;
        for( 
1<= g_iMaxPlayersi++ )
        {
            if( 
is_user_connected) )
            {
                
UTIL_SayTextiiszMessage );
            }
        }
    }
}

UTIL_HideWeapon( const client, const iFlags )
{
    
set_pdata_intclientm_iHideHUD, ( get_pdata_intclientm_iHideHUD ) | iFlags ) );
}

UTIL_SayText( const iReceiver, const iSender, const szMessage[ ] )
{
    
message_beginiReceiver MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgId_SayText_iReceiver );
    
write_byteiSender );
    
write_stringszMessage );
    
message_end( );
}

UTIL_ScoreInfo( const client, const iFrags, const iDeaths, const CsTeams:iTeam )
{
    
message_beginMSG_BROADCASTg_iMsgId_ScoreInfo );
    
write_byteclient );
    
write_shortiFrags );
    
write_shortiDeaths );
    
write_short);
    
write_short_:iTeam );
    
message_end( );
}

UTIL_ScreenFade( const client, const Float:fDuration, const iRed, const iGreen, const iBlue, const iAlpha )
{
    
message_beginclient MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgId_ScreenFade_client );
    
write_shortSecondsToScreenFadeUnitsfDuration ) );
    
write_shortSecondsToScreenFadeUnitsfDuration 0.75 ) );
    
write_shortFFADE_IN );
    
write_byteiRed );
    
write_byteiGreen );
    
write_byteiBlue );
    
write_byteiAlpha );
    
message_end( );
}

UTIL_StatusText( const client, const szMessage[ ] )
{
    
message_beginclient MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgId_StatusText_client );
    
write_byte);
    
write_stringszMessage );
    
message_end( );
}

UTIL_StatusValue( const client, const iFlag, const iValue )
{
    
message_beginclient MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgId_StatusValue_client );
    
write_byteiFlag );
    
write_shortiValue );
    
message_end( );

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
D-TOX
Member
Join Date: Mar 2008
Old 11-23-2009 , 12:51   Re: Exolent Hidenseek 3.0 BETA
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
Try this version.
PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < engine >
#include < fun >
#include < fakemeta >
#include < hamsandwich >

new const PLUGIN_NAME[ ] = "HideNSeek";
new const 
PLUGIN_VERS[ ] = "3.0.0";
new const 
PLUGIN_AUTH[ ] = "Exolent";

const 
FFADE_IN 0x0000;

const 
m_pPlayer 41;
const 
OFFSET_WEAPONS 4;

const 
m_iHideHUD 361;
const 
HIDE_MONEY = ( << );

const 
m_pActiveItem 373;

enum // StatusValue flags for first argument
{
    
SV_FLAG_TEAMMATE 1,
    
SV_FLAG_PLAYERID,
    
SV_FLAG_PLAYERHP
};

enum // StatusValue values for the SV_FLAG_TEAMMATE flag
{
    
SV_TEAMVALUE_FRIEND 1,
    
SV_TEAMVALUE_ENEMY,
    
SV_TEAMVALUE_HOSTAGE
};

enum NadeTypes
{
    
NADE_HE,
    
NADE_FL,
    
NADE_SM
};

new const 
g_szNadeNamesNadeTypes ][ ] =
{
    
"HE Grenade",
    
"Flashbang",
    
"Smoke Grenade"
};

new const 
g_iNadeIdsNadeTypes ] =
{
    
CSW_HEGRENADE,
    
CSW_FLASHBANG,
    
CSW_SMOKEGRENADE
};

new const 
g_iNadeLimitNadeTypes ] =
{
    
1,
    
2,
    
1
};

new const 
g_szNadeWeaponNamesNadeTypes ][ ] =
{
    
"weapon_hegrenade",
    
"weapon_flashbang",
    
"weapon_smokegrenade"
};

enum NadeInfo
{
    
NADE_COUNT,
    
NADE_CHANCE
};

enum ArmorInfo
{
    
ARMOR_VALUE,
    
CsArmorType:ARMOR_TYPE
};

new const 
g_szTeamToCvarCsTeams ][ ] =
{
    
"",
    
"hider",
    
"seeker",
    
""
};

new const 
g_szNadeTypeToCvarNadeTypes ][ ] =
{
    
"grenade",
    
"flash",
    
"smoke"
};

new const 
g_szNadeInfoToCvarNadeInfo ][ ] =
{
    
"count",
    
"chance"
};

new const 
g_szArmorInfoToCvarArmorInfo ][ ] =
{
    
"value",
    
"type"
};

enum
{
    
R,
    
G,
    
B,
    
A
};

enum ( += 1000 )
{
    
TASK_ID_BLANK 0,
    
    
TASK_ID_HIDETIMER,
    
TASK_ID_SWAPTEAMS,
    
    
TASK_ID_CHECKMODEL,
    
TASK_ID_GIVEWEAPONS,
    
TASK_ID_PLUGININFO
};

new const 
g_iPlayerTasks[ ] =
{
    
TASK_ID_CHECKMODEL,
    
TASK_ID_GIVEWEAPONS,
    
TASK_ID_PLUGININFO
};

new 
g_iHideTimer;

const 
SWAP_PER_INTERVAL 5;
const 
Float:SWAP_INTERVAL 0.5;
new 
g_iSwapStartIndex;

new 
bool:g_bSpawnedOnce33 ];

new 
bool:g_bWeaponsGiven;

new 
g_iRoundsLost;
new 
bool:g_bDisableSlash true;

new 
Trie:g_tTeamModelsCsTeams ];

new 
Trie:g_tRemoveEntities;

new 
g_iMsgId_SayText;
new 
g_iMsgId_ScoreInfo;
new 
g_iMsgId_ScreenFade;
new 
g_iMsgId_StatusText;
new 
g_iMsgId_StatusValue;

new 
g_iMaxPlayers;

new 
pCvar_NoSlow;
new 
pCvar_HideTime;
new 
pCvar_Money;
new 
pCvar_SilentFeet;
new 
pCvar_NubSlash;
new 
pCvar_TimerSpeech;
new 
pCvar_DisableKill;
new 
pCvar_HiderSurviveFrags;
new 
pCvar_GameType;
new 
pCvar_ChatPrefix;
new 
pCvar_ColorHud;
new 
pCvar_ColorBlind;
new 
pCvar_HiderKnifeVisible;
new 
pCvar_NadeInfoCsTeams ][ NadeTypes ][ NadeInfo ];
new 
pCvar_ArmorInfoCsTeams ][ ArmorInfo ];

/* Cached cvar variables + their default values */

new bool:g_bNoSlow false;

new 
g_iHideTime 10;

new 
g_iMoneyValue 0// -1 = don't change money, 0 = hide money and set to 0, > 0 = set to that value

new g_iSilentFeet = ( << _:CS_TEAM_T );

new 
g_iNubSlashRounds 3// 0 to allow slashing, -1 for forever disable slashing

new bool:g_bTimerSpeech true;

new 
bool:g_bDisableKillCommand true;

new 
g_iHiderSurviveFrags 1;

new 
g_szGameType32 ] = "HideNSeek";

new 
g_szChatPrefix16 ] = "[ HNS ]";

new 
g_iHudColors] =
{
    
0,    // Red
    
255,    // Green
    
0    // Blue
};

new 
g_iBlindColors] =
{
    
0,    // Red
    
0,    // Green
    
0,    // Blue
    
255    // Alpha
};

new 
bool:g_bVisibleTerrKnife true;

new 
g_iNadeInfoCsTeams ][ NadeTypes ][ NadeInfo ] =
{
    
// Spectator
    
{
        
// HE
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Flash
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Smoke
        
{
            
0,    // Count
            
0    // Chance
        
}
    },
    
// Hider
    
{
        
// HE
        
{
            
1,    // Count
            
100    // Chance
        
},
        
// Flash
        
{
            
2,    // Count
            
100    // Chance
        
},
        
// Smoke
        
{
            
1,    // Count
            
100    // Chance
        
}
    },
    
// Seeker
    
{
        
// HE
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Flash
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Smoke
        
{
            
0,    // Count
            
0    // Chance
        
}
    },
    
// Spectator
    
{
        
// HE
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Flash
        
{
            
0,    // Count
            
0    // Chance
        
},
        
// Smoke
        
{
            
0,    // Count
            
0    // Chance
        
}
    }
};

new 
g_iArmorInfoCsTeams ][ ArmorInfo ] =
{
    
// Spectator
    
{
        
// Value
        
0,
        
// Type
        
CS_ARMOR_NONE
    
},
    
// Hider
    
{
        
// Value
        
100,
        
// Type
        
CS_ARMOR_VESTHELM
    
},
    
// Seeker
    
{
        
// Value
        
100,
        
// Type
        
CS_ARMOR_VESTHELM
    
},
    
// Spectator
    
{
        
// Value
        
0,
        
// Type
        
CS_ARMOR_NONE
    
}
};

/* End of cvars */

RegisterCvars( )
{
    new 
szValue32 ];
    
    
num_to_str_:g_bNoSlowszValue31 );
    
pCvar_NoSlow register_cvar"hns_noslow"szValue );
    
    
num_to_strg_iHideTimeszValue31 );
    
pCvar_HideTime register_cvar"hns_hidetime"szValue );
    
    
num_to_strg_iMoneyValueszValue31 );
    
pCvar_Money register_cvar"hns_money"szValue );
    
    
num_to_strg_iSilentFeetszValue31 );
    
pCvar_SilentFeet register_cvar"hns_silentfeet"szValue );
    
    
num_to_strg_iNubSlashRoundsszValue31 );
    
pCvar_NubSlash register_cvar"hns_nubslash"szValue );
    
    
num_to_str_:g_bTimerSpeechszValue31 );
    
pCvar_TimerSpeech register_cvar"hns_timer_speech"szValue );
    
    
num_to_str_:g_bDisableKillCommandszValue31 );
    
pCvar_DisableKill register_cvar"hns_disable_kill"szValue );
    
    
num_to_strg_iHiderSurviveFragsszValue31 );
    
pCvar_HiderSurviveFrags register_cvar"hns_hider_survive_frags"szValue );
    
    
pCvar_GameType register_cvar"hns_gametype"g_szGameType );
    
    
pCvar_ChatPrefix register_cvar"hns_chat_prefix"g_szChatPrefix );
    
    new 
iLen;
    for( new 
0sizeofg_iHudColors ); i++ )
    {
        
iLen += formatexszValueiLen ], 31 iLen"%s%i"iLen " " ""g_iHudColors] );
    }
    
pCvar_ColorHud register_cvar"hns_color_hud"szValue );
    
    
iLen 0;
    for( new 
0sizeofg_iBlindColors ); i++ )
    {
        
iLen += formatexszValueiLen ], 31 iLen"%s%i"iLen " " ""g_iBlindColors] );
    }
    
pCvar_ColorBlind register_cvar"hns_color_blind"szValue );
    
    
num_to_str_:g_bVisibleTerrKnifeszValue31 );
    
pCvar_HiderKnifeVisible register_cvar"hns_hider_knife_visible"szValue );
    
    new 
NadeTypes:iNadeTypeNadeInfo:iNadeInfoszCvar64 ];
    for( new 
CsTeams:iTeam CS_TEAM_TiTeam <= CS_TEAM_CTiTeam++ )
    {
        for( 
iNadeType NadeTypes:0iNadeType NadeTypesiNadeType++ )
        {
            for( 
iNadeInfo NadeInfo:0iNadeInfo NadeInfoiNadeInfo++ )
            {
                
formatexszCvar63"hns_%s_%s_%s"g_szTeamToCvariTeam ], g_szNadeTypeToCvariNadeType ], g_szNadeInfoToCvariNadeInfo ] );
                
num_to_strg_iNadeInfoiTeam ][ iNadeType ][ iNadeInfo ], szValue31 );
                
                
pCvar_NadeInfoiTeam ][ iNadeType ][ iNadeInfo ] = register_cvarszCvarszValue );
            }
        }
    }
    
    new 
ArmorInfo:iArmorInfo;
    for( new 
CsTeams:iTeam CS_TEAM_TiTeam <= CS_TEAM_CTiTeam++ )
    {
        for( 
iArmorInfo ArmorInfo:0iArmorInfo ArmorInfoiArmorInfo++ )
        {
            
formatexszCvar63"hns_%s_armor_%s"g_szTeamToCvariTeam ], g_szArmorInfoToCvariArmorInfo ] );
            
num_to_strg_iArmorInfoiTeam ][ iArmorInfo ], szValue31 );
            
            
pCvar_ArmorInfoiTeam ][ iArmorInfo ] = register_cvarszCvarszValue );
        }
    }
}

CacheCvars( )
{
    static 
szColor16 ], szPart], iCsTeams:iTeamNadeTypes:iNadeTypeNadeInfo:iNadeInfoArmorInfo:iArmorInfo;
    
    
g_bNoSlow bool:get_pcvar_numpCvar_NoSlow );
    
g_iHideTime get_pcvar_numpCvar_HideTime );
    
g_iMoneyValue get_pcvar_numpCvar_Money );
    
g_bVisibleTerrKnife bool:get_pcvar_numpCvar_HiderKnifeVisible );
    
g_iSilentFeet get_pcvar_numpCvar_SilentFeet );
    
g_iNubSlashRounds get_pcvar_numpCvar_NubSlash );
    
g_bTimerSpeech bool:get_pcvar_numpCvar_TimerSpeech );
    
g_bDisableKillCommand bool:get_pcvar_numpCvar_DisableKill );
    
g_iHiderSurviveFrags get_pcvar_numpCvar_HiderSurviveFrags );
    
get_pcvar_stringpCvar_GameTypeg_szGameType31 );
    
get_pcvar_stringpCvar_ChatPrefixg_szChatPrefix15 );
    
    
get_pcvar_stringpCvar_ColorHudszColor15 );
    
//parse( szColor, szParts[ R ], 3, szParts[ G ], 3, szParts[ B ], 3 );
    
for( 0sizeofg_iHudColors ); i++ )
    {
        
strbreakszColorszPart3szColor15 );
        
g_iHudColors] = clampstr_to_numszPart ), 0255 );
    }
    
    
get_pcvar_stringpCvar_ColorBlindszColor15 );
    
//parse( szColor, szParts[ R ], 3, szParts[ G ], 3, szParts[ B ], 3, szParts[ A ], 3 );
    
for( 0sizeofg_iBlindColors ); i++ )
    {
        
strbreakszColorszPart3szColor15 );
        
g_iBlindColors] = clampstr_to_numszPart ), 0255 );
    }
    
    for( 
iTeam CS_TEAM_TiTeam <= CS_TEAM_CTiTeam++ )
    {
        for( 
iNadeType NadeTypes:0iNadeType NadeTypesiNadeType++ )
        {
            for( 
iNadeInfo NadeInfo:0iNadeInfo NadeInfoiNadeInfo++ )
            {
                
g_iNadeInfoiTeam ][ iNadeType ][ iNadeInfo ] = get_pcvar_numpCvar_NadeInfoiTeam ][ iNadeType ][ iNadeInfo ] );
            }
        }
        
        for( 
iArmorInfo ArmorInfo:0iArmorInfo ArmorInfoiArmorInfo++ )
        {
            
g_iArmorInfoiTeam ][ iArmorInfo ] = get_pcvar_numpCvar_ArmorInfoiTeam ][ iArmorInfo ] );
        }
    }
}

public 
plugin_precache( )
{
    new 
iEntity create_entity"hostage_entity" );
    
entity_set_originiEntityFloat:{ 0.00.0, -55000.0 } );
    
entity_set_sizeiEntityFloat:{ -1.0, -1.0, -1.0 }, Float:{ 1.01.01.0 } );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"player_weaponstrip" );
    
DispatchKeyValueiEntity"targetname""stripper" );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"game_player_equip" );
    
DispatchKeyValueiEntity"weapon_knife""1" );
    
DispatchKeyValueiEntity"targetname""equipment" );
    
    
iEntity create_entity"multi_manager" );
    
DispatchKeyValueiEntity"stripper""0" );
    
DispatchKeyValueiEntity"equipment""0.5" );
    
DispatchKeyValueiEntity"targetname""game_playerspawn" );
    
DispatchKeyValueiEntity"spawnflags""1" );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"info_map_parameters" );
    
DispatchKeyValueiEntity"buying""3" );
    
DispatchSpawniEntity );
    
    new const 
szRemoveEntities[][] =
    {
        
"func_bomb_target",
        
"info_bomb_target",
        
"hostage_entity",
        
"monster_scientist",
        
"func_hostage_rescue",
        
"info_hostage_rescue",
        
"info_vip_start",
        
"func_vip_safetyzone",
        
"func_escapezone",
        
"armoury_entity",
        
"info_map_parameters",
        
"player_weaponstrip",
        
"game_player_equip",
        
"func_buyzone"
    
};
    
    
g_tRemoveEntities TrieCreate( );
    
    for( new 
0sizeofszRemoveEntities ); i++ )
    {
        
TrieSetCellg_tRemoveEntitiesszRemoveEntities], );
    }
    
    
register_forwardFM_Spawn"FwdSpawn" );
}

public 
FwdSpawniEntity )
{
    static 
szClassname32 ];
    
entity_get_stringiEntityEV_SZ_classnameszClassname31 );
    
    if( 
TrieKeyExistsg_tRemoveEntitiesszClassname ) )
    {
        
remove_entityiEntity );
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

public 
pfn_keyvalueiEntity )
{
    static 
szClassname32 ], szKey32 ], szValue32 ];
    
copy_keyvalueszClassname31szKey31szValue31 );
    
    if( 
equalszClassname"multi_manager" )
    && 
equalszKey"targetname" )
    && 
equalszValue"game_playerspawn" ) )
    {
        
remove_entityiEntity );
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
plugin_init( )
{
    
register_pluginPLUGIN_NAMEPLUGIN_VERSPLUGIN_AUTH );
    
register_cvarPLUGIN_NAMEPLUGIN_VERS, ( FCVAR_SERVER FCVAR_SPONLY ) );
    
    
register_event"HLTV""EventNewRound""a""1=0""2=0" );
    
register_event"TextMsg""EventRoundRestart""a""2&#Game_C""2&#Game_w" );
    
register_event"SendAudio""EventHidersWin""a""2=%!MRAD_terwin" );
    
register_event"ResetHUD""EventResetHud""be" );
    
register_event"Money""EventMoney""be" );
    
    
register_logevent"EventRoundStart"2"1=Round_Start" );
    
register_logevent"EventRoundEnd"2"1=Round_End" );
    
    
RegisterHamHam_Item_Deploy"weapon_knife""FwdKnifeDeploy");
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_knife""FwdKnifePrimAttack" );
    
RegisterHamHam_Weapon_SecondaryAttack"weapon_knife""FwdKnifeSecAttack" );
    
    
RegisterHamHam_Spawn"player""FwdPlayerSpawn");
    
    
register_forwardFM_GetGameDescription"FwdGetGameDescription" );
    
    
g_iMsgId_SayText get_user_msgid"SayText" );
    
g_iMsgId_ScoreInfo get_user_msgid"ScoreInfo" );
    
g_iMsgId_ScreenFade get_user_msgid"ScreenFade" );
    
g_iMsgId_StatusText get_user_msgid"StatusText" );
    
g_iMsgId_StatusValue get_user_msgid"StatusValue" );
    
    
set_msg_blockget_user_msgid"HostagePos" ), BLOCK_SET );
    
set_msg_blockg_iMsgId_StatusTextBLOCK_SET );
    
set_msg_blockg_iMsgId_StatusValueBLOCK_SET );
    
    
register_messageget_user_msgid"HideWeapon" ), "MessageHideWeapon" );
    
register_messageg_iMsgId_ScreenFade"MessageScreenFade" );
    
register_messageget_user_msgid"TextMsg" ), "MessageTextMsg" );
    
    
RegisterCvars( );
    
    
g_iMaxPlayers get_maxplayers( );
    
    new const 
szTeamModelsCsTeams ][ ][ ] =
    {
        { 
"""""""" },
        { 
"leet""arctic""terror""guerilla" },
        { 
"gign""sas""gsg9""urban" },
        { 
"""""""" }
    };
    
    new 
i;
    for( new 
CsTeams:iTeam CS_TEAM_TiTeam <= CS_TEAM_CTiTeam++ )
    {
        
g_tTeamModelsiTeam ] = TrieCreate( );
        
        for( 
04i++ )
        {
            
TrieSetCellg_tTeamModelsiTeam ], szTeamModelsiTeam ][ ], );
        }
    }
}

public 
plugin_end( )
{
    for( new 
CsTeams:iTeam CS_TEAM_TiTeam <= CS_TEAM_CTiTeam++ )
    {
        
TrieDestroyg_tTeamModelsiTeam ] );
    }
}

public 
client_disconnectclient )
{
    static 
i;
    for( 
0sizeofg_iPlayerTasks ); i++ )
    {
        
remove_taskclient g_iPlayerTasks] );
    }
    
    
g_bSpawnedOnceclient ] = false;
}

public 
client_PreThinkclient )
{
    if( 
is_user_aliveclient ) )
    {
        if( 
g_bNoSlow )
        {
            
entity_set_floatclientEV_FL_fuser20.0 );
        }
        
        static 
CsTeams:iTeam;
        
iTeam cs_get_user_teamclient );
        
        if( 
g_iSilentFeet & ( << _:iTeam ) )
        {
            
entity_set_intclientEV_INT_flTimeStepSound999 );
        }
        
        if( 
iTeam == CS_TEAM_CT )
        {
            if( 
g_iHideTimer )
            {
                
entity_set_floatclientEV_FL_maxspeed, -1.0 );
                
                static 
Float:vVelocity];
                
entity_get_vectorclientEV_VEC_velocityvVelocity );
                
                
vVelocity] = 0.0;
                
vVelocity] = 0.0;
                
                
entity_set_vectorclientEV_VEC_velocityvVelocity );
                
                
set_user_godmodeclient);
            }
            else if( 
g_iHideTimer == )
            {
                
set_user_godmodeclient);
            }
        }
        
        static 
iTargetiBody;
        
get_user_aimingclientiTargetiBody );
        
        static 
iOldTarget33 ], iResetCount33 ];
        
        if( ( 
<= iTarget <= g_iMaxPlayers ) && is_user_aliveiTarget ) )
        {
            static 
iOldbool:bIsTeammate;
            
iOld iOldTargetclient ];
            
bIsTeammate bool:( cs_get_user_teamiTarget ) == iTeam );
            
            if( !
iOld )
            {
                if( 
bIsTeammate )
                {
                    
UTIL_StatusValueclientSV_FLAG_TEAMMATESV_TEAMVALUE_FRIEND );
                }
                else
                {
                    
UTIL_StatusValueclientSV_FLAG_TEAMMATESV_TEAMVALUE_ENEMY );
                }
            }
            
            if( 
iOld != iTarget )
            {
                
iOldTargetclient ] = iTarget;
                
                
UTIL_StatusValueclientSV_FLAG_PLAYERIDiTarget );
            }
            
            if( !
iOld )
            {
                if( 
bIsTeammate )
                {
                    static 
szMessage192 ];
                    
formatexszMessage191"Friend: %%p2 - Health: %i%%%%"get_user_healthiTarget ) );
                    
                    
UTIL_StatusTextclientszMessage );
                }
                else
                {
                    
UTIL_StatusTextclient"Enemy: %p2" );
                }
            }
        }
        else if( 
iOldTargetclient ] )
        {
            
iOldTargetclient ] = 0;
            
iResetCountclient ] = 100;
        }
        else if( 
iResetCountclient ] > && --iResetCountclient ] == )
        {
            
UTIL_StatusValueclientSV_FLAG_PLAYERID);
            
UTIL_StatusTextclient"" );
        }
    }
}

public 
client_killclient )
{
    if( 
g_bDisableKillCommand )
    {
        static 
Float:fLastMessage33 ], Float:fGametime;
        
        
fGametime get_gametime( );
        
        if( 
fLastMessageclient ] >= ( fGametime 1.0 ) )
        {
            
console_printclient"You cannot kill yourself in HideNSeek!" );
            
PrintChatclient"You^3 cannot kill yourself^1 in HideNSeek!" );
            
            
fLastMessageclient ] = fGametime;
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
EventNewRound( )
{
    
CacheCvars( );
    
    if( 
g_bDisableSlash
    
&& ( g_iRoundsLost >= g_iNubSlashRounds || !g_iNubSlashRounds ) )
    {
        
g_bDisableSlash false;
        
        if( 
g_iNubSlashRounds )
        {
            
PrintChat0"The seekers have^3 lost %i round%s^1 and can now^3 use slash^1!"g_iNubSlashRoundsg_iNubSlashRounds == "" "s" );
        }
    }
    else if( !
g_bDisableSlash && g_iNubSlashRounds == -)
    {
        
g_bDisableSlash true;
    }
    
    
g_bWeaponsGiven false;
}

public 
EventRoundRestart( )
{
    
g_iHideTimer = -1;
    
    
g_iRoundsLost 0;
    
g_bDisableSlash true;
}

public 
EventHidersWin( )
{
    if( 
g_bDisableSlash )
    {
        
g_iRoundsLost++;
    }
    
    if( 
g_iHiderSurviveFrags )
    {
        static 
iiFrags;
        for( 
1<= g_iMaxPlayersi++ )
        {
            if( 
is_user_alive) && cs_get_user_team) == CS_TEAM_T )
            {
                
iFrags get_user_frags) + g_iHiderSurviveFrags;
                
                
set_user_fragsiiFrags );
                
                
UTIL_ScoreInfoiiFragscs_get_user_deaths), CS_TEAM_T );
                
                
PrintChati"You earned^3 %i frag%s^1 for surviving the round!"g_iHiderSurviveFragsg_iHiderSurviveFrags == "" "s" );
            }
        }
    }
}

public 
EventResetHudclient )
{
    if( !
g_iMoneyValue )
    {
        
UTIL_HideWeaponclientHIDE_MONEY );
    }
}

public 
EventMoneyclient )
{
    if( 
g_iMoneyValue >= )
    {
        
cs_set_user_moneyclientg_iMoneyValue_:( g_iMoneyValue ) );
        
        if( !
g_iMoneyValue )
        {
            
UTIL_HideWeaponclientHIDE_MONEY );
        }
    }
}

public 
EventRoundStart( )
{
    
remove_taskTASK_ID_HIDETIMER );
    
    
g_iHideTimer g_iHideTime;
    
    
TaskHideTimer( );
}

public 
EventRoundEnd( )
{
    
remove_taskTASK_ID_HIDETIMER );
}

public 
FwdKnifeDeployiEntity )
{
    if( !
g_bVisibleTerrKnife )
    {
        static 
client;
        
client get_pdata_cbaseiEntitym_pPlayerOFFSET_WEAPONS );
        
        if( 
cs_get_user_teamclient ) == CS_TEAM_T )
        {
            
entity_set_stringclientEV_SZ_viewmodel"" );
            
entity_set_stringclientEV_SZ_weaponmodel"" );
        }
    }
}

public 
FwdKnifePrimAttackiEntity )
{
    static 
client;
    
client get_pdata_cbaseiEntitym_pPlayerOFFSET_WEAPONS );
    
    if( 
is_user_aliveclient ) )
    {
        switch( 
cs_get_user_teamclient ) )
        {
            case 
CS_TEAM_T:
            {
                return 
HAM_SUPERCEDE;
            }
            case 
CS_TEAM_CT:
            {
                if( 
g_bDisableSlash )
                {
                    
ExecuteHamBHam_Weapon_SecondaryAttackiEntity );
                    
                    return 
HAM_SUPERCEDE;
                }
            }
        }
    }
    
    return 
HAM_IGNORED;
}

public 
FwdKnifeSecAttackiEntity )
{
    static 
client;
    
client get_pdata_cbaseiEntitym_pPlayerOFFSET_WEAPONS );
    
    if( 
is_user_aliveclient ) && cs_get_user_teamclient ) == CS_TEAM_T )
    {
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;
}

public 
FwdPlayerSpawnclient )
{
    if( 
is_user_aliveclient ) )
    {
        static 
CsTeams:iTeam;
        
iTeam cs_get_user_teamclient );
        
        if( 
iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT )
        {
            static 
iParams];
            
iParams] = _:iTeam;
            
            
set_task0.3"TaskCheckModel"client TASK_ID_CHECKMODELiParams);
            
            if( 
g_bWeaponsGiven )
            {
                
set_task0.6"TaskGiveWeapons"client TASK_ID_GIVEWEAPONSiParams);
            }
        }
        
        if( !
g_bSpawnedOnceclient ] )
        {
            
TaskShowPluginInfoclient TASK_ID_PLUGININFO );
            
            
g_bSpawnedOnceclient ] = true;
        }
    }
}

public 
FwdGetGameDescription( )
{
    if( 
g_szGameType] )
    {
        
forward_returnFMV_STRINGg_szGameType );
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

public 
MessageHideWeaponiMsgIdiDestclient )
{
    if( !
g_iMoneyValue )
    {
        
set_msg_arg_int1ARG_BYTE, ( get_msg_arg_int) | HIDE_MONEY ) );
        
        
//UTIL_HideWeapon( client, HIDE_MONEY );
    
}
}

public 
MessageScreenFadeiMsgIdiDestclient )
{
    if( 
get_msg_arg_int) == 255
    
&& get_msg_arg_int) == 255
    
&& get_msg_arg_int) == 255 )
    {
        switch( 
cs_get_user_teamclient ) )
        {
            case 
CS_TEAM_T:
            {
                return 
PLUGIN_HANDLED;
            }
            case 
CS_TEAM_CT:
            {
                if( 
g_iHideTimer )
                {
                    return 
PLUGIN_HANDLED;
                }
            }
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
MessageTextMsgiMsgIdiDestclient )
{
    static const 
szTerroristMessage[ ] = "#Terrorists_Win";
    static const 
szHostageMessage[ ] = "#Hostages_Not_Rescued";
    static const 
szCTMessage[ ] = "#CTs_Win";
    
    static 
szMessage192 ];
    
get_msg_arg_string2szMessage31 );
    
    if( 
equalszMessageszTerroristMessage )
    || 
equalszMessageszHostageMessage ) )
    {
        
set_msg_arg_string2"Hiders Win!" );
        
copyszMessage191"Hiders Won Round^nNo Team Change" );
    }
    else if( 
equalszMessageszCTMessage ) )
    {
        
set_msg_arg_string2"Seekers Win!" );
        
copyszMessage191"Seekers Won Round^nSwitching Teams" );
        
        
SwapTeams( );
    }
    else
    {
        return;
    }
    
    
set_hudmessageg_iHudColors], g_iHudColors], g_iHudColors], -1.0, -1.000.05.00.10.1);
    
show_hudmessage0"%s"szMessage );
}

public 
TaskHideTimer( )
{
    if( 
g_iHideTimer )
    {
        static 
iHideriSeeker;
        
GetHiderAndSeekeriHideriSeeker );
        
        if( !
iHider || !iSeeker )
        {
            
g_iHideTimer 0;
        }
    }
    
    static 
CsTeams:iTeamclient;
    
    if( 
g_iHideTimer )
    {
        static 
szSound16 ];
        if( 
g_bTimerSpeech )
        {
            
num_to_wordg_iHideTimerszSound15 );
        }
        
        for( 
client 1client <= g_iMaxPlayersclient++ )
        {
            if( 
is_user_connectedclient ) )
            {
                
iTeam cs_get_user_teamclient );
                
                if( 
iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT )
                {
                    if( 
iTeam == CS_TEAM_CT && is_user_aliveclient ) )
                    {
                        
UTIL_ScreenFadeclient1.5g_iBlindColors], g_iBlindColors], g_iBlindColors], g_iBlindColors] );
                    }
                    
                    
set_hudmessageg_iHudColors], g_iHudColors], g_iHudColors], -1.0, -1.000.01.10.10.1);
                    
show_hudmessageclient"Hiders have %i second%s to hide!"g_iHideTimerg_iHideTimer == "" "s" );
                    
                    if( 
g_bTimerSpeech )
                    {
                        
client_cmdclient"spk vox/%s.wav"szSound );
                    }
                }
            }
        }
    }
    else if( 
g_iHideTimer == )
    {
        static 
iParams];
        
        for( 
client 1client <= g_iMaxPlayersclient++ )
        {
            if( 
is_user_connectedclient ) )
            {
                
iTeam cs_get_user_teamclient );
                
                if( 
iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT )
                {
                    if( 
iTeam == CS_TEAM_CT && is_user_aliveclient ) )
                    {
                        
UTIL_ScreenFadeclient0.0000);
                        
                        
ResetMaxspeedclient );
                    }
                    
                    
set_hudmessageg_iHudColors], g_iHudColors], g_iHudColors], -1.0, -1.000.01.10.10.1);
                    
show_hudmessageclient"Ready or not, Here we come!" );
                    
                    
iParams] = _:iTeam;
                    
TaskGiveWeaponsiParamsclient TASK_ID_GIVEWEAPONS );
                }
            }
        }
        
        
g_bWeaponsGiven true;
    }
    else
    {
        for( 
client 1client <= g_iMaxPlayersclient++ )
        {
            if( 
is_user_connectedclient ) )
            {
                if( 
is_user_aliveclient ) && cs_get_user_teamclient ) == CS_TEAM_CT )
                {
                    
UTIL_ScreenFadeclient0.0000);
                    
                    
ResetMaxspeedclient );
                }
            }
        }
        
        return;
    }
    
    
g_iHideTimer--;
    
set_task1.0"TaskHideTimer"TASK_ID_HIDETIMER );
}

public 
TaskSwapTeams( )
{
    static 
iCountclient;
    
    
iCount 0;
    
    for( 
client g_iSwapStartIndexclient <= g_iMaxPlayersclient++ )
    {
        if( 
is_user_connectedclient ) )
        {
            if( 
iCount >= SWAP_PER_INTERVAL )
            {
                
g_iSwapStartIndex client;
                
set_taskSWAP_INTERVAL"TaskSwapTeams"TASK_ID_SWAPTEAMS );
                
                return;
            }
            
            switch( 
cs_get_user_teamclient ) )
            {
                case 
CS_TEAM_T:
                {
                    
cs_set_user_teamclientCS_TEAM_CTCS_CT_GIGN );
                    
                    
iCount++;
                }
                case 
CS_TEAM_CT:
                {
                    
cs_set_user_teamclientCS_TEAM_TCS_T_LEET );
                    
                    
iCount++;
                }
            }
        }
    }
}

public 
TaskCheckModeliParams[ ], iTaskId )
{
    static 
CsTeams:iTeamclient;
    
    
iTeam CsTeams:iParams];
    
client iTaskId TASK_ID_CHECKMODEL;
    
    static 
szModel32 ];
    
cs_get_user_modelclientszModel31 );
    
    if( !
TrieKeyExistsg_tTeamModelsiTeam ], szModel ) )
    {
        static const 
szDefaultModelsCsTeams ][ ] =
        {
            
"",
            
"leet",
            
"gign",
            
""
        
};
        
        
cs_set_user_modelclientszDefaultModelsiTeam ] );
    }
}

public 
TaskGiveWeaponsiParams[ ], iTaskId )
{
    static 
CsTeams:iTeamclient;
    
    
iTeam CsTeams:iParams];
    
client iTaskId TASK_ID_GIVEWEAPONS;
    
    static 
NadeTypes:iNadeiLimitiGiveMaxiChanceiTriesiGiven;
    
    for( 
iNade NadeTypes:0iNade NadeTypesiNade++ )
    {
        
iLimit g_iNadeLimitiNade ];
        
iGiveMax g_iNadeInfoiTeam ][ iNade ][ NADE_COUNT ];
        
iChance g_iNadeInfoiTeam ][ iNade ][ NADE_CHANCE ];
        
iGiven 0;
        
        for( 
iTries 0iTries iGiveMaxiTries++ )
        {
            if( 
iChance == 100 || random_num1100 ) <= iChance )
            {
                
iGiven++;
            }
        }
        
        if( 
iGiven )
        {
            for( 
iTries 0iTries iGiveniTries++ )
            {
                if( 
iTries iLimit )
                {
                    
give_itemclientg_szNadeWeaponNamesiNade ] );
                }
                else
                {
                    
cs_set_user_bpammoclientg_iNadeIdsiNade ], iGiven );
                    
                    break;
                }
            }
            
            if( 
iChance != 100 )
            {
                
PrintChatclient"You received^3 %i^1 of^3 %i %s%s^1! (%i%% chance per)",\
                    
iGiven,\
                    
iGiveMax,\
                    
g_szNadeNamesiNade ],\
                    
iGiveMax == "" "s",\
                    
iChance
                    
);
            }
        }
    }
    
    
cs_set_user_armorclientg_iArmorInfoiTeam ][ ARMOR_VALUE ], g_iArmorInfoiTeam ][ ARMOR_TYPE ] );
}

public 
TaskShowPluginInfoiTaskId )
{
    
PrintChatiTaskId TASK_ID_PLUGININFO"This server is using^3 %s^4 v%s^1, by^3 %s^1!"PLUGIN_NAMEPLUGIN_VERSPLUGIN_AUTH );
    
    
set_task360.0"TaskShowPluginInfo"iTaskId );
}

GetHiderAndSeeker( &iHider, &iSeeker, &iHiderAlive=)
{
    
iHider 0;
    
iSeeker 0;
    
iHiderAlive 0;
    
    static 
i;
    for( 
1<= g_iMaxPlayersi++ )
    {
        if( 
is_user_connected) )
        {
            switch( 
cs_get_user_team) )
            {
                case 
CS_TEAM_T:
                {
                    if( !
iHider )
                    {
                        
iHider i;
                        
                        if( !
iHiderAlive && is_user_alive) )
                        {
                            
iHiderAlive i;
                            
                            if( 
iSeeker )
                            {
                                return 
1;
                            }
                        }
                    }
                }
                case 
CS_TEAM_CT:
                {
                    if( !
iSeeker )
                    {
                        
iSeeker i;
                        
                        if( 
iHider && iHiderAlive )
                        {
                            return 
1;
                        }
                    }
                }
            }
        }
    }
    
    return 
0;
}

SwapTeams( )
{
    
g_iRoundsLost 0;
    
g_bDisableSlash true;
    
    
g_iSwapStartIndex 1;
    
TaskSwapTeams( );
}

ResetMaxspeed( const client )
{
    static 
Float:fMaxSpeed;
    
    
// Jon
    
ExecuteHamBHam_CS_Item_GetMaxSpeedget_pdata_cbaseclientm_pActiveItem ), fMaxSpeed );
    
    
/*switch( get_user_weapon( client ) )
    {
        case CSW_SG550, CSW_AWP, CSW_G3SG1:
        {
            fMaxSpeed = 210.0;
        }
        case CSW_M249:
        {
            fMaxSpeed = 220.0;
        }
        case CSW_AK47:
        {
            fMaxSpeed = 221.0;
        }
        case CSW_M3, CSW_M4A1:
        {
            fMaxSpeed = 230.0;
        }
        case CSW_SG552:
        {
            fMaxSpeed = 235.0;
        }
        case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS:
        {
            fMaxSpeed = 240.0;
        }
        case CSW_P90:
        {
            fMaxSpeed = 245.0;
        }
        case CSW_SCOUT:
        {
            fMaxSpeed = 260.0;
        }
        default:
        {
            fMaxSpeed = 250.0;
        }
    }*/
    
    
entity_set_floatclientEV_FL_maxspeedfMaxSpeed );
}

SecondsToScreenFadeUnits( const Float:fSeconds, const bool:bClamp=true )
{
    static 
iUnits;
    
iUnits floatroundfSeconds float<< 12 ) );
    
    if( 
bClamp )
    {
        
iUnits clampiUnits00xFFFF );
    }
    
    return 
iUnits;
}

PrintChat( const client, const szMessageFormat[ ], any:... )
{
    static 
szMessage192 ], iLen;
    
iLen formatexszMessage191"^4%s^1 "g_szChatPrefix );
    
vformatszMessageiLen ], 191 iLenszMessageFormat);
    
    if( 
client )
    {
        
UTIL_SayTextclientclientszMessage );
    }
    else
    {
        static 
i;
        for( 
1<= g_iMaxPlayersi++ )
        {
            if( 
is_user_connected) )
            {
                
UTIL_SayTextiiszMessage );
            }
        }
    }
}

UTIL_HideWeapon( const client, const iFlags )
{
    
set_pdata_intclientm_iHideHUD, ( get_pdata_intclientm_iHideHUD ) | iFlags ) );
}

UTIL_SayText( const iReceiver, const iSender, const szMessage[ ] )
{
    
message_beginiReceiver MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgId_SayText_iReceiver );
    
write_byteiSender );
    
write_stringszMessage );
    
message_end( );
}

UTIL_ScoreInfo( const client, const iFrags, const iDeaths, const CsTeams:iTeam )
{
    
message_beginMSG_BROADCASTg_iMsgId_ScoreInfo );
    
write_byteclient );
    
write_shortiFrags );
    
write_shortiDeaths );
    
write_short);
    
write_short_:iTeam );
    
message_end( );
}

UTIL_ScreenFade( const client, const Float:fDuration, const iRed, const iGreen, const iBlue, const iAlpha )
{
    
message_beginclient MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgId_ScreenFade_client );
    
write_shortSecondsToScreenFadeUnitsfDuration ) );
    
write_shortSecondsToScreenFadeUnitsfDuration 0.75 ) );
    
write_shortFFADE_IN );
    
write_byteiRed );
    
write_byteiGreen );
    
write_byteiBlue );
    
write_byteiAlpha );
    
message_end( );
}

UTIL_StatusText( const client, const szMessage[ ] )
{
    
message_beginclient MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgId_StatusText_client );
    
write_byte);
    
write_stringszMessage );
    
message_end( );
}

UTIL_StatusValue( const client, const iFlag, const iValue )
{
    
message_beginclient MSG_ONE_UNRELIABLE MSG_BROADCASTg_iMsgId_StatusValue_client );
    
write_byteiFlag );
    
write_shortiValue );
    
message_end( );


Daeeng ur fast ! Works perfect also. Thanx alot for the support, should i keep reporting bugs to the hidenseek thread ?
__________________
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░█▀▀ ░█▀█ ░█ ░█▀▀ ░░█▀▀ ░█▀█ ░█ ░█░░░
░█▀▀ ░█▀▀ ░█ ░█ ░░░░█▀▀ ░█▀█ ░█ ░█░░░
░▀▀▀ ░▀ ░░░▀ ░▀▀▀ ░░▀ ░░░▀░▀ ░▀ ░▀▀▀░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
D-TOX is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-23-2009 , 12:54   Re: Exolent Hidenseek 3.0 BETA
Reply With Quote #4

I'm not supporting my plugins at this moment right now.
I have too much going on to maintain those.
I may be getting more time soon, but I'm not making any promises.
Over the winter break from school I will have more time.
My first priority is to set up the website (my signature) whenever the hosting is ready.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
D-TOX
Member
Join Date: Mar 2008
Old 11-23-2009 , 13:34   Re: Exolent Hidenseek 3.0 BETA
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
I'm not supporting my plugins at this moment right now.
I have too much going on to maintain those.
I may be getting more time soon, but I'm not making any promises.
Over the winter break from school I will have more time.
My first priority is to set up the website (my signature) whenever the hosting is ready.
Would be sweet if you could make your anti KZH choosable if you want it connected to your database or not. Well im thankful for you taking your time and helped me out with this. Tell me if you want something to return the favour.
__________________
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░█▀▀ ░█▀█ ░█ ░█▀▀ ░░█▀▀ ░█▀█ ░█ ░█░░░
░█▀▀ ░█▀▀ ░█ ░█ ░░░░█▀▀ ░█▀█ ░█ ░█░░░
░▀▀▀ ░▀ ░░░▀ ░▀▀▀ ░░▀ ░░░▀░▀ ░▀ ░▀▀▀░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
D-TOX is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-23-2009 , 13:36   Re: Exolent Hidenseek 3.0 BETA
Reply With Quote #6

Your hosting is ready. I'm adding your sub domain as we speak lol .
Styles is offline
Send a message via AIM to Styles
MIX_3oN
New Member
Join Date: May 2011
Old 05-30-2011 , 06:43   Re: Exolent Hidenseek 3.0 BETA
Reply With Quote #7

I likes your Hidenseek 3.0 mod
Its work nice
MIX_3oN 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 08:40.


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