Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

Hidenseek, V3.0.1 ошибка компиляции

Статус пользователя Kapachun
сообщение 26.2.2016, 7:37
Сообщение #1
Стаж: 10 лет

Сообщений: 18
Благодарностей: 1
Полезность: 0

Добрый день я не смог с комплектировать плагин скачал вот от суда
Cкрытый текст
http://www.amxmod.net/forum/showthread.php?tid=239

пишет что не хватает #include < translator > (get_cvarptr_num) (get_cvarptr_string) (get_cvarptr_num)(DispatchKeyValue)(client_print_color)
вот исходник
Cкрытый текст
#include < translator >
#include < amxmod >
#include < amxmisc >
#include < cstrike >
#include < fun >

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

const FFADE_IN = 0x0000;

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

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_szNadeNames[ NadeTypes ][ ] =
{
"HE Grenade",
"Flashbang",
"Smoke Grenade"
};

new const g_iNadeIds[ NadeTypes ] =
{
CSW_HEGRENADE,
CSW_FLASHBANG,
CSW_SMOKEGRENADE
};

new const g_iNadeLimit[ NadeTypes ] =
{
1,
2,
1
};

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

enum NadeInfo
{
NADE_COUNT,
NADE_CHANCE
};

enum ArmorInfo
{
ARMOR_VALUE,
CsArmorType:ARMOR_TYPE
};

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

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

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

new const g_szArmorInfoToCvar[ ArmorInfo ][ ] =
{
"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 g_bConnected;
new g_bAlive;
new g_bSpawnedOnce;
new g_bHasKnife;
new g_bBlockResetHUD;
#define SetIdBits(%1,%2) %1 |= ( 1 << ( %2 - 1 ) )
#define RemoveIdBits(%1,%2) %1 &= ~( 1 << ( %2 - 1 ) )
#define GetIdBits(%1,%2) ( %1 & ( 1 << ( %2 - 1 ) ) )

new bool:g_bWeaponsGiven;

new g_iRoundsLost;
new bool:g_bDisableSlash = true;

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_ColorHud;
new pCvar_ColorBlind;
new pCvar_HiderKnifeVisible;
new pCvar_NadeInfo[ CsTeams ][ NadeTypes ][ NadeInfo ];
new pCvar_ArmorInfo[ CsTeams ][ 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 = ( 1 << _: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_szConfigFile[ ] = "hns.cfg"; // Config file

new g_szGameType[ ] = "HideNSeek";

new g_szChatPrefix[ ] = "[^4HNS^1]";

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

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

new bool:g_bVisibleTerrKnife = true;

new g_iNadeInfo[ CsTeams ][ 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_iArmorInfo[ CsTeams ][ 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 szValue[ 32 ];

num_to_str( _:g_bNoSlow, szValue, charsmax( szValue ) );
pCvar_NoSlow = register_cvar( "hns_noslow", szValue );

num_to_str( g_iHideTime, szValue, charsmax( szValue ) );
pCvar_HideTime = register_cvar( "hns_hidetime", szValue );

num_to_str( g_iMoneyValue, szValue, charsmax( szValue ) );
pCvar_Money = register_cvar( "hns_money", szValue );

num_to_str( g_iSilentFeet, szValue, charsmax( szValue ) );
pCvar_SilentFeet = register_cvar( "hns_silentfeet", szValue );

num_to_str( g_iNubSlashRounds, szValue, charsmax( szValue ) );
pCvar_NubSlash = register_cvar( "hns_nubslash", szValue );

num_to_str( _:g_bTimerSpeech, szValue, charsmax( szValue ) );
pCvar_TimerSpeech = register_cvar( "hns_timer_speech", szValue );

num_to_str( _:g_bDisableKillCommand, szValue, charsmax( szValue ) );
pCvar_DisableKill = register_cvar( "hns_disable_kill", szValue );

num_to_str( g_iHiderSurviveFrags, szValue, charsmax( szValue ) );
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 );

register_cvar( "hns_load_cfgfile", "1" );
set_task( 8.0, "TaskLoadCfgFile", 6873197 ); // After map config file

new iLen;
for( new i = 0; i < sizeof( g_iHudColors ); i++ )
{
iLen += formatex( szValue[ iLen ], charsmax( szValue ) - iLen, "%s%i", iLen ? " " : "", g_iHudColors[ i ] );
}
pCvar_ColorHud = register_cvar( "hns_color_hud", szValue );

iLen = 0;
for( new i = 0; i < sizeof( g_iBlindColors ); i++ )
{
iLen += formatex( szValue[ iLen ], charsmax( szValue ) - iLen, "%s%i", iLen ? " " : "", g_iBlindColors[ i ] );
}
pCvar_ColorBlind = register_cvar( "hns_color_blind", szValue );

num_to_str( _:g_bVisibleTerrKnife, szValue, charsmax( szValue ) );
pCvar_HiderKnifeVisible = register_cvar( "hns_hider_knife_visible", szValue );

new NadeTypes:iNadeType, NadeInfo:iNadeInfo, szCvar[ 64 ];
for( new CsTeams:iTeam = CS_TEAM_T; iTeam <= CS_TEAM_CT; iTeam++ )
{
for( iNadeType = NadeTypes:0; iNadeType < NadeTypes; iNadeType++ )
{
for( iNadeInfo = NadeInfo:0; iNadeInfo < NadeInfo; iNadeInfo++ )
{
formatex( szCvar, charsmax( szCvar ), "hns_%s_%s_%s", g_szTeamToCvar[ iTeam ], g_szNadeTypeToCvar[ iNadeType ], g_szNadeInfoToCvar[ iNadeInfo ] );
num_to_str( g_iNadeInfo[ iTeam ][ iNadeType ][ iNadeInfo ], szValue, charsmax( szValue ) );

pCvar_NadeInfo[ iTeam ][ iNadeType ][ iNadeInfo ] = register_cvar( szCvar, szValue );
}
}
}

new ArmorInfo:iArmorInfo;
for( new CsTeams:iTeam = CS_TEAM_T; iTeam <= CS_TEAM_CT; iTeam++ )
{
for( iArmorInfo = ArmorInfo:0; iArmorInfo < ArmorInfo; iArmorInfo++ )
{
formatex( szCvar, charsmax( szCvar ), "hns_%s_armor_%s", g_szTeamToCvar[ iTeam ], g_szArmorInfoToCvar[ iArmorInfo ] );
num_to_str( g_iArmorInfo[ iTeam ][ iArmorInfo ], szValue, charsmax( szValue ) );

pCvar_ArmorInfo[ iTeam ][ iArmorInfo ] = register_cvar( szCvar, szValue );
}
}
}

public TaskLoadCfgFile( )
{
if( get_cvar_num( "hns_load_cfgfile" ) > 0 )
{
new szConfigDir[ 32 ];
get_localinfo( "amx_configdir", szConfigDir, charsmax( szConfigDir ) );
if( !szConfigDir[ 0 ] )
{
build_path( szConfigDir, charsmax( szConfigDir ), "$configdir" );
}

server_cmd( "exec %s/%s", szConfigDir, g_szConfigFile );
server_exec( );
}
}

CacheCvars( )
{
static szColor[ 16 ], szPart[ 4 ], i, CsTeams:iTeam, NadeTypes:iNadeType, NadeInfo:iNadeInfo, ArmorInfo:iArmorInfo;

g_bNoSlow = bool:get_cvarptr_num( pCvar_NoSlow );
g_iHideTime = get_cvarptr_num( pCvar_HideTime );
g_iMoneyValue = get_cvarptr_num( pCvar_Money );
g_bVisibleTerrKnife = bool:get_cvarptr_num( pCvar_HiderKnifeVisible );
g_iSilentFeet = get_cvarptr_num( pCvar_SilentFeet );
g_iNubSlashRounds = get_cvarptr_num( pCvar_NubSlash );
g_bTimerSpeech = bool:get_cvarptr_num( pCvar_TimerSpeech );
g_bDisableKillCommand = bool:get_cvarptr_num( pCvar_DisableKill );
g_iHiderSurviveFrags = get_cvarptr_num( pCvar_HiderSurviveFrags );
get_cvarptr_string( pCvar_GameType, g_szGameType, charsmax( g_szGameType ) );
//get_cvarptr_string( pCvar_ChatPrefix, g_szChatPrefix, charsmax( g_szChatPrefix ) );

get_cvarptr_string( pCvar_ColorHud, szColor, charsmax( szColor ) );
//parse( szColor, szParts[ R ], 3, szParts[ G ], 3, szParts[ B ], 3 );
for( i = 0; i < sizeof( g_iHudColors ); i++ )
{
strbreak( szColor, szPart, charsmax( szPart ), szColor, charsmax( szColor ) );
g_iHudColors[ i ] = clamp( str_to_num( szPart ), 0, 255 );
}

get_cvarptr_string( pCvar_ColorBlind, szColor, charsmax( szColor ) );
//parse( szColor, szParts[ R ], 3, szParts[ G ], 3, szParts[ B ], 3, szParts[ A ], 3 );
for( i = 0; i < sizeof( g_iBlindColors ); i++ )
{
strbreak( szColor, szPart, charsmax( szPart ), szColor, charsmax( szColor ) );
g_iBlindColors[ i ] = clamp( str_to_num( szPart ), 0, 255 );
}

for( iTeam = CS_TEAM_T; iTeam <= CS_TEAM_CT; iTeam++ )
{
for( iNadeType = NadeTypes:0; iNadeType < NadeTypes; iNadeType++ )
{
for( iNadeInfo = NadeInfo:0; iNadeInfo < NadeInfo; iNadeInfo++ )
{
g_iNadeInfo[ iTeam ][ iNadeType ][ iNadeInfo ] = get_cvarptr_num( pCvar_NadeInfo[ iTeam ][ iNadeType ][ iNadeInfo ] );
}
}

for( iArmorInfo = ArmorInfo:0; iArmorInfo < ArmorInfo; iArmorInfo++ )
{
g_iArmorInfo[ iTeam ][ iArmorInfo ] = get_cvarptr_num( pCvar_ArmorInfo[ iTeam ][ iArmorInfo ] );
}
}
}

public plugin_precache( )
{
new iEntity = create_entity( "hostage_entity" );
entity_set_origin( iEntity, Float:{ 0.0, 0.0, -55000.0 } );
entity_set_size( iEntity, Float:{ -1.0, -1.0, -1.0 }, Float:{ 1.0, 1.0, 1.0 } );
DispatchSpawn( iEntity );

iEntity = create_entity( "player_weaponstrip" );
DispatchKeyValue( iEntity, "targetname", "stripper" );
DispatchSpawn( iEntity );

iEntity = create_entity( "game_player_equip" );
DispatchKeyValue( iEntity, "weapon_knife", "1" );
DispatchKeyValue( iEntity, "targetname", "equipment" );

iEntity = create_entity( "multi_manager" );
DispatchKeyValue( iEntity, "stripper", "0" );
DispatchKeyValue( iEntity, "equipment", "0.5" );
DispatchKeyValue( iEntity, "targetname", "game_playerspawn" );
DispatchKeyValue( iEntity, "spawnflags", "1" );
DispatchSpawn( iEntity );

iEntity = create_entity( "info_map_parameters" );
DispatchKeyValue( iEntity, "buying", "3" );
DispatchSpawn( iEntity );
}

bool:bIsSpawnedEntityToRemove( const szClassName[ ] )
{
static 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"
};

for( new i = 0; i < sizeof( szRemoveEntities ); i++ )
{
if( szClassName[ 0 ] == szRemoveEntities[ i ][ 0 ]
&& szClassName[ 5 ] == szRemoveEntities[ i ][ 5 ]
&& szClassName[ 10 ] == szRemoveEntities[ i ][ 10 ] )
{
return true;
}
}

return false;
}

public entity_spawn( iEntity )
{
static szClassName[ 32 ];
entity_get_string( iEntity, EV_SZ_classname, szClassName, charsmax( szClassName ) );

if( bIsSpawnedEntityToRemove( szClassName ) )
{
remove_entity( iEntity );

return PLUGIN_HANDLED;
}

return PLUGIN_CONTINUE;
}

public keyvalue( iEntity )
{
static szClassName[ 32 ], szKey[ 32 ], szValue[ 32 ];
copy_keyvalue( szClassName, charsmax ( szClassName ), szKey, charsmax( szKey ), szValue, charsmax( szValue ) );

if( equal( szClassName, "multi_manager" )
&& equal( szKey, "targetname" )
&& equal( szValue, "game_playerspawn" ) )
{
remove_entity( iEntity );

return PLUGIN_HANDLED;
}

return PLUGIN_CONTINUE;
}

public plugin_init( )
{
load_translations( "hns" );
register_plugin( PLUGIN_NAME, PLUGIN_VERS, PLUGIN_AUTH );
register_cvar( PLUGIN_NAME, PLUGIN_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_event( "DeathMsg", "EventDeathMsg", "a" );
register_event( "CurWeapon", "EventCurWeapon", "be", "1=1" );

register_logevent( "EventRoundStart", 2, "1=Round_Start" );
register_logevent( "EventRoundEnd", 2, "1=Round_End" );

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_block( get_user_msgid( "HostagePos" ), BLOCK_SET );
set_msg_block( g_iMsgId_StatusText, BLOCK_SET );
set_msg_block( g_iMsgId_StatusValue, BLOCK_SET );

register_message( get_user_msgid( "HideWeapon" ), "MessageHideWeapon" );
register_message( g_iMsgId_ScreenFade, "MessageScreenFade" );
register_message( get_user_msgid( "TextMsg" ), "MessageTextMsg" );

RegisterCvars( );

g_iMaxPlayers = get_maxplayers( );
}

public client_putinserver( client )
{
SetIdBits(g_bConnected, client);
}

public client_disconnect( client )
{
new i;
for( i = 0; i < sizeof( g_iPlayerTasks ); i++ )
{
remove_task( client + g_iPlayerTasks[ i ] );
}

RemoveIdBits(g_bSpawnedOnce, client);
RemoveIdBits(g_bAlive, client);
RemoveIdBits(g_bConnected, client);
RemoveIdBits(g_bBlockResetHUD, client);
}

public client_prethink( client )
{
if( GetIdBits(g_bAlive, client) )
{
if( g_bNoSlow )
{
entity_set_float( client, EV_FL_fuser2, 0.0 );
}

static CsTeams:iTeam;
iTeam = cs_get_user_team( client );

static iButton;
iButton = entity_get_int( client, EV_INT_button );

if( iButton & ( IN_ATTACK | IN_ATTACK2 )
&& GetIdBits(g_bHasKnife, client)
&& iTeam == CS_TEAM_T )
{
iButton &= ~( IN_ATTACK | IN_ATTACK2 );
entity_set_int( client, EV_INT_button, iButton );
}

if( g_bDisableSlash
&& iButton & IN_ATTACK
&& GetIdBits(g_bHasKnife, client)
&& iTeam == CS_TEAM_CT )
{
entity_set_int( client, EV_INT_button, iButton | IN_ATTACK2 );
}

if( g_iSilentFeet & ( 1 << _:iTeam ) )
{
entity_set_int( client, EV_INT_flTimeStepSound, 999 );
}

if( iTeam == CS_TEAM_CT )
{
if( g_iHideTimer > 0 )
{
entity_set_float( client, EV_FL_maxspeed, -1.0 );

static Float:vVelocity[ 3 ];
entity_get_vector( client, EV_VEC_velocity, vVelocity );

vVelocity[ 0 ] = 0.0;
vVelocity[ 1 ] = 0.0;

entity_set_vector( client, EV_VEC_velocity, vVelocity );

set_user_godmode( client, 1 );
}
else if( g_iHideTimer == 0 )
{
set_user_godmode( client, 0 );
}
}

static iTarget, iBody;
get_user_aiming( client, iTarget, iBody );

static iOldTarget[ 33 ], iResetCount[ 33 ];

if( ( 1 <= iTarget <= g_iMaxPlayers ) && GetIdBits(g_bAlive, iTarget) )
{
static iOld, bool:bIsTeammate;
iOld = iOldTarget[ client ];
bIsTeammate = bool:( cs_get_user_team( iTarget ) == iTeam );

if( !iOld )
{
if( bIsTeammate )
{
UTIL_StatusValue( client, SV_FLAG_TEAMMATE, SV_TEAMVALUE_FRIEND );
}
else
{
UTIL_StatusValue( client, SV_FLAG_TEAMMATE, SV_TEAMVALUE_ENEMY );
}
}

if( iOld != iTarget )
{
iOldTarget[ client ] = iTarget;

UTIL_StatusValue( client, SV_FLAG_PLAYERID, iTarget );
}

if( !iOld )
{
if( bIsTeammate )
{
static szMessage[ 96 ];
formatex( szMessage, charsmax( szMessage ), "Friend: %%p2 - Health: %i%%%%", get_user_health( iTarget ) );

UTIL_StatusText( client, szMessage );
}
else
{
UTIL_StatusText( client, "Enemy: %p2" );
}
}
}
else if( iOldTarget[ client ] )
{
iOldTarget[ client ] = 0;
iResetCount[ client ] = 100;
}
else if( iResetCount[ client ] > 0 && --iResetCount[ client ] == 0 )
{
UTIL_StatusValue( client, SV_FLAG_PLAYERID, 0 );
UTIL_StatusText( client, "" );
}
}
}

public client_kill( client )
{
if( g_bDisableKillCommand )
{
static Float:fLastMessage[ 33 ], Float:fGametime;

fGametime = get_gametime( );

if( fLastMessage[ client ] <= ( fGametime - 1.0 ) )
{
console_print( client, _T( "You cannot kill yourself in HideNSeek!" ) );
client_print_color( client, client, "%s %s", g_szChatPrefix, _T( "You cannot kill yourself in HideNSeek!" ) );

fLastMessage[ client ] = fGametime;
}

return PLUGIN_HANDLED;
}

return PLUGIN_CONTINUE;
}

public EventNewRound( )
{
CacheCvars( );

if( g_bDisableSlash
&& ( g_iRoundsLost >= g_iNubSlashRounds > 0 || !g_iNubSlashRounds ) )
{
g_bDisableSlash = false;

if( g_iNubSlashRounds )
{
client_print_color( -1, 0, _T( "%s The seekers have lost ^4%i ^1round%s and can now use slash!" ), g_szChatPrefix, g_iNubSlashRounds, g_iNubSlashRounds == 1 ? "" : "s" );
}
}
else if( !g_bDisableSlash && g_iNubSlashRounds == -1 )
{
g_bDisableSlash = true;
}

g_bWeaponsGiven = false;
}

public EventRoundRestart( )
{
for( new client = 1; client <= g_iMaxPlayers; client++ )
{
if( GetIdBits(g_bAlive, client) )
{
SetIdBits(g_bBlockResetHUD, client);
}
}

g_iHideTimer = -1;

g_iRoundsLost = 0;
g_bDisableSlash = true;
}

public EventHidersWin( )
{
if( g_bDisableSlash )
{
g_iRoundsLost++;
}

if( g_iHiderSurviveFrags )
{
static i, iFrags;
for( i = 1; i <= g_iMaxPlayers; i++ )
{
if( GetIdBits(g_bAlive, i) && cs_get_user_team( i ) == CS_TEAM_T )
{
iFrags = get_user_frags( i ) + g_iHiderSurviveFrags;

set_user_frags( i, iFrags );

UTIL_ScoreInfo( i, iFrags, cs_get_user_deaths( i ), CS_TEAM_T );

client_print_color( i, i, _T( "%s You earned ^4%i ^1frag%s for surviving the round!" ), g_szChatPrefix, g_iHiderSurviveFrags, g_iHiderSurviveFrags == 1 ? "" : "s" );
}
}
}
}

public EventResetHud( client )
{
if( GetIdBits(g_bBlockResetHUD, client) )
{
RemoveIdBits(g_bBlockResetHUD, client);
return;
}

SetIdBits(g_bAlive, client);

if( !g_iMoneyValue )
{
UTIL_HideWeapon( client, HIDE_MONEY );
}

static CsTeams:iTeam;
iTeam = cs_get_user_team( client );

if( iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT )
{
static iParams[ 2 ];
iParams[ 0 ] = _:iTeam;

set_task( 0.3, "TaskCheckModel", client + TASK_ID_CHECKMODEL, iParams, sizeof( iParams ) );

if( g_bWeaponsGiven )
{
set_task( 0.6, "TaskGiveWeapons", client + TASK_ID_GIVEWEAPONS, iParams, sizeof( iParams ) );
}
}

if( !GetIdBits(g_bSpawnedOnce, client) )
{
TaskShowPluginInfo( client + TASK_ID_PLUGININFO );

SetIdBits(g_bSpawnedOnce, client);
}
}

public EventMoney( client )
{
if( g_iMoneyValue >= 0 )
{
cs_set_user_money( client, g_iMoneyValue, _:( g_iMoneyValue > 0 ) );

if( !g_iMoneyValue )
{
UTIL_HideWeapon( client, HIDE_MONEY );
}
}
}

public EventDeathMsg( )
{
RemoveIdBits(g_bAlive, read_data( 2 ));
}

public EventCurWeapon( client )
{
new iWeaponId = read_data( 2 );

if( iWeaponId == CSW_KNIFE )
{
SetIdBits(g_bHasKnife, client);

if( !g_bVisibleTerrKnife && cs_get_user_team( client ) == CS_TEAM_T )
{
entity_set_string( client, EV_SZ_viewmodel, "" );
entity_set_string( client, EV_SZ_weaponmodel, "" );
}
}
else
{
RemoveIdBits(g_bHasKnife, client);
}
}

public EventRoundStart( )
{
remove_task( TASK_ID_HIDETIMER );

g_iHideTimer = g_iHideTime;

TaskHideTimer( );
}

public EventRoundEnd( )
{
remove_task( TASK_ID_HIDETIMER );

static iHider, iSeeker, iHiderAlive;
GetHiderAndSeeker( iHider, iSeeker, iHiderAlive );

if( !iHider || !iSeeker )
{
return;
}

static szMessage[ 64 ];
if( iHiderAlive )
{
copy( szMessage, charsmax( szMessage ), "Hiders won round^nNo team change" );
}
else
{
copy( szMessage, charsmax( szMessage ), "Seekers won round^nSwitching teams" );

SwapTeams( );
}

set_hudmessage( g_iHudColors[ R ], g_iHudColors[ G ], g_iHudColors[ B ], -1.0, -1.0, 0, 0.0, 5.0, 0.1, 0.1, 1 );
show_hudmessage( 0, "%s", _T( szMessage ) );
}

public gamedescription( )
{
get_cvarptr_string( pCvar_GameType, g_szGameType, charsmax( g_szGameType ) );
if( g_szGameType[ 0 ] )
{
set_gamedescription( g_szGameType );

return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}

public MessageHideWeapon( iMsgId, iDest, client )
{
if( !g_iMoneyValue )
{
set_msg_arg_int( 1, get_msg_arg_int( 1 ) | HIDE_MONEY );

//UTIL_HideWeapon( client, HIDE_MONEY );
}
}

public MessageScreenFade( iMsgId, iDest, client )
{
if( get_msg_arg_int( 4 ) == 255
&& get_msg_arg_int( 5 ) == 255
&& get_msg_arg_int( 6 ) == 255 )
{
switch( cs_get_user_team( client ) )
{
case CS_TEAM_T:
{
return PLUGIN_HANDLED;
}
case CS_TEAM_CT:
{
if( g_iHideTimer > 0 )
{
return PLUGIN_HANDLED;
}
}
}
}

return PLUGIN_CONTINUE;
}

public MessageTextMsg( iMsgId, iDest, client )
{
static const szTerroristMessage[ ] = "#Terrorists_Win";
static const szHostageMessage[ ] = "#Hostages_Not_Rescued";
static const szCTMessage[ ] = "#CTs_Win";

static szMessage[ 24 ];
get_msg_arg_string( 2, szMessage, charsmax( szMessage ) );

if( equal( szMessage, szTerroristMessage )
|| equal( szMessage, szHostageMessage ) )
{
client_print( 0, print_center, _T( "Hiders Win!" ) );

return PLUGIN_HANDLED;
}
else if( equal( szMessage, szCTMessage ) )
{
client_print( 0, print_center, _T( "Seekers Win!" ) );

return PLUGIN_HANDLED;
}

return PLUGIN_CONTINUE;
}

public TaskHideTimer( )
{
if( g_iHideTimer > 0 )
{
static iHider, iSeeker;
GetHiderAndSeeker( iHider, iSeeker );

if( !iHider || !iSeeker )
{
g_iHideTimer = 0;
}
}

static CsTeams:iTeam, client;

if( g_iHideTimer > 0 )
{
static szSound[ 16 ];
if( g_bTimerSpeech )
{
num_to_word( g_iHideTimer, szSound, charsmax( szSound ) );
}

for( client = 1; client <= g_iMaxPlayers; client++ )
{
if( GetIdBits(g_bConnected, client) )
{
iTeam = cs_get_user_team( client );

if( iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT )
{
if( iTeam == CS_TEAM_CT && GetIdBits(g_bAlive, client) )
{
UTIL_ScreenFade( client, 1.5, g_iBlindColors[ R ], g_iBlindColors[ G ], g_iBlindColors[ B ], g_iBlindColors[ A ] );
}

set_hudmessage( g_iHudColors[ R ], g_iHudColors[ G ], g_iHudColors[ B ], -1.0, -1.0, 0, 0.0, 1.1, 0.1, 0.1, 1 );
show_hudmessage( client, _T( "Hiders have %i second%s to hide!" ), g_iHideTimer, g_iHideTimer == 1 ? "" : "s" );

if( g_bTimerSpeech )
{
client_cmd( client, "spk vox/%s.wav", szSound );
}
}
}
}
}
else if( g_iHideTimer == 0 )
{
static iParams[ 2 ];

for( client = 1; client <= g_iMaxPlayers; client++ )
{
if( GetIdBits(g_bConnected, client) )
{
iTeam = cs_get_user_team( client );

if( iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT )
{
if( iTeam == CS_TEAM_CT && GetIdBits(g_bAlive, client) )
{
UTIL_ScreenFade( client, 0.0, 0, 0, 0, 0 );

ResetMaxspeed( client );
}

set_hudmessage( g_iHudColors[ R ], g_iHudColors[ G ], g_iHudColors[ B ], -1.0, -1.0, 0, 0.0, 1.1, 0.1, 0.1, 1 );
show_hudmessage( client, _T( "Ready or not, here we come!" ) );

iParams[ 0 ] = _:iTeam;
TaskGiveWeapons( iParams, client + TASK_ID_GIVEWEAPONS );
}
}
}

g_bWeaponsGiven = true;
}
else
{
for( client = 1; client <= g_iMaxPlayers; client++ )
{
if( GetIdBits(g_bConnected, client) )
{
if( GetIdBits(g_bAlive, client) && cs_get_user_team( client ) == CS_TEAM_CT )
{
UTIL_ScreenFade( client, 0.0, 0, 0, 0, 0 );

ResetMaxspeed( client );
}
}
}

return;
}

g_iHideTimer--;
set_task( 1.0, "TaskHideTimer", TASK_ID_HIDETIMER );
}

public TaskSwapTeams( )
{
static iCount, client;

iCount = 0;

for( client = g_iSwapStartIndex; client <= g_iMaxPlayers; client++ )
{
if( GetIdBits(g_bConnected, client) )
{
if( iCount >= SWAP_PER_INTERVAL )
{
g_iSwapStartIndex = client;
set_task( SWAP_INTERVAL, "TaskSwapTeams", TASK_ID_SWAPTEAMS );

return;
}

switch( cs_get_user_team( client ) )
{
case CS_TEAM_T:
{
cs_set_user_team( client, CS_TEAM_CT, CS_CT_GIGN );

iCount++;
}
case CS_TEAM_CT:
{
cs_set_user_team( client, CS_TEAM_T, CS_T_LEET );

iCount++;
}
}
}
}
}

bool:bIsValidTeamModel( const szModel[], const iTeam )
{
static const szTeamModels[ 8 ][ ] =
{
"leet", "arctic", "terror", "guerilla",
"gign", "sas", "gsg9", "urban"
};

new iMin = (iTeam == _:CS_TEAM_T) ? 0 : 4;
new iMax = (iTeam == _:CS_TEAM_T) ? 4 : 8;

for( new i = iMin; i < iMax; i++ )
{
if( szModel[ 0 ] == szTeamModels[ i ][ 0 ]
&& szModel[ 1 ] == szTeamModels[ i ][ 1 ]
&& szModel[ 2 ] == szTeamModels[ i ][ 2 ] )
{
return true;
}
}

return false;
}

public TaskCheckModel( iParams[ ], iTaskId )
{
static CsTeams:iTeam, client;

iTeam = CsTeams:iParams[ 0 ];
client = iTaskId - TASK_ID_CHECKMODEL;

static szModel[ 32 ];
get_keyvalue( client, "model", szModel, charsmax( szModel ) );

if( !bIsValidTeamModel( szModel, _:iTeam ) )
{
static const szDefaultModels[ CsTeams ][ ] =
{
"",
"leet",
"gign",
""
};

cs_set_user_model( client, szDefaultModels[ iTeam ] );
}
}

public TaskGiveWeapons( iParams[ ], iTaskId )
{
static CsTeams:iTeam, client;

iTeam = CsTeams:iParams[ 0 ];
client = iTaskId - TASK_ID_GIVEWEAPONS;

static NadeTypes:iNade, iLimit, iGiveMax, iChance, iTries, iGiven;

for( iNade = NadeTypes:0; iNade < NadeTypes; iNade++ )
{
iLimit = g_iNadeLimit[ iNade ];
iGiveMax = g_iNadeInfo[ iTeam ][ iNade ][ NADE_COUNT ];
iChance = g_iNadeInfo[ iTeam ][ iNade ][ NADE_CHANCE ];
iGiven = 0;

for( iTries = 0; iTries < iGiveMax; iTries++ )
{
if( iChance == 100 || random_num( 1, 100 ) <= iChance )
{
iGiven++;
}
}

if( iGiven )
{
for( iTries = 0; iTries < iGiven; iTries++ )
{
if( iTries < iLimit )
{
give_item( client, g_szNadeWeaponNames[ iNade ] );
}
else
{
cs_set_user_bpammo( client, g_iNadeIds[ iNade ], iGiven );

break;
}
}

if( iChance != 100 )
{
client_print_color( client, client, _T( "%s You received ^4%i ^1of ^4%i ^1%s%s! (^4%i^1%% of chance)." ),\
g_szChatPrefix,\
iGiven,\
iGiveMax,\
g_szNadeNames[ iNade ],\
iGiveMax == 1 ? "" : "s",\
iChance
);
}
}
}

cs_set_user_armor( client, g_iArmorInfo[ iTeam ][ ARMOR_VALUE ], g_iArmorInfo[ iTeam ][ ARMOR_TYPE ] );
}

public TaskShowPluginInfo( iTaskId )
{
new id = iTaskId - TASK_ID_PLUGININFO;
client_print_color( id, id, _T( "%s This server is using ^3%s ^1v^4%s^1, by ^3%s^1!" ), g_szChatPrefix, PLUGIN_NAME, PLUGIN_VERS, PLUGIN_AUTH );

set_task( 360.0, "TaskShowPluginInfo", iTaskId );
}

GetHiderAndSeeker( &iHider, &iSeeker, &iHiderAlive=0 )
{
iHider = 0;
iSeeker = 0;
iHiderAlive = 0;

static i;
for( i = 1; i <= g_iMaxPlayers; i++ )
{
if( GetIdBits(g_bConnected, i) )
{
switch( cs_get_user_team( i ) )
{
case CS_TEAM_T:
{
if( !iHider )
{
iHider = i;

if( !iHiderAlive && GetIdBits(g_bAlive, i) )
{
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, iUnused;

switch( get_user_weapon( client, iUnused, iUnused ) )
{
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_float( client, EV_FL_maxspeed, fMaxSpeed );
}

SecondsToScreenFadeUnits( const Float:fSeconds, const bool:bClamp=true )
{
static iUnits;
iUnits = floatround( fSeconds * float( 1 << 12 ) );

if( bClamp )
{
iUnits = clamp( iUnits, 0, 0xFFFF );
}

return iUnits;
}

UTIL_HideWeapon( const client, const iFlags )
{
set_offset_int( client, m_iHideHUD, get_offset_int( client, m_iHideHUD ) | iFlags );
}

UTIL_ScoreInfo( const client, const iFrags, const iDeaths, const CsTeams:iTeam )
{
message_begin( MSG_BROADCAST, g_iMsgId_ScoreInfo );
write_byte( client );
write_short( iFrags );
write_short( iDeaths );
write_short( 0 );
write_short( _:iTeam );
message_end( );
}

UTIL_ScreenFade( const client, const Float:fDuration, const iRed, const iGreen, const iBlue, const iAlpha )
{
message_begin( client ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, g_iMsgId_ScreenFade, _, client );
write_short( SecondsToScreenFadeUnits( fDuration ) );
write_short( SecondsToScreenFadeUnits( fDuration * 0.75 ) );
write_short( FFADE_IN );
write_byte( iRed );
write_byte( iGreen );
write_byte( iBlue );
write_byte( iAlpha );
message_end( );
}

UTIL_StatusText( const client, const szMessage[ ] )
{
message_begin( client ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, g_iMsgId_StatusText, _, client );
write_byte( 0 );
write_string( szMessage );
message_end( );
}

UTIL_StatusValue( const client, const iFlag, const iValue )
{
message_begin( client ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, g_iMsgId_StatusValue, _, client );
write_byte( iFlag );
write_short( iValue );
message_end( );
}


Отредактировал: meloman, - 26.2.2016, 8:36
Причина: Выдано устное предупреждение!
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя Denger167
сообщение 26.2.2016, 8:30
Сообщение #2


Стаж: 12 лет
Город: Магнитогорск

Сообщений: 175
Благодарностей: 63
Полезность: 54

Kapachun,

Инклуд < translator > нужно найти и скомпилить локально!


Имей смелость иметь свое мнение. Имей мудрость скрывать егo.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Kapachun
сообщение 26.2.2016, 8:46
Сообщение #3
Стаж: 10 лет

Сообщений: 18
Благодарностей: 1
Полезность: 0

Цитата(Denger167 @ 26.2.2016, 8:30) *

можешь скинуть?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Denger167
сообщение 26.2.2016, 8:55
Сообщение #4


Стаж: 12 лет
Город: Магнитогорск

Сообщений: 175
Благодарностей: 63
Полезность: 54

Kapachun,

Посмотрел у меня нет его точно( Если найду скину конечно!


Имей смелость иметь свое мнение. Имей мудрость скрывать егo.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Timajkee
сообщение 26.2.2016, 9:13
Сообщение #5
Стаж: 10 лет
Город: Узбекистан

Сообщений: 96
Благодарностей: 12
Полезность: 18

Kapachun,
Лутшее Hide N SeekVersion 2.8 постав это лутшее и стабилен
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
  Ответить в данную темуНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: