вопрос
Есть доп. поле для вставки кода типо
Но мое доп. поле урезает исходный код на половину. Почему? Как исправить?
НУ так вот, Вставляю допустим это:
[код]Как на dle-faq[/код]
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <screenfade_util.inc>
//#define SWITCH_TEAM_SCORES // Define this if you want to switch team scores when hns_switch 1
#if defined SWITCH_TEAM_SCORES
#include orpheu
#else
#define DONT_SWITCH_TEAM_SCORES
#endif
#define VERSION "0.4"
#if defined SWITCH_TEAM_SCORES
new OrpheuFunction:g_OfSwapAllPlayers
new g_pGameRules
new bool:g_bSwapTeamsOnNextRound
#endif
#if defined DONT_SWITCH_TEAM_SCORES
new g_iMaxPlayers
#endif
new bool:g_bFreezePeriod
new g_On, g_Destroy, g_FlashNum, g_SmokeNum, g_NewFlashNum , g_NewSmokeNum , g_ScreenColor, g_Switch, g_Footsteps
new g_iHostageEnt, g_iRegisterSpawn, g_szNadeMenu[ 64 ];
const MENU_KEYS = ( 1<<0 | 1<<1 );
new const g_szDefaultEntities[][] = {
"func_hostage_rescue",
"info_hostage_rescue",
"func_bomb_target",
"info_bomb_target",
"hostage_entity",
"info_vip_start",
"func_vip_safetyzone",
"func_escapezone",
"armoury_entity",
"monster_scentist"
}
public plugin_precache() {
g_iRegisterSpawn = register_forward(FM_Spawn, "fwdSpawn", 1)
#if defined SWITCH_TEAM_SCORES
OrpheuRegisterHook(OrpheuGetFunction("InstallGameRules"), "OnInstallGameRules_Post", OrpheuHookPost)
#endif
}
#if defined SWITCH_TEAM_SCORES
public OnInstallGameRules_Post()
{
g_pGameRules = OrpheuGetReturn()
}
#endif
public plugin_cfg( )
{
new iLen = charsmax( g_szNadeMenu );
add( g_szNadeMenu, iLen, "\rNew nades?^n" );
add( g_szNadeMenu, iLen, "^n\r1. \wYes" );
add( g_szNadeMenu, iLen, "^n\r2. \wNo" );
register_menucmd( register_menuid( "NadesMenu" ), MENU_KEYS, "HandleNadesMenu" );
}
public fwdSpawn(entid) {
static szClassName[32];
if(pev_valid(entid)) {
pev(entid, pev_classname, szClassName, 31);
for(new i = 0; i < sizeof g_szDefaultEntities; i++) {
if(equal(szClassName, g_szDefaultEntities[i])) {
engfunc(EngFunc_RemoveEntity, entid);
break;
}
}
}
}
public plugin_init() {
register_plugin("Simply Hide'N'Seek", VERSION, "Garey")
g_On= register_cvar( "hns_toggle", "1" )
g_Footsteps = register_cvar( "hns_footsteps", "1" );
g_Switch =register_cvar("hns_switch", "1")
g_ScreenColor=register_cvar("hns_screenfade", "000000000255") // RRRGGGBBB / R=Red G=Green B=Blue A=Alpha
g_Destroy= register_cvar( "hns_destroy", "1" )
g_FlashNum= register_cvar( "hns_flash", "3" )
g_SmokeNum= register_cvar( "hns_smoke", "1" )
g_NewFlashNum = register_cvar("hns_flash_add", "3");
g_NewSmokeNum= register_cvar("hns_smoke_add", "1");
g_iHostageEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "hostage_entity"));
set_pev(g_iHostageEnt, pev_origin, Float:{ 0.0, 0.0, -55000.0 });
set_pev(g_iHostageEnt, pev_size, Float:{ -1.0, -1.0, -1.0 }, Float:{ 1.0, 1.0, 1.0 });
dllfunc(DLLFunc_Spawn, g_iHostageEnt);
register_message(get_user_msgid("Money"), "MessageMoney")
register_message(get_user_msgid( "TextMsg" ) ,"msgTextMsg" )
register_event("CurWeapon", "eCurWeapon", "be", "1!0")
register_event( "DeathMsg", "event_DeathMsg", "a" )
register_event("HLTV", "Event_Pre_Freezetime", "a", "1=0", "2=0") // Detect freezetime started
register_logevent("Event_Post_Freezetime", 2, "0=World triggered", "1=Round_Start") // Detect freezetime ended
RegisterHam( Ham_Spawn, "player", "CBasePlayer_Spawn_Post", true)
RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_knife", "FwdKnifePrim" );
#if defined SWITCH_TEAM_SCORES
g_OfSwapAllPlayers = OrpheuGetFunction("SwapAllPlayers", "CHalfLifeMultiplay")
#endif
#if defined DONT_SWITCH_TEAM_SCORES
g_iMaxPlayers = get_maxplayers();
#endif
unregister_forward(FM_Spawn, g_iRegisterSpawn, 1)
}
public event_DeathMsg( )
{
new iVictim = read_data( 2 );
if( get_pcvar_num( g_On ) && cs_get_user_team( iVictim ) == CS_TEAM_T )
{
new iPlayers[ 32 ], iNum;
get_players( iPlayers, iNum, "ae", "TERRORIST" );
if( iNum == 1 )
{
show_menu( iPlayers[ 0 ], MENU_KEYS, g_szNadeMenu, -1, "NadesMenu" );
}
}
}
public Event_Pre_Freezetime() {
g_bFreezePeriod = true
if(!get_pcvar_num( g_On))
return
#if defined SWITCH_TEAM_SCORES
if( g_bSwapTeamsOnNextRound )
{
g_bSwapTeamsOnNextRound = false
OrpheuCall(g_OfSwapAllPlayers, g_pGameRules)
}
#endif
if(get_pcvar_num(g_Destroy))
set_task(0.1, "TaskDestroyBreakables") // if eneity killed in previous round it will be spawn on this round so we need to wait spawn entity the move it.
else
TaskDestroyBreakables( ) // just move back entities
}
public Event_Post_Freezetime() {
new iPlayers[32], iNum, iColor[3], iAlpha
get_players(iPlayers, iNum, "ae", "CT")
g_bFreezePeriod = false
for(--iNum; iNum>=0; iNum--) {
get_pcvar_color_alpha(g_ScreenColor, iColor, iAlpha)
UTIL_ScreenFade(iPlayers[iNum], iColor, 2.0, _, iAlpha)
}
}
public msgTextMsg( const MsgId, const MsgDest, const MsgEntity )
{
if( get_pcvar_num( g_On) )
{
static szMessage[ 10 ];
get_msg_arg_string( 2, szMessage, 9 );
if( szMessage[ 8 ] == 's' ) // #Terrorists_Win & #Hostages_Not_Rescued
{
set_msg_arg_string( 2, "Hiders Win!" );
}
else if( szMessage[ 2 ] == 'T' ) // #CTs_Win
{
set_msg_arg_string( 2, "Seekers Win!" );
if( get_pcvar_num( g_Switch ) )
{
#if defined DONT_SWITCH_TEAM_SCORES
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
if( is_user_connected( i ) )
{
switch( cs_get_user_team( i ) )
{
case CS_TEAM_CT: cs_set_user_team( i, CS_TEAM_T );
case CS_TEAM_T: cs_set_user_team( i, CS_TEAM_CT );
}
}
}
#endif
#if defined SWITCH_TEAM_SCORES
g_bSwapTeamsOnNextRound = true
#endif
}
}
}
}
public CBasePlayer_Spawn_Post(id) {
if (!is_user_alive(id))
return;
show_menu(id, 0, ""); // to prevent bugs with nades menu
SetRole(id)
}
public FwdKnifePrim( const iPlayer )
{
if( get_pcvar_num( g_On ))
{
ExecuteHamB( Ham_Weapon_SecondaryAttack, iPlayer );
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public SetRole(id) {
if(!get_pcvar_num(g_On))
return
new CsTeams:team = cs_get_user_team(id)
strip_user_weapons(id)
if( get_pcvar_num( g_Footsteps ) == 3 )
set_user_footsteps( id, 1 );
else
set_user_footsteps( id, get_pcvar_num( g_Footsteps ) == _:team ? 1 : 0 );
switch (team)
{
case CS_TEAM_T:
{
if( get_pcvar_num( g_FlashNum ) >= 1 )
{
give_item( id, "weapon_flashbang" );
cs_set_user_bpammo( id, CSW_FLASHBANG, get_pcvar_num( g_FlashNum ) );
}
if( get_pcvar_num( g_SmokeNum ) >= 1 )
{
give_item( id, "weapon_smokegrenade" );
cs_set_user_bpammo( id, CSW_SMOKEGRENADE, get_pcvar_num( g_SmokeNum ) );
}
}
case CS_TEAM_CT:
{
give_item(id, "weapon_knife")
if(g_bFreezePeriod)
{
new iColor[3], iAlpha
get_pcvar_color_alpha(g_ScreenColor, iColor, iAlpha)
UTIL_ScreenFade(id,iColor,0.0,_,iAlpha,FFADE_OUT|FFADE_STAYOUT, true)
}
}
}
}
public eCurWeapon(id) {
new CsTeams:team = cs_get_user_team(id)
if(!g_bFreezePeriod)
return
if (team == CS_TEAM_T)
cs_reset_user_maxspeed(id)
}
public cs_reset_user_maxspeed(id) {
engfunc(EngFunc_SetClientMaxspeed, id, 250.0);
set_pev(id, pev_maxspeed, 250.0)
return PLUGIN_HANDLED
}
public TaskDestroyBreakables( ) {
new iEntity = -1
while ( ( iEntity = find_ent_by_class( iEntity, "func_breakable" ) ) ) {
if( entity_get_float( iEntity , EV_FL_takedamage ) ) {
switch(get_pcvar_num(g_Destroy))
{
case 0:
entity_set_vector( iEntity, EV_VEC_origin, Float:{ 0.0, 0.0, 0.0} )
case 1:
entity_set_vector( iEntity, EV_VEC_origin, Float:{ 10000.0, 10000.0, 10000.0} )
}
}
}
}
public HandleNadesMenu( iPlayer, iKey )
{
if( !iKey )
{
if( get_pcvar_num( g_On ))
{
new clip, ammo
if( get_pcvar_num( g_NewFlashNum ) >= 1 )
{
get_user_ammo(iPlayer, CSW_FLASHBANG, clip, ammo)
if(( get_pcvar_num(g_FlashNum ) < 1 ) || ammo == 0)
{
give_item( iPlayer, "weapon_flashbang" );
cs_set_user_bpammo( iPlayer, CSW_FLASHBANG, get_pcvar_num( g_NewFlashNum ) )
}
else
{
cs_set_user_bpammo( iPlayer, CSW_FLASHBANG, 0) // Prevent no pick sound bug
give_item( iPlayer, "weapon_flashbang" )
cs_set_user_bpammo( iPlayer, CSW_FLASHBANG, ammo+get_pcvar_num( g_NewFlashNum ) )
}
}
if( get_pcvar_num( g_NewSmokeNum ) >= 1 )
{
get_user_ammo(iPlayer, CSW_SMOKEGRENADE, clip, ammo)
if(( get_pcvar_num(g_SmokeNum ) < 1 ) || ammo == 0)
{
give_item( iPlayer, "weapon_smokegrenade" );
cs_set_user_bpammo( iPlayer, CSW_SMOKEGRENADE, get_pcvar_num( g_NewSmokeNum ) )
}
else
{
cs_set_user_bpammo( iPlayer, CSW_SMOKEGRENADE, 0) // Prevent no pick sound bug
give_item( iPlayer, "weapon_smokegrenade" );
cs_set_user_bpammo( iPlayer, CSW_SMOKEGRENADE, ammo+get_pcvar_num( g_NewSmokeNum ) )
}
}
}
}
show_menu(iPlayer, 0, "");
}
get_pcvar_color_alpha( g_pCvar , iColor[] , &iAlpha=0 )
{
new szColor[13]
if( get_pcvar_string(g_pCvar, szColor, charsmax(szColor)) != charsmax(szColor) )
{
abort(AMX_ERR_GENERAL, "Color cvar must be 12 chars, format ^"RRRGGGBBBAAA^"")
}
iColor[Red] = parse_color( szColor, 0 )
iColor[Green] = parse_color( szColor, 3 )
iColor[Blue] = parse_color( szColor, 6 )
iAlpha = parse_color( szColor, 9 )
}
parse_color(szColor[], iStart)
{
return 100 * szColor[iStart] + 10 * szColor[iStart+1] + szColor[iStart+2] - 5328
}
public MessageMoney(msgid, dest, id)
{
set_pdata_int(id, 115, 0);
set_msg_arg_int(1, ARG_LONG, 0);
}
Но мое доп. поле урезает исходный код на половину. Почему? Как исправить?