ребят очень прошу помогите исправит ошибку. Он выдает и все
Код:
#include <amxmodx> #include <cstrike> #include <engine> #include <fakemeta> #include <fun> #include <hamsandwich> #include <colorchat> #include <screenfade_util.inc> #define VERSION "1.0b" #define DONT_SWITCH_TEAM_SCORES #if defined SWITCH_TEAM_SCORES new OrpheuFunction:g_OfSwapAllPlayers new g_pGameRules new bool:g_bSwapTeamsOnNextRound #endif #if defined DONT_SWITCH_TEAM_SCORES new hnsru_iMaxPlayers #endif new bool:g_bFreezePeriod new bool:g_bLastFlash new g_On, g_Destroy, g_FlashNum, g_SmokeNum, g_NewFlashNum, g_ScreenColor, g_NewSmokeNum, g_Switch, g_Footsteps new g_iHostageEnt, g_iRegisterSpawn, g_szNadeMenu[ 64 ]; new g_iSpectatedId[33]; new g_msgScreenFade; const m_pPlayer = 41; new bool:gOnOff[33] = { true, ... }; const EXTRAOFFSET_WEAPONS = 4; const m_flNextPrimaryAttack = 46; const m_flNextSecondaryAttack = 47; new g_soundlist[] = "weapons/knife_deploy1.wav" 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("HideNSeek Mode", VERSION, "HNSRU and Rad"); // Sideways / Garey state initializing g_On= register_cvar( "hnsru_toggle", "1" ) g_Footsteps = register_cvar( "hnsru_footsteps", "1" ); g_ScreenColor = register_cvar("hnsru_screenfade", "000000000000") // RRRGGGBBB / R=Red G=Green B=Blue A=Alpha (000000000255) g_Switch =register_cvar("hnsru_switch", "1") g_Destroy= register_cvar( "hnsru_destroy", "1" ) g_FlashNum= register_cvar( "hnsru_flash", "2" ) g_SmokeNum= register_cvar( "hnsru_smoke", "1" ) g_NewFlashNum = register_cvar("hnsru_flash_add", "0"); g_NewSmokeNum= register_cvar("hnsru_smoke_add", "0"); register_clcmd ( "say /knife", "cmdShowKnife"); register_clcmd ( "say /showknife", "cmdShowKnife"); register_clcmd ( "say /hideknife", "cmdShowKnife"); g_msgScreenFade = get_user_msgid("ScreenFade"); register_message( g_msgScreenFade, "msg_ScreenFade" ); 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_forward( FM_AddToFullPack, "fwdAddToFullPack_Post", 1 ); register_message(get_user_msgid("Money"), "MessageMoney") 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_event( "SpecHealth2", "eventSpecHealth2", "bd" ); register_logevent("Event_Post_Freezetime", 2, "0=World triggered", "1=Round_Start") // Detect freezetime ended register_logevent("eventRoundEnd", 2, "0=World triggered", "1=Round_Draw", "1=Round_End"); RegisterHam( Ham_Spawn, "player", "CBasePlayer_Spawn_Post", true) RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_knife", "FwdKnifePrim" ); RegisterHam( Ham_Item_Deploy, "weapon_knife", "FwdDeployKnife", 1 ) #if defined SWITCH_TEAM_SCORES g_OfSwapAllPlayers = OrpheuGetFunction("SwapAllPlayers", "CHalfLifeMultiplay") #endif #if defined DONT_SWITCH_TEAM_SCORES hnsru_iMaxPlayers = get_maxplayers(); #endif unregister_forward(FM_Spawn, g_iRegisterSpawn, 1) register_forward(FM_EmitSound, "block_sound") // aeiee?o? iaooe caoe ii?ea o TT set_msg_block(get_user_msgid("HudTextArgs"), BLOCK_SET); // Aei?o iaoa? aaoieoiua DHUD Green iaaiene io CS } public client_connect(id) { gOnOff[id] = true; } public cmdShowKnife(id) { if(is_user_connected( id )) { if( gOnOff[id] ) { entity_set_string( id, EV_SZ_viewmodel, "") gOnOff[id] = false; ColorChat( id, RED, "^1[^3HNSRU^1] Knife for terrorists is^3 hidden") } else { entity_set_string( id, EV_SZ_viewmodel, "models/v_knife.mdl") gOnOff[id] = true; ColorChat( id, GREEN, "^1[^3HNSRU^1] Knife for terrorists is^4 visible") } } } public msg_ScreenFade( iMsgId, iMsgDest, id ) <initializing, initialized> { //if(war) { if(get_pcvar_num( g_On)) { if( get_msg_arg_int( 4 ) == 255 && get_msg_arg_int( 5 ) == 255 && get_msg_arg_int( 6 ) == 255 ) { if(is_user_connected(id)) { if((cs_get_user_team(id) == CS_TEAM_T) || (cs_get_user_team(id) == CS_TEAM_SPECTATOR)) { return PLUGIN_HANDLED; } } } } //} return PLUGIN_CONTINUE; } public event_DeathMsg( ) { if(!get_pcvar_num( g_On)) return 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 ) { if(g_bLastFlash == false) { if((get_pcvar_num( g_NewFlashNum ) >= 1) || (get_pcvar_num( g_NewSmokeNum ) >= 1)) show_menu( iPlayers[ 0 ], MENU_KEYS, g_szNadeMenu, -1, "NadesMenu" ); g_bLastFlash = true } } } } public Event_Pre_Freezetime() { g_bLastFlash = false 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 eventRoundEnd() { if( get_pcvar_num( g_On) ) { new iPlayers[ 32 ], iNum; get_players(iPlayers, iNum, "ae", "TERRORIST"); if(!iNum) // CT win { if( get_pcvar_num( g_Switch ) ) { #if defined DONT_SWITCH_TEAM_SCORES for( new i = 1; i <= hnsru_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: { give_item(id, "weapon_knife") 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) { if(!get_pcvar_num( g_On)) return 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, ""); } public fwdAddToFullPack_Post( es_handle, e, ent, host, hostflags, player, pset ) { if(g_bFreezePeriod && get_pcvar_num( g_On)) if( player && host != ent && ent != g_iSpectatedId[host] && get_user_team(host) == 2 && get_user_team(ent) == 1 ) { set_es( es_handle, ES_Origin, { 999999999.0, 999999999.0, 999999999.0 } ); set_es( es_handle, ES_RenderMode, kRenderTransAlpha ); set_es( es_handle, ES_RenderAmt, 0 ); return FMRES_IGNORED; } return FMRES_IGNORED; } public MessageMoney(msgid, dest, id) { set_pdata_int(id, 115, 0); set_msg_arg_int(1, ARG_LONG, 0); } public eventSpecHealth2( id ) { g_iSpectatedId[id] = read_data( 2 ); } stock bool:isFlashBang2( ent ) { new iBits = get_pdata_int(ent, 114, 5) if( !iBits ) { return true; } return false; } public FwdDeployKnife( const iEntity ) { if(!get_pcvar_num(g_On)) return HAM_IGNORED; new iClient = get_pdata_cbase( iEntity, m_pPlayer, EXTRAOFFSET_WEAPONS ); if( get_user_team( iClient ) == 1 ) { if(!gOnOff[iClient] ) { entity_set_string( iClient, EV_SZ_viewmodel, "" ) } else { entity_set_string( iClient, EV_SZ_viewmodel, "models/v_knife.mdl" ) } set_pdata_float( iEntity, m_flNextPrimaryAttack, 9999.0, EXTRAOFFSET_WEAPONS ); set_pdata_float( iEntity, m_flNextSecondaryAttack, 9999.0, EXTRAOFFSET_WEAPONS ); } return HAM_IGNORED; } public event_ResetHud(id) { } 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 block_sound(entity, channel, const sound[]) { if ( equali(sound, g_soundlist) ) return FMRES_SUPERCEDE else return FMRES_IGNORED return FMRES_IGNORED } Источник
Отредактировал: Bloo, - 7.11.2016, 20:06
Причина : Выдано устное предупреждение!