Miłosz 2 789 Opublikowano 27 Lutego 2017 Udostępnij Opublikowano 27 Lutego 2017 Nazwa Moda: Classic AWP + Deathmatch v 4.0 Tarcza na 1 sekunde po zrespieniu Kod: /*----------------------------------------------------------- | AWP MOD 4.0 By InsaNe | | Thanks to jackass from AlliedModders for SemiClip Code | |-----------------------------------------------------------*/ #include <amxmodx> #include <fun> #include <cstrike> #include <amxmisc> #include <engine> #include <hamsandwich> #include <fakemeta> #define PLUGIN "AWP Clasic + Deathmatch MOD" #define VERSION "4.0" #define AUTHOR "InsaNe" #define MarkUserAlive(%1) g_bAlive |= 1<<(%1 & 31) #define ClearUserAlive(%1) g_bAlive &= ~( 1<<(%1 & 31) ) #define IsAlive(%1) g_bAlive & 1<<(%1 & 31) new CSW_MAXAMMO[33]= {-2, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100, -1, -1} new pCvar new pCvar2 new configsDir[64] new dFile[256] const MAX_PLAYERS = 32 new g_bAlive new g_iTeam[MAX_PLAYERS+1] new const g_szTeams[][] = { "", "TERRORIST", "CT" } enum { _T = 1, _CT } new g_iTeamSemiclip = _T | _CT public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) pCvar = register_cvar("awp_mod", "1") pCvar2 = register_cvar("awpdm_mod", "0") if(get_pcvar_num(pCvar2) == 1) { register_clcmd("joinclass", "HamKilledPost") RegisterHam(Ham_Killed, "player", "HamKilledPost", 1) RegisterHam(Ham_Touch, "weaponbox", "WeaponBox_Touch", 1) register_event("CurWeapon", "event_curweapon", "be", "1=1") } if(get_pcvar_num(pCvar) == 1) { remove_entity_name("func_bomb_target") RegisterHam (Ham_Spawn, "player", "ham_player_spawn", 1) register_message(get_user_msgid("StatusIcon"), "Msg_StatusIcon") RegisterHam(Ham_Spawn, "player", "Ham_CBasePlayer_Spawn_Post", 1) RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", 1) register_forward(FM_AddToFullPack, "FM_client_AddToFullPack_Post", 1) RegisterHam(Ham_Player_PreThink, "player", "Ham_CBasePlayer_PreThink_Post", 1) } } public plugin_cfg() { get_configsdir(configsDir, charsmax(configsDir)) formatex(dFile, charsmax(dFile), "%s/awpmod.cfg", configsDir) if(!file_exists(dFile)) { write_file ( dFile , "//--------------------------------------------" ); write_file ( dFile , "AWP Clasic + Deathmatch MOD 4.0 By InsaNe" ); write_file ( dFile , "Thanks to jackass from AlliedModders for SemiClip Code" ); write_file ( dFile , "//--------------------------------------------" ); write_file ( dFile , "" ); write_file ( dFile , "// Note - After editing cvars you need to change map before changes can take effect!" ); write_file ( dFile , "" ); write_file ( dFile , "awp_mod 1 // Turns ON/OFF the clasic AWP Mod" ); write_file ( dFile , "awpdm_mod 0 // Turns ON/OFF the DeathMatch AWP Mod (If this is set to 1, the cvar awp_mod also needs to be set to 1)." ); } } public plugin_end() { get_configsdir(configsDir, charsmax(configsDir)) server_cmd("exec %s/awpmod.cfg", configsDir); } public Msg_StatusIcon(msgid, msgdest, id) { static szMsg[8]; get_msg_arg_string(2, szMsg, 7); if(equal(szMsg, "buyzone") && get_msg_arg_int(1)) { set_pdata_int(id, 235, get_pdata_int(id, 235) & ~(1 << 0)); return PLUGIN_HANDLED; } return PLUGIN_CONTINUE; } public ham_player_spawn (const id,ent) { if(is_user_alive(id)) { set_user_godmode(id, 1) strip_user_weapons(id) set_task(0.5,"weapon",id) if (cs_get_user_team(id) == CS_TEAM_T) { set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal) }else{ set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal) } } return PLUGIN_CONTINUE; } public HamKilledPost(id) { if(!is_user_alive(id)) set_task(0.5, "respawn", id) } public respawn(id) { if(is_user_connected(id) && (cs_get_user_team(id) == CS_TEAM_T || cs_get_user_team(id) == CS_TEAM_CT)) ExecuteHamB(Ham_CS_RoundRespawn, id) return PLUGIN_CONTINUE; } public WeaponBox_Touch ( const WeaponBox, const Other ) { set_pev( WeaponBox, pev_nextthink) } public event_curweapon(id) { if(!is_user_alive(id)) return PLUGIN_CONTINUE; new weaponID= read_data(2) if(weaponID==CSW_C4 || weaponID==CSW_KNIFE || weaponID==CSW_HEGRENADE || weaponID==CSW_SMOKEGRENADE || weaponID==CSW_FLASHBANG) return PLUGIN_CONTINUE; if(cs_get_user_bpammo(id, weaponID)!=CSW_MAXAMMO[weaponID]) cs_set_user_bpammo(id, weaponID, CSW_MAXAMMO[weaponID]) return PLUGIN_CONTINUE; } public Ham_CBasePlayer_Spawn_Post( id ) { if( is_user_alive(id) ) { MarkUserAlive(id) const XTRA_OFS_PLAYER = 5 const m_iTeam = 114 g_iTeam[id] = get_pdata_int(id, m_iTeam, XTRA_OFS_PLAYER) } else { ClearUserAlive(id) } } public Ham_CBasePlayer_Killed_Post( id ) { if( is_user_alive(id) ) { MarkUserAlive(id) } else { ClearUserAlive(id) } } public FM_client_AddToFullPack_Post(es, e, iEnt, id, hostflags, player, pSet) { if( player && id != iEnt && IsAlive(id) && g_iTeamSemiclip & g_iTeam[id] && IsAlive(iEnt) && g_iTeam[id] == g_iTeam[iEnt] && get_orig_retval() ) { set_es(es, ES_Solid, SOLID_NOT) static Float:flDistance flDistance = entity_range(id, iEnt) if( flDistance < 512.0 ) { set_es(es, ES_RenderMode, kRenderTransAlpha) set_es(es, ES_RenderAmt, floatround(flDistance/2)) } } } public Ham_CBasePlayer_PreThink_Post(id) { if( IsAlive(id) == 0 || !(g_iTeamSemiclip & g_iTeam[id]) ) { return } new iPlayers[MAX_PLAYERS], iNum, iPlayer get_players(iPlayers, iNum, "ae", g_szTeams[g_iTeam[id]]) for(new i; i<iNum; i++) { iPlayer = iPlayers[i] if( id != iPlayer ) { entity_set_int(iPlayer, EV_INT_solid, SOLID_NOT) } } } public client_PostThink(id) { if( IsAlive(id) == 0 || !(g_iTeamSemiclip & g_iTeam[id]) ) { return } new iPlayers[MAX_PLAYERS], iNum, iPlayer get_players(iPlayers, iNum, "ae", g_szTeams[g_iTeam[id]]) for(new i; i<iNum; i++) { iPlayer = iPlayers[i] if( id != iPlayer ) { entity_set_int(iPlayer, EV_INT_solid, SOLID_SLIDEBOX) } } } public Forward_KeyValue( const EntIndex, const KvdHandle ) { if ( pev_valid( EntIndex ) ) { new szClassName[ 16 ]; get_kvd( KvdHandle, KV_ClassName, szClassName, charsmax( szClassName ) ); if( equal( szClassName, "armoury_entity" ) ) { engfunc( EngFunc_RemoveEntity, EntIndex ); return FMRES_SUPERCEDE; } } return FMRES_IGNORED; } public plugin_precache() { if(get_cvar_num("awp_mod") == 1) { register_forward( FM_KeyValue, "Forward_KeyValue" ); } } public client_putinserver(id) { ClearUserAlive(id) } public client_disconnect(id) { ClearUserAlive(id) } public weapon(id) { if(is_user_alive(id)) { give_item(id,"weapon_awp") cs_set_user_bpammo(id,CSW_AWP,30) give_item(id,"weapon_knife") if(get_pcvar_num(pCvar2) == 1) { set_task(1.0,"protection_off",id) } if(get_pcvar_num(pCvar2) == 0) { set_task(3.0,"protection_off",id) } } return PLUGIN_HANDLED; } public protection_off(id) { if(!is_user_connected(id)) { return PLUGIN_HANDLED } else { set_user_godmode(id, 0) set_user_rendering(id, kRenderFxGlowShell, 0, 0,0, kRenderNormal) return PLUGIN_HANDLED } return PLUGIN_HANDLED } Cvary: awp_mod 0/1 // Jeżeli 1, aktywuje AWP Mod awpdm_mod 0/1 // Jeżeli awp_mod ma wartość 1, jest możliwość włączenia trybu Deathmatch. Co dalej idzie za tą wartością, aktywuje nieograniczoną amunicje i usuwa wyrzucane bronie po śmierci. Autor: InsaNe 8 1 Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi