Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

MYGO.pl

RSSy
  • Postów

    28685
  • Dołączył

  • Ostatnia wizyta

    nigdy
  • Wygrane w rankingu

    11

Treść opublikowana przez MYGO.pl

  1. About: Skips the intro cutscene on first chapters. Should work for all maps including 3rd party. Optionally uses Left 4 DHooks to detect the first chapter so it doesn't attempt to run on every round_start. Only cvar: l4d_skip_intro_version plugin version. Changes: Code: 1.0 (10-Mar-2020) - Initial release. Installation: Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder. Attached Files Get Plugin or Get Source (l4d_skip_intro.sp - 4.5 KB) Wyświetl pełny artykuł
  2. I want a plugin that shows the steam ID With code : say /mysteamid Code: say /mysteamid client_print(id, print_chat "STEAM_X:X:XXXXXXXXXX Przeczytaj cały wpis
  3. This plugin fixes a new bug introduced in NMRiH 1.11 where players get stuck on interactive screens when sending multiple "use" inputs to keypads or supply crates. This leads to players being effectively stuck in place and unable to do anything until they reconnect to the server. (GitHub post) Attached Files stuck-interface-fix.zip (5.7 KB) Wyświetl pełny artykuł
  4. hi,everyone! the code client_cmd is not work anymore when I use it in one plugin. how to fix it? Przeczytaj cały wpis
  5. Description: Informations about the last maps played. If the server restarts, the informations about the last maps before the restart will be still available (sm_maphistory doesn't have this feature). The informations are saved into lastmaps.ini. Commands: Code: sm_lastmaps ConVars: Code: sm_lastmaps_maxsize 15 // How many maps will be shown in the map history list? GitHub: https://github.com/Ilusion9/list-lastmaps-sm/ Wyświetl pełny artykuł
  6. Description This plugin creates in-game channels like teamspeak where you can join through a menu and talk privately to anyone. The plugin includes some sounds (: CVARS Code: // flag allowed to kick and move // - // Default: "b" sm_fragvoicechannels_adminflag "b" // flag allowed to join channels // - // Default: "" sm_fragvoicechannels_joinflag "" Commands sm_channels - Opens the channel menu sm_channelclients - See online users in your channel sm_channelkick <user> - kicks an user from his channel sm_channelmove <user> <channel (1-3)> - moves an user in a channel (even if he is not in a channel) Screenshots Download GitHub Wyświetl pełny artykuł
  7. MYGO.pl

    Level xp

    I searched before here for a level plugin but I really didn't found what I really want. I want simple level plugin that have ranks like this rank: x Level: x Exp: x and if CT team or TT win get x Exp If killing with knife get x Exp If killing with weapon get x Exp If killing with HE grenade get x Exp Thank you <3 Przeczytaj cały wpis
  8. Someone can fix the Errors? Plugin: PHP Code: /* ================================================ Counter-Strike Weapons System Mod v1.4.3 [CSWS1] ================================================ 2017 This source code falls under the GNU General Public License. (https://www.gnu.org/licenses/gpl-3.0.en.html) Additionally, you are allowed to modify, improve or build upon the code but under NO circumstances are you allowed to sell, trade, or receive any compensation for the source code whatsoever and should freely share said code to anyone, modified or otherwise. Description: ============ The CSWS script is built upon the endeavor of adding an extra weapon that behaves like a real CS 1.6 weapon in every way while providing optimum performance. If you want to improve the code feel free to do so and share it with everyone. Credits: ======== Sneaky.amxx - original weapons code dias - original weapons code MeRcyLeZZ - price mechanic Arkshine - HUD sprites replacement HamletEagle - optimization edon1337 - optimization */ #include <amxmodx> #include <cstrike> #include <engine> #include <fakemeta> #include <fun> #include <hamsandwich> #include <xs> #define DAMAGE 18 #define CLIP 64 #define BPAMMO 120 #define RATEOFIRE 0.98 #define RECOIL 1.5 #define RELOAD_TIME 2.4 #define RELOAD_POINT 1.4 #define WALKSPEED 240.0 #define PRICE 1400 #define BASEWPN_PRICE 1500 #define BOT_BUY_CHANCE 2 #define SHOOT_ANIM random_num(3, 5) #define DRAW_ANIM 2 #define RELOAD_ANIM 1 #define INSPECT_ANIM 6 #define BODY_NUM 0 #define WEAPON_SECRETCODE 296154 // MACROS #define Get_BitVar(%1,%2) (%1 & (1 << (%2 & 31))) #define Set_BitVar(%1,%2) %1 |= (1 << (%2 & 31)) #define UnSet_BitVar(%1,%2) %1 &= ~(1 << (%2 & 31)) new const PLUGIN[] = "CS:GO PP-19 Bizon"; new const VERSION[] = "2.14.1"; new const CSWS_VER[] = "1.4.3"; new const DATE[] = "1 December 2017"; new const P_MODEL[] = "models/csgo_ports/bizon/p_bizon.mdl"; new const W_MODEL[] = "models/csgo_ports/bizon/w_bizon.mdl"; new const V_MODEL[] = "models/csgo_ports/bizon/v_bizon.mdl"; new const V_MODEL_ALT[] = "models/csgo_ports/bizon/alt/v_bizon.mdl"; new const CSW_NEWPN = CSW_MP5NAVY; new const weapon_newpn[] = "weapon_mp5navy"; new const WEAPON_EVENT[] = "events/mp5n.sc"; new const BASE_W_MODEL[] = "models/w_mp5.mdl"; new const FIRE_SOUND[] = "weapons/csgo_ports/bizon/bizon-1.wav"; new const NEWPN_NAME[] = "weapon_bizon"; new const PRI_AMMO_ID = 10; new const SLOT_ID = 0; new const NUM_IN_SLOT = 7; new const ITEM_FLAGS = 0; new const newpn_shortname[] = "bizon"; new const basewpn_shortname[] = "mp5navy"; new const basewpn_buynames[][] = {"mp5", "smg"} new const weapon_classnames[][] = { "weapon_ak47", "weapon_m4a1", "weapon_awp", "weapon_mp5navy", "weapon_ump45", "weapon_galil", "weapon_famas", "weapon_sg552", "weapon_aug", "weapon_p90", "weapon_mac10", "weapon_tmp", "weapon_scout", "weapon_m3", "weapon_xm1014", "weapon_g3sg1", "weapon_sg550", "weapon_m249" } new const weapon_sprites[][] = { "sprites/weapon_bizon.txt", "sprites/640csws01.spr", "sprites/640csws01_s.spr" } new Float:g_idletime[] = { 0.7, // 0 draw 2.6, // 1 reload 0.6, // 2 shoot 3.7 // 3 inspect } const m_pPlayer = 41; const m_flNextPrimaryAttack = 46; const m_flTimeWeaponIdle = 48; const m_iClip = 51; const m_fInReload = 54; const m_flNextAttack = 83; const m_pActiveItem = 373; // Weapon bitsums const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)| (1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)| (1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90); new g_hambot, g_has_weapon, g_weapon_event, g_buytime_expire, g_rebuy[32], g_restart_round; new Float:g_recoil[33][3], g_clip[33], g_prev_weapon[33], shell_model, smoke_sprite; new cvar_bot_allow_wpns, cvar_freezetime, cvar_buytime, cvar_decals, cvar_alteam; new msg_Money, msg_BlinkAcct, msg_WeaponList; new TASKID_BUYTIME = 100000; public plugin_init() { register_plugin(PLUGIN, VERSION, "Sneaky.amxx, dias, MeRcyLeZZ, Arkshine, hellmonja"); register_event("TextMsg", "Game_Commencing", "a", "2=#Game_Commencing", "2=#Game_will_restart_in"); register_event("HLTV", "Event_New_Round", "a", "1=0", "2=0"); register_event("CurWeapon", "Event_CurWeapon", "be", "1=1"); register_message(get_user_msgid("DeathMsg"), "Message_DeathMsg"); register_forward(FM_UpdateClientData, "Fw_UpdateClientData_Post", 1); register_forward(FM_PlaybackEvent, "Fw_PlaybackEvent"); register_forward(FM_SetModel, "Fw_SetModel"); RegisterHam(Ham_Item_Deploy, weapon_newpn, "Fw_ItemDeployPost", 1); RegisterHam(Ham_AddPlayerItem, "player", "Fw_AddItem"); RegisterHam(Ham_RemovePlayerItem, "player", "Fw_RemoveItem"); RegisterHam(Ham_TraceAttack, "worldspawn", "Fw_TraceAttack_World"); RegisterHam(Ham_TraceAttack, "func_breakable", "Fw_TraceAttack_World"); RegisterHam(Ham_TraceAttack, "func_wall", "Fw_TraceAttack_World"); RegisterHam(Ham_TraceAttack, "func_door", "Fw_TraceAttack_World"); RegisterHam(Ham_TraceAttack, "func_door_rotating", "Fw_TraceAttack_World"); RegisterHam(Ham_TraceAttack, "func_plat", "Fw_TraceAttack_World"); RegisterHam(Ham_TraceAttack, "func_rotating", "Fw_TraceAttack_World"); RegisterHam(Ham_TraceAttack, "player", "Fw_TraceAttack_Player"); RegisterHam(Ham_Weapon_PrimaryAttack, weapon_newpn, "Fw_Weapon_PrimaryAttack"); RegisterHam(Ham_Weapon_PrimaryAttack, weapon_newpn, "Fw_Weapon_PrimaryAttack_Post", 1); RegisterHam(Ham_Item_AddToPlayer, weapon_newpn, "Fw_Item_AddToPlayer_Post", 1); RegisterHam(Ham_Item_PostFrame, weapon_newpn, "Fw_Item_PostFrame"); RegisterHam(Ham_Weapon_Reload, weapon_newpn, "Fw_Weapon_Reload"); RegisterHam(Ham_Weapon_Reload, weapon_newpn, "Fw_Weapon_Reload_Post", 1); RegisterHam(Ham_CS_Item_GetMaxSpeed, weapon_newpn, "Player_Weapon_Walkspeed"); RegisterHam(Ham_Killed, "player", "Fw_Player_Death"); msg_WeaponList = get_user_msgid("WeaponList"); msg_Money = get_user_msgid("Money"); msg_BlinkAcct = get_user_msgid("BlinkAcct"); new clcmd[24]; formatex(clcmd, 25, "say %s", newpn_shortname); for(new i = 0; i < sizeof basewpn_buynames - 1; i++) register_clcmd(basewpn_buynames[i], "ClientCommand_BuyBaseWpn"); register_clcmd(clcmd, "Get_Weapon"); register_clcmd(NEWPN_NAME, "ClientCommand_SelectWeapon"); register_clcmd("inspect", "Inspect_Weapon"); register_concmd("inspect", "Inspect_Weapon"); register_concmd("repurchase", "ClientCommand_RePurchase"); register_concmd(newpn_shortname, "Get_Weapon"); register_concmd("ver_bizon", "Code_Version"); //CVARS cvar_freezetime = get_cvar_pointer("mp_freezetime"); cvar_buytime = get_cvar_pointer("mp_buytime"); cvar_bot_allow_wpns = get_cvar_pointer("bot_allow_sub_machine_guns"); cvar_alteam = register_cvar("armsw_team", "1"); cvar_decals = register_cvar("csws_decals", "0"); } public plugin_precache() { for(new i = 1; i < sizeof weapon_sprites; i++) precache_generic(weapon_sprites[i]); precache_model(P_MODEL); precache_model(W_MODEL); precache_model(V_MODEL); precache_model(V_MODEL_ALT); precache_sound(FIRE_SOUND); smoke_sprite = engfunc(EngFunc_PrecacheModel, "sprites/gunsmoke.spr"); shell_model = engfunc(EngFunc_PrecacheModel, "models/rshell.mdl") register_forward(FM_PrecacheEvent, "Fw_PrecacheEvent_Post", 1); } public Code_Version(id) { console_print(id, "=============================="); console_print(id, "%s v%s", PLUGIN, VERSION); console_print(id, "Counter-Strike Weapons System v%s", CSWS_VER); console_print(id, "%s", DATE); console_print(id, "=============================="); } public Fw_PrecacheEvent_Post(type, const name[]) { if(equal(WEAPON_EVENT, name)) g_weapon_event = get_orig_retval(); } public client_putinserver(id) { if(!g_hambot && is_user_bot(id)) { g_hambot = 1 set_task(0.1, "Do_RegisterHam", id) } } public Do_RegisterHam(id) { RegisterHamFromEntity(Ham_TraceAttack, id, "Fw_TraceAttack_Player"); RegisterHamFromEntity(Ham_AddPlayerItem, id, "Fw_AddItem", 1); RegisterHamFromEntity(Ham_RemovePlayerItem, id, "Fw_RemoveItem", 1); RegisterHamFromEntity(Ham_Killed, id, "Fw_Player_Death"); } public Game_Commencing() { g_restart_round = 1; } public Event_New_Round() { new freezetime = get_pcvar_num(cvar_freezetime); new buytime = floatround((get_pcvar_float(cvar_buytime) * 60)); new Float:t; g_buytime_expire = 0; if(g_restart_round) { Remove_Weapon(0, 1); g_restart_round = 0; } remove_task(TASKID_BUYTIME); if(get_pcvar_num(cvar_bot_allow_wpns) && g_buytime_expire == 0) set_task(1.5, "Bot_Weapon"); if(buytime > freezetime) t = float(buytime); else t = float(buytime+freezetime); set_task(t, "Buytime_Expired", TASKID_BUYTIME); } public Buytime_Expired() { g_buytime_expire = 1; } public Bot_Weapon() { new players[32], pnum, wpn_id; get_players(players, pnum, "ad"); for(new i = 0; i < pnum; i++) if(random_num(1,100) <= BOT_BUY_CHANCE && get_user_armor(players[i]) != 99 && !is_weapon_slot_empty(players[i], 1, wpn_id) && !Get_BitVar(g_has_weapon, players[i])) { Get_Weapon(players[i]); cs_set_user_armor(players[i], 99, CS_ARMOR_VESTHELM); } } public ClientCommand_BuyBaseWpn(id) { if(purchase_check(id, BASEWPN_PRICE) && Get_BitVar(g_has_weapon, id)) { drop_weapons(id); UnSet_BitVar(g_has_weapon,id); g_rebuy[id] = 0; } } public ClientCommand_RePurchase(id) { if(g_rebuy[id] == 1 && !Get_BitVar(g_has_weapon, id)) Get_Weapon(id); if(is_plugin_loaded("Weapon Price Editor", false) <= 0) client_cmd(id, "rebuy"); } public Get_Weapon(id) { if(!is_user_alive(id) || !is_user_connected(id)) return // Player tries to buy the same gun if(Get_BitVar(g_has_weapon, id)) { client_print(id, print_center, "#Cstrike_Already_Own_Weapon"); return } if(purchase_check(id, PRICE)) { if(cs_get_user_shield(id)) { engclient_cmd(id, "slot1"); engclient_cmd(id, "drop"); } else drop_weapons(id); Set_BitVar(g_has_weapon, id); g_rebuy[id] = 1; new weapon = give_item(id, weapon_newpn); // Set Ammo cs_set_weapon_ammo(weapon, CLIP); cs_set_user_bpammo(id, CSW_NEWPN, BPAMMO); // Calculate new money amount static newmoney; newmoney = cs_get_user_money(id) - PRICE; // Update money offset cs_set_user_money(id, newmoney); // Update money on HUD message_begin(MSG_ONE, msg_Money, _, id); write_long(newmoney); // amount write_byte(1); // flash message_end(); } } public ClientCommand_SelectWeapon(id) { engclient_cmd(id, weapon_newpn); return PLUGIN_HANDLED } public Event_CurWeapon(id) { if(!is_user_alive(id)) return static CSW_ID; CSW_ID = read_data(2); static weapon; weapon= find_ent_by_owner(-1, weapon_newpn, id); if((CSW_ID == CSW_NEWPN && g_prev_weapon[id] == CSW_NEWPN) && Get_BitVar(g_has_weapon, id)) { if(!pev_valid(weapon)) { g_prev_weapon[id] = get_user_weapon(id) return } set_pdata_float(weapon, m_flNextPrimaryAttack, get_pdata_float(weapon, m_flNextPrimaryAttack, 4) * RATEOFIRE, 4) } else if((CSW_ID != CSW_NEWPN && g_prev_weapon[id] == CSW_NEWPN) && Get_BitVar(g_has_weapon, id)) draw_new_weapon(id, get_user_weapon(id)); g_prev_weapon[id] = get_user_weapon(id); } public Fw_ItemDeployPost(weapon) { static id; id = get_pdata_cbase(weapon, m_pPlayer, 4); if(!is_user_alive(id)) return if(Get_BitVar(g_has_weapon, id)) arm_switch(id); } public Fw_AddItem(id, weapon) { static classname[24]; pev(weapon, pev_classname, classname, charsmax(classname)); if(!Get_BitVar(g_has_weapon,id) && g_rebuy[id] == 1) { for(new i = 0; i < sizeof weapon_classnames; i++) if(equali(classname, weapon_classnames[i])) { g_rebuy[id] = 0; return } } else if(equali(classname, weapon_newpn) && Get_BitVar(g_has_weapon,id)) g_rebuy[id] = 1; } public Fw_RemoveItem(id) { set_task(0.01, "Fw_AddItem", id); } public Fw_UpdateClientData_Post(id, sendweapons, cd_handle) { if(!is_user_alive(id)) return FMRES_IGNORED if(get_user_weapon(id) == CSW_NEWPN && Get_BitVar(g_has_weapon, id)) set_cd(cd_handle, CD_flNextAttack, get_gametime() + 0.001) return FMRES_HANDLED } public Fw_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2) { if (!is_user_connected(invoker)) return FMRES_IGNORED if(get_user_weapon(invoker) != CSW_NEWPN || !Get_BitVar(g_has_weapon, invoker)) return FMRES_IGNORED if(eventid != g_weapon_event) return FMRES_IGNORED engfunc(EngFunc_PlaybackEvent, flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2); set_weapon_anim(invoker, SHOOT_ANIM); emit_sound(invoker, CHAN_WEAPON, FIRE_SOUND, VOL_NORM, ATTN_NORM, 0, PITCH_NORM); make_shell(invoker); return FMRES_SUPERCEDE } public Fw_SetModel(wpn_ent, model[]) { if(!pev_valid(wpn_ent)) return FMRES_IGNORED static classname[32]; pev(wpn_ent, pev_classname, classname, sizeof classname); if(!equal(classname, "weaponbox")) return FMRES_IGNORED static id; id= pev(wpn_ent, pev_owner); if(equal(model, BASE_W_MODEL)) { static weapon; weapon = find_ent_by_owner(-1, weapon_newpn, wpn_ent); if(!pev_valid(weapon)) return FMRES_IGNORED; if(Get_BitVar(g_has_weapon, id)) { UnSet_BitVar(g_has_weapon,id) set_pev(weapon, pev_impulse, WEAPON_SECRETCODE) engfunc(EngFunc_SetModel, wpn_ent, W_MODEL) set_pev(wpn_ent, pev_body, BODY_NUM) return FMRES_SUPERCEDE } } return FMRES_IGNORED; } public Fw_TraceAttack_World(victim, attacker, Float:damage, Float:direction[3], prt, damage_bits) { if(!is_user_connected(attacker)) return HAM_IGNORED if(get_user_weapon(attacker) != CSW_NEWPN || !Get_BitVar(g_has_weapon, attacker)) return HAM_IGNORED static Float:origin[3], Float:vecPlane[3]; get_tr2(prt, TR_vecEndPos, origin); get_tr2(prt, TR_vecPlaneNormal, vecPlane); make_bullet_hole(victim, attacker, origin); make_bullet_smoke(attacker, prt); SetHamParamFloat(3, float(DAMAGE)); return HAM_IGNORED } public Fw_TraceAttack_Player(victim, attacker, Float:damage, Float:direction[3], ptr, damage_bits) { if(!is_user_connected(attacker)) return HAM_IGNORED if(get_user_weapon(attacker) != CSW_NEWPN || !Get_BitVar(g_has_weapon, attacker)) return HAM_IGNORED SetHamParamFloat(3, float(DAMAGE)) return HAM_IGNORED } public Fw_Weapon_PrimaryAttack(weapon) { static id; id = pev(weapon, pev_owner); pev(id, pev_punchangle, g_recoil[id]); return HAM_IGNORED } public Fw_Weapon_PrimaryAttack_Post(weapon) { static id; id = pev(weapon, pev_owner); if(Get_BitVar(g_has_weapon, id)) { static Float:Push[3] pev(id, pev_punchangle, Push); xs_vec_sub(Push, g_recoil[id], Push); xs_vec_mul_scalar(Push, RECOIL, Push); xs_vec_add(Push, g_recoil[id], Push); set_pev(id, pev_punchangle, Push); set_pdata_float(weapon, m_flTimeWeaponIdle, g_idletime[2], 4); } } public Fw_Item_AddToPlayer_Post(weapon, id) { if(!pev_valid(weapon)) return HAM_IGNORED if(pev(weapon, pev_impulse) == WEAPON_SECRETCODE) { Set_BitVar(g_has_weapon, id); set_pev(weapon, pev_impulse, 0); g_rebuy[id] = 1; } if(Get_BitVar(g_has_weapon,id)) { message_begin(MSG_ONE, msg_WeaponList, .player = id); write_string(NEWPN_NAME); // WeaponName write_byte(PRI_AMMO_ID); // PrimaryAmmoID write_byte(BPAMMO); // PrimaryAmmoMaxAmount write_byte(-1); // SecondaryAmmoID write_byte(-1); // SecondaryAmmoMaxAmount write_byte(SLOT_ID); // SlotID (0...N) write_byte(NUM_IN_SLOT); // NumberInSlot (1...N) write_byte(CSW_NEWPN); // WeaponID write_byte(ITEM_FLAGS); // Flags message_end(); } else { message_begin(MSG_ONE, msg_WeaponList, .player = id); write_string(weapon_newpn); // WeaponName write_byte(PRI_AMMO_ID); // PrimaryAmmoID write_byte(BPAMMO); // PrimaryAmmoMaxAmount write_byte(-1); // SecondaryAmmoID write_byte(-1); // SecondaryAmmoMaxAmount write_byte(SLOT_ID); // SlotID (0...N) write_byte(NUM_IN_SLOT); // NumberInSlot (1...N) write_byte(CSW_NEWPN); // WeaponID write_byte(ITEM_FLAGS); // Flags message_end(); } return HAM_HANDLED } public Fw_Item_PostFrame(weapon) { if(!pev_valid(weapon)) return HAM_IGNORED static id id = pev(weapon, pev_owner) if(is_user_alive(id) && Get_BitVar(g_has_weapon, id)) { static Float:flNextAttack; flNextAttack = get_pdata_float(id, m_flNextAttack, 5); static bpammo; bpammo = cs_get_user_bpammo(id, CSW_NEWPN); static i_clip; i_clip = get_pdata_int(weapon, m_iClip, 4); static fInReload; fInReload = get_pdata_int(weapon, m_fInReload, 4); if(fInReload && flNextAttack <= 0.0) { static temp1; temp1 = min(CLIP - i_clip, bpammo); set_pdata_int(weapon, m_iClip, i_clip + temp1, 4); cs_set_user_bpammo(id, CSW_NEWPN, bpammo - temp1); set_pdata_int(weapon, m_fInReload, 0, 4); fInReload = 0; set_pdata_float(weapon, m_flNextPrimaryAttack, RELOAD_TIME - RELOAD_POINT, 4); } } return HAM_IGNORED } public Fw_Weapon_Reload(weapon) { static id; id = pev(weapon, pev_owner); if(!is_user_alive(id)) return HAM_IGNORED if(!Get_BitVar(g_has_weapon, id)) return HAM_IGNORED g_clip[id] = -1; static bpammo; bpammo = cs_get_user_bpammo(id, CSW_NEWPN); static i_clip; i_clip = get_pdata_int(weapon, m_iClip, 4); if(bpammo <= 0) return HAM_SUPERCEDE if(i_clip >= CLIP) return HAM_SUPERCEDE g_clip[id] = i_clip; return HAM_HANDLED } public Fw_Weapon_Reload_Post(weapon) { static id; id = pev(weapon, pev_owner); if(!is_user_alive(id)) return HAM_IGNORED if(!Get_BitVar(g_has_weapon, id)) return HAM_IGNORED if (g_clip[id] == -1) return HAM_IGNORED set_pdata_int(weapon, m_iClip, g_clip[id], 4); set_pdata_int(weapon, m_fInReload, 1, 4); set_weapon_anim(id, RELOAD_ANIM); set_pdata_float(id, m_flNextAttack, RELOAD_POINT, 5); return HAM_HANDLED } public Fw_Player_Death(id) { if(!is_user_connected(id)) return HAM_IGNORED if(Get_BitVar(g_has_weapon, id)) { set_task(0.1, "Remove_Weapon", id); g_rebuy[id] = 1; } return HAM_HANDLED } public Message_DeathMsg(msg_id, msg_dest, id) { static attacker, weapon[33]; attacker = get_msg_arg_int(1); get_msg_arg_string(4, weapon, charsmax(weapon)) if(!is_user_connected(attacker)) return PLUGIN_CONTINUE if(equal(weapon, basewpn_shortname) && Get_BitVar(g_has_weapon, attacker)) set_msg_arg_string(4, newpn_shortname); return PLUGIN_CONTINUE } public Player_Weapon_Walkspeed(weapon) { new id = get_pdata_cbase(weapon, m_pPlayer, 4); if(!is_user_alive(id)) return HAM_IGNORED if(Get_BitVar(g_has_weapon,id)) SetHamReturnFloat(WALKSPEED); else return HAM_IGNORED return HAM_SUPERCEDE } public Inspect_Weapon(id) { if(!is_user_alive(id)) return if(!Get_BitVar(g_has_weapon, id)) return if(get_user_weapon(id) != CSW_NEWPN) return static weapon; weapon = get_pdata_cbase(id, m_pActiveItem); new current_anim = pev(get_pdata_cbase(weapon, m_pPlayer, 4), pev_weaponanim); if(!current_anim) set_weapon_anim(id, INSPECT_ANIM); } public Remove_Weapon(id, all) { switch(all) { case 1: { new players[32], pnum; get_players(players, pnum, "a"); for(new i = 0; i <= pnum; i++) UnSet_BitVar(g_has_weapon, players[i]); } default: UnSet_BitVar(g_has_weapon, id); } } bool:purchase_check(id, cost) { if (!cs_get_user_buyzone(id)) return false // Check for buy time if(g_buytime_expire) { client_print(id, print_center, "%d seconds have passed.^n You can't buy anything now!",floatround(get_cvar_float("mp_buytime") * 60)); return false } // Check if player has enough money if (cs_get_user_money(id) < cost) { client_print(id, print_center, "#Cstrike_TitlesTXT_Not_Enough_Money"); // Blink money message_begin(MSG_ONE_UNRELIABLE, msg_BlinkAcct, _, id); write_byte(2); // times message_end(); return false } return true } draw_new_weapon(id, CSW_ID) { static weapon; weapon = find_ent_by_owner(-1, weapon_newpn, id); if(CSW_ID == CSW_NEWPN) { if(pev_valid(weapon) && Get_BitVar(g_has_weapon, id)) { set_pev(weapon, pev_effects, pev(weapon, pev_effects) &~ EF_NODRAW); engfunc(EngFunc_SetModel, weapon, P_MODEL); set_pev(weapon, pev_body, BODY_NUM); } } else if(pev_valid(weapon)) set_pev(weapon, pev_effects, pev(weapon, pev_effects) | EF_NODRAW); } make_bullet_smoke(id, TrResult) { static Float:vecSrc[3], Float:vecEnd[3], TE_FLAG; get_weapon_attachment(id, vecSrc); global_get(glb_v_forward, vecEnd); xs_vec_mul_scalar(vecEnd, 8192.0, vecEnd); xs_vec_add(vecSrc, vecEnd, vecEnd); get_tr2(TrResult, TR_vecEndPos, vecSrc); get_tr2(TrResult, TR_vecPlaneNormal, vecEnd); xs_vec_mul_scalar(vecEnd, 2.5, vecEnd); xs_vec_add(vecSrc, vecEnd, vecEnd); TE_FLAG |= TE_EXPLFLAG_NODLIGHTS; TE_FLAG |= TE_EXPLFLAG_NOSOUND; TE_FLAG |= TE_EXPLFLAG_NOPARTICLES; engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, vecEnd, 0); write_byte(TE_EXPLOSION); engfunc(EngFunc_WriteCoord, vecEnd[0]); engfunc(EngFunc_WriteCoord, vecEnd[1]); engfunc(EngFunc_WriteCoord, vecEnd[2] - 10.0); write_short(smoke_sprite); write_byte(5); write_byte(50); write_byte(TE_FLAG); message_end(); } make_bullet_hole(victim, attacker, Float:origin[3]) { static decal; if(!get_pcvar_num(cvar_decals)) decal = random_num(41, 43); else decal = random_num(52, 55); if(victim) { message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_DECAL) engfunc(EngFunc_WriteCoord, origin[0]) engfunc(EngFunc_WriteCoord, origin[1]) engfunc(EngFunc_WriteCoord, origin[2]) write_byte(decal) write_short(victim) message_end() } else { message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_WORLDDECAL) engfunc(EngFunc_WriteCoord, origin[0]) engfunc(EngFunc_WriteCoord, origin[1]) engfunc(EngFunc_WriteCoord, origin[2]) write_byte(decal) message_end() } message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_GUNSHOTDECAL) engfunc(EngFunc_WriteCoord, origin[0]) engfunc(EngFunc_WriteCoord, origin[1]) engfunc(EngFunc_WriteCoord, origin[2]) write_short(attacker) write_byte(decal) message_end() } make_shell(id) { static Float:player_origin[3], Float:origin[3], Float:origin2[3], Float:gunorigin[3], Float:oldangles[3], Float:v_forward[3], Float:v_forward2[3], Float:v_up[3], Float:v_up2[3], Float:v_right[3], Float:v_right2[3], Float:viewoffsets[3]; pev(id,pev_v_angle, oldangles); pev(id,pev_origin,player_origin); pev(id, pev_view_ofs, viewoffsets); engfunc(EngFunc_MakeVectors, oldangles) global_get(glb_v_forward, v_forward); global_get(glb_v_up, v_up); global_get(glb_v_right, v_right); global_get(glb_v_forward, v_forward2); global_get(glb_v_up, v_up2); global_get(glb_v_right, v_right2); xs_vec_add(player_origin, viewoffsets, gunorigin); xs_vec_mul_scalar(v_forward, 10.3, v_forward); xs_vec_mul_scalar(v_right, 2.9, v_right); xs_vec_mul_scalar(v_up, -3.7, v_up); xs_vec_mul_scalar(v_forward2, 10.0, v_forward2); xs_vec_mul_scalar(v_right2, 3.0, v_right2); xs_vec_mul_scalar(v_up2, -4.0, v_up2); xs_vec_add(gunorigin, v_forward, origin); xs_vec_add(gunorigin, v_forward2, origin2); xs_vec_add(origin, v_right, origin); xs_vec_add(origin2, v_right2, origin2); xs_vec_add(origin, v_up, origin); xs_vec_add(origin2, v_up2, origin2); static Float:velocity[3] get_speed_vector(origin2, origin, random_float(140.0, 160.0), velocity) static angle; angle = random_num(0, 360) message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id) write_byte(TE_MODEL) engfunc(EngFunc_WriteCoord, origin[0]) engfunc(EngFunc_WriteCoord,origin[1]) engfunc(EngFunc_WriteCoord,origin[2]) engfunc(EngFunc_WriteCoord,velocity[0]) engfunc(EngFunc_WriteCoord,velocity[1]) engfunc(EngFunc_WriteCoord,velocity[2]) write_angle(angle) write_short(shell_model) write_byte(1) write_byte(20) message_end() } get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3]) { new_velocity[0] = origin2[0] - origin1[0] new_velocity[1] = origin2[1] - origin1[1] new_velocity[2] = origin2[2] - origin1[2] new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2])) new_velocity[0] *= num new_velocity[1] *= num new_velocity[2] *= num return 1; } get_weapon_attachment(id, Float:output[3], Float:fDis = 40.0) { static Float:vfEnd[3], viEnd[3] ; get_user_origin(id, viEnd, 3); IVecFVec(viEnd, vfEnd); static Float:fOrigin[3], Float:fAngle[3]; pev(id, pev_origin, fOrigin); pev(id, pev_view_ofs, fAngle); xs_vec_add(fOrigin, fAngle, fOrigin); static Float:fAttack[3]; xs_vec_sub(vfEnd, fOrigin, fAttack); xs_vec_sub(vfEnd, fOrigin, fAttack); static Float:fRate; fRate = fDis / vector_length(fAttack); xs_vec_mul_scalar(fAttack, fRate, fAttack); xs_vec_add(fOrigin, fAttack, output); } set_weapon_anim(id, anim) { if(!is_user_alive(id)) return set_pev(id, pev_weaponanim, anim); message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id); write_byte(anim); write_byte(pev(id, pev_body)); message_end(); static weapon; weapon = find_ent_by_owner(-1, weapon_newpn, id); new Float:idle; switch(anim) { case DRAW_ANIM: idle = g_idletime[0]; case RELOAD_ANIM: idle = g_idletime[1]; case INSPECT_ANIM: idle = g_idletime[3]; } set_pdata_float(weapon, m_flTimeWeaponIdle, idle, 4); } // Drop primary/secondary weapons drop_weapons(id) { // Get user weapons static weapons[32], num, i, wpn_id; num = 0; // reset passed weapons count (bugfix) get_user_weapons(id, weapons, num); // Loop through them and drop primaries or secondaries for (i = 0; i < num; i++) { // Prevent re-indexing the array wpn_id = weapons[i]; if(1<<wpn_id & PRIMARY_WEAPONS_BIT_SUM) { // Get weapon entity static wname[32]; get_weaponname(wpn_id, wname, charsmax(wname)); // Player drops the weapon engclient_cmd(id, "drop", wname); } } } arm_switch(id) { if(get_user_team(id) == get_pcvar_num(cvar_alteam)) set_pev(id, pev_viewmodel2, V_MODEL_ALT); else set_pev(id, pev_viewmodel2, V_MODEL); set_pev(id, pev_weaponmodel2, P_MODEL) set_weapon_anim(id, DRAW_ANIM) draw_new_weapon(id, CSW_NEWPN) } is_weapon_slot_empty( id , iSlot , &iEntity ) { if ( !( 1 <= iSlot <= 5 ) ) return 0; iEntity = 0; const m_rgpPlayerItems_Slot0 = 367; const m_iId = 43; const EXTRAOFFSET_WEAPONS = 4; iEntity = get_pdata_cbase( id , m_rgpPlayerItems_Slot0 + iSlot , EXTRAOFFSET_WEAPONS ); return ( iEntity > 0 ) ? get_pdata_int( iEntity , m_iId , EXTRAOFFSET_WEAPONS ) : 0; } Error: Code: L 03/08/2020 - 00:51:34: [AMXX] Displaying debug trace (plugin "CSWS/csgo_bizon.amxx") L 03/08/2020 - 00:51:34: [AMXX] Run time error 10: native error (native "get_pcvar_num") L 03/08/2020 - 00:51:34: [AMXX] [0] csgo_bizon.sma::Event_New_Round (line 278) Przeczytaj cały wpis
  9. MYGO.pl

    giris cikis

    Forum: Unapproved Plugins Posted By: Lowpina Post Time: 02-15-2020 at 19:26 Wyświetl pełny artykuł
  10. Forum: Unapproved Plugins Posted By: Timid Post Time: 02-18-2020 at 21:15 Wyświetl pełny artykuł
  11. Player Activity saves player's total playtime on a database for statistical purposes. Commands: say /activity - displays current playtime and all time activity amx_activity (flag: m) - displays all current players' all time activity API: _get_user_time(id) - return player's all time activity * Player Activity available on GitHub: https://github.com/CrXane/PlayerActivity Przeczytaj cały wpis
  12. There's yet another exploit going around the csgo community which allows players to cause the server to stutter. A client has been abusing it in one of the community servers I manage since they are unable to cheat due to a really strong server side anticheat. They resort to any exploit they can to attack the server. :nono: I'm unaware if this is a new feature inside a cheat or if it's completely private still. None the less here's the patch before it becomes a massive issue. Information: Your srcds console window will spam this message if it's currently being attacked. IPADDRESS : PORT : reliable state invalid (0). This exploit may affect all source engine games. Installation: Just put the attached LagExploitFix_3_7_2020.txt file inside your csgo\addons\gamedata\ folder and install the smx in the plugins folder. Load the plugin manually with sm_rcon sm plugins load ServerLagExploitFix_3_7_2020 or restart your server for it to auto load. Note to the "hackers" that keep attacking community servers I manage. I will keep figuring out the exploit you are abusing and create patchs which will be released publiclly. Please continue :wink: Attached Files Get Plugin or Get Source (ServerLagExploitFix_3_7_2020.sp - 1.2 KB) LagExploitFix_3_7_2020.txt (525 Bytes) Wyświetl pełny artykuł
  13. Description You could now drop your nades and also shoot it to trigger it off the floor! Adds a little spice to the game :) Attached Files Get Plugin or Get Source (Shootable-Nades.sp - 3.0 KB) Wyświetl pełny artykuł
  14. Description You could now delete maps permanently from your server through in-game and also removes them from the mapcycle at the same time! It's useful to those who are lazy :) Attached Files Get Plugin or Get Source (Map-Deleter.sp - 2.8 KB) Wyświetl pełny artykuł
  15. Description Simple plugin that checks constantly if a plugin is down and attempts to load it back up. That's it :) Attached Files Get Plugin or Get Source (Plugin-Saver.sp - 1.9 KB) Wyświetl pełny artykuł
  16. hi,I want a menu to do that Each player can turn the sound on and off Like the example I show you: Code: 1. End Round Sound [ON/OFF] code for off And on end round sound PHP Code: client_cmd(id, "say /roundsound_on"); client_cmd(id, "say /roundsound_off); Przeczytaj cały wpis
  17. hi,I want a menu to do that Each player can turn their weapon model on and off Like the example I show you: Code: 1. Skin Awp [ON/OFF] code for off And on weapon skin Code: say /awpskin_off say /awpskin_on Przeczytaj cały wpis
  18. CSGO Unstuck Hi, i read other plugins, but they dont suit my purpose. Im looking for plugin that would unstuck players similar to this plugin:https://forums.alliedmods.net/showthread.php?t=51409, however since im going to run the plugin in a bhop server, i need it to work like this; Occasionally players get stuck at spawn: spawn to main repsawn point or map start point (im using influx timer). When players get stuck between locations of map when going around typing the unstuck command would move them to closest checkpoint (or any point where user can be unstuck) Przeczytaj cały wpis
  19. MYGO.pl

    Chat logs

    Chat logs A simple plugin that will log each message sent to chat by players. Useful for hunting trolls and keeping an eye on your server. Example: Code: L 03/06/2020 - 20:31:06: ("say") JamesBond007: You are lying, you didn't say that! L 03/06/2020 - 20:31:17: ("say") TheKiller: Okay mate, let's check the logs. ;) Code: /* Chat logs */ /* Written with <3 on JOE (Joe's own editor) */ #include <amxmodx> new g_MessageCommands[][] = { "say", "say_team" }; new szLog[32]; public plugin_init() { register_plugin("Chat logs", "1.0", "thEsp"); for (new i = 0; i < sizeof(g_MessageCommands); i++) register_clcmd(g_MessageCommands[i], "onChat"); get_time("Chat [%F].log", szLog, charsmax(szLog)); } public onChat(id) { new szCommand[16], szMessage[32]; read_argv(0, szCommand, charsmax(szCommand)); read_args(szMessage, charsmax(szMessage)); remove_quotes(szMessage); log_to_file(szLog, "(^"%s^") %n: %s", szCommand, id, szMessage); } Przeczytaj cały wpis
  20. Hello guys, My request is that i need a tutorial or some links on how to add a plugin in module file Please i want the very detailed tutorial and understandable if it’s possible Thank you Przeczytaj cały wpis
  21. MYGO.pl

    sql threading

    I want to load players data and save data using sql threading PlayerSteamID PlayerName XP if data found just update it using steamid. If not entry it. Przeczytaj cały wpis
  22. Simple Fastdownload Provides fastdownload support for srcds without the need for webhosting. By default, it will automatically change the value of sv_downloadurl and serve files that are either in the downloadables stringtable or the mapcycle. From here you can either leave it as is or begin to add bzip2 compressed versions of the files. These can either be in the same location as their non-compressed versions, or separately within the folder specified by sv_downloadurl_bz2folder. Requirements Conplex & Webcon ConVars Code: sv_downloadurl_urlpath | "fastdl" | path for fastdownload url eg: fastdl sv_downloadurl_autoupdate | 1 | should sv_downloadurl be set automatically sv_downloadurl_hostname | "" | either empty string, or hostname to use in downloadurl with no trailing slash eg: fastdownload.example.com sv_downloadurl_bz2folder | "" | either empty string, or base folder for bz2 files with trailing slash eg: bz2/ Commands Code: sm_fastdownload_list_files | prints a list of all files that are currently in the download whitelist, note: for server console only Source & Download https://github.com/neko-pm/simple-fastdownload Wyświetl pełny artykuł
  23. Description: This plugin announces tank spawns and locks the safehouse door until the tank is dead. ATM L4D1 only. Feature: It makes rushers who try to skip the tank look really dump... when they try to open the safehouse door... CVAR/Command list: none Changelog: 2020-03-05 (v1.0.3) * Initial release. Installation instructions: Click 'Get Plugin' button, place SMX in the sourcemod plugins folder. Or compile it yourself. Dependencies: none Plans: Should check for l4d2 zombie class to make it l4d2 compatible. The list of the final maps should be in a cfg file and l4d2 final maps should be added Credits: Based on code from: * [L4D / L4D2] Lockdown System | 1.7 [Final] : Jan. 30, 2019 | * https://forums.alliedmods.net/showthread.php?t=281305 * Aya Supay for making the code look great again * MasterMind420 for providing a fix to check for all kinds of ending checkpoint doors Attached Files Get Plugin or Get Source (l4d_tank_announce_lock_door_v1.0.3.sp - 4.6 KB) Wyświetl pełny artykuł
  24. D i 5 7 i n c T's Kill Announcer: Dota 2 Replicates the Dota 2 killing spree and multi-kill announcer. Also works on Counter-Strike: Condition Zero. Fully compatible with ZP 5, 4, and older. CVar: D7AnnouncerKillsD2IgnoreBots Don't play sounds or show announcements when bots make kills. 0 - disabled 1 - enabled None. This plug-in requires the following: - BitSum stocks include file (bitsums.inc). - DHUD messages include file (dhudmessage.inc) ONLY IF compiling with AMXX 1.8.2 or older. - SoundInfo include file (soundinfo.inc). - Sound resources. Extract the zip file contents in the mod's main directory. Everything is attached along below. Known issues: - SoundInfo include file fails to read sound duration for mp3 files. If you plan on using mp3 files, manually specify the sound durations in the area below their names. Get source and compile locally. MeRcyLeZZ - For his Zombie Plague Mod. dorin2oo7 - For his images I used to style up my post. NiHiLaNTh, schmurgel1983, KliPPy, meTaLiCroSS - For being true friends and always helping and teaching me new stuff. Code: T = needs testing X = done - = cancelled [X] remember kills and multis on global variables [T] make sounds not play over eachother [X] ownage message? [X] reset kills on map restart [X] stop announcements on new round? [X] stop announcements on map restart? [X] a single chat message for both kill count and multi? [X] a single task for all announcements [-] fix ownage sound playing when it shouldn't [X] fix g_iMulti not resetting [T] force visual announcement of previous player if not announced when another player makes a kill [T] only do it when the new player has something to announce [T] fix first blood triggering wrong(add first blood bit info) [T] optimize multi text showing conditions [T] optimize multi sound playing conditions [T] death hook with DeathMsg instead of Ham_Killed [T] ownage announcement for team kills difference instead of >= 5 player kills [T] don't force print last killer's ownage unless the new killer is from a different team [T] ignore spectator kills for both victim and attacker [T] don't add sound folder before precaching wavs [X] zp 4.3 and lower infection support [T] only print ownage message once [X] don't count team kills [ ] decrease kills on team kill? v0.2.2 [X] properly detect name change [T] announce ownage even if no player specific event happens [T] only add delay from inside the announce task if necessary [T] delay the other announcements even if first blood sound doesn't exist v0.2.5 [T] task on client_putinserver for renaming plugins compatibility v0.2.6 [T] ignore bots + cvar v0.2.7 [-] fix ownage chat message printing multiple times [-] cache sound type instead of checking for extension every time [-] fix bomb kills counting (for planter?) [-] don't allow ownage sounds to interrupt spree or multi announcements? [-] implement rpg api team code [X] HUD [T] don't reset multis on death or spawn and add multi only messages [X] reset kills and multis on round start [X] hud hold time equal to the total sound duration [X] precache_generic for all the sounds since we're not playing them on server side [X] optimize plugin_precache [X] fix hud positioning system [T] delay the initial hud show by 0.1 to avoid spamming too many messages on instant multiple kills [X] full zp support [X] use natives instead of team cache [T] server interogation cvar v0.3.8 [ ] multilang [ ] dynamic max simultaneous announcers [ ] external configuration [ ] minimize or eliminate hud flicker [ ] improve hud spacing [ ] fix soundinfo mp3 issues [ ] Code(for easy readability): PHP Code: // Modules - global #include <amxmodx> #include <fakemeta> // Modules - mod specific #include <cstrike> // Stocks #include <bitsums> #if AMXX_VERSION_NUM <= 182//!defined set_dhudmessage #include <dhudmessage> #endif #include <soundinfo> //#include <D7Debug> new const g_szConstVersion[] = "0.3.8"; // Custom forwards forward zp_user_infected_post(id, infector, nemesis); //forward zp_user_humanized_post(id, survivor); forward zp_fw_core_infect_post(id, attacker); forward zp_fw_core_cure_post(id, attacker); // Custom natives native zp_get_user_zombie(id); native zp_core_is_zombie(id); const g_iSizeSzSound = 64; new g_szSoundFirstBlood[g_iSizeSzSound] = "D7/Announcers/Dota2/Kill/Announcer_1stblood_01.wav"; new Float:g_fSoundFirstBloodDuration = 1.647891;//1.645714 new const g_szConstTextFirstBlood[] = "drew first blood by killing"; new const g_iConstTextFirstBloodColor[3] = { 255, 255, 255 }; new g_szSoundsCount[][g_iSizeSzSound] = { "D7/Announcers/Dota2/Kill/Announcer_kill_spree_01.wav", "D7/Announcers/Dota2/Kill/Announcer_kill_dominate_01.wav", "D7/Announcers/Dota2/Kill/Announcer_kill_mega_01.wav", "D7/Announcers/Dota2/Kill/Announcer_kill_unstop_01.wav", "D7/Announcers/Dota2/Kill/Announcer_kill_wicked_01.wav", "D7/Announcers/Dota2/Kill/Announcer_kill_monster_01.wav", "D7/Announcers/Dota2/Kill/Announcer_kill_godlike_01.wav", "D7/Announcers/Dota2/Kill/Announcer_kill_holy_01.wav" } new Float:g_fSoundsCountDuration[sizeof g_szSoundsCount] = { 2.378684, //2.377143 1.803990, //1.802449 2.613786, //2.612245 2.039093, //2.037551 2.613786, //2.612245 3.345215, //3.343673 1.830113, //1.828571 2.326439 //2.324898 } new const g_szConstTextCount[sizeof g_szSoundsCount][] = { "is on a killing spree", "is dominating", "is on a mega kill streak", "is unstoppable", "is wicked sick", "is on a monster kill streak", "is GODLIKE", "is beyond GODLIKE, someone kill them!!" } new const g_iConstTextCountColor[sizeof g_szConstTextCount][3] = { { 0, 255, 64 }, { 94, 0, 189 },//{ 35, 0, 160 }, { 255, 0, 128 }, { 255, 128, 0 }, { 128, 128, 0 }, { 255, 128, 255 }, { 255, 0, 0 }, { 255, 128, 0 } } new g_szSoundsMulti[][g_iSizeSzSound] = { "D7/Announcers/Dota2/Kill/Announcer_kill_double_01.wav", "D7/Announcers/Dota2/Kill/Announcer_kill_triple_01.wav", "D7/Announcers/Dota2/Kill/Announcer_kill_ultra_01.wav", "D7/Announcers/Dota2/Kill/Announcer_kill_rampage_01.wav" } new Float:g_fSoundsMultiDuration[sizeof g_szSoundsMulti] = { 2.012970, //2.011429 1.908480, //1.906939 2.588299, //2.586122 1.961360 //1.959184 } new const g_szConstTextMulti[sizeof g_szSoundsMulti][] = { "got a double kill!", "has a TRIPLE kill!", "earned an ULTRA KILL!", "IS ON A RAMPAGE!!" } new const g_iConstTextMultiColor[sizeof g_szConstTextMulti][3] = { { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 0, 0 } } new const g_szConstTextMultiAdd[][] = { "with a double kill!", "with a TRIPLE kill!", "with an ULTRA KILL!", "RAMPAGE!!!" } new g_szSoundOwnage[g_iSizeSzSound] = "D7/Announcers/Dota2/Kill/Announcer_ownage_01.wav"; //new Float:g_fSoundOwnageDuration = 2.586122; const Float:g_fConstTaskMultiDelay = 5.0; const Float:g_fConstTaskAnnounceTextDelay = 0.25; const g_iConstSizeName = 31; new g_iMaxPlayers, g_szName[33][g_iConstSizeName], g_iIDFirstBlood, g_iKills[33], g_iMulti[33], g_iCountKillsTeam, g_iIDPCVarIgnoreBots, g_iCountAnnouncersText, g_iIDAnnouncersText[2]; new g_iZPRunning = 4; enum (+= 33) { g_iIDTaskResetMulti = 8000, g_iIDTaskUpdateName, g_iIDTaskAnnounceText, g_iIDTaskAnnounceTextRemove, g_iIDTaskAnnounceSound } enum _:g_iConstTaskAnnounceTextInfo { g_iConstInfoCount, g_iConstInfoMulti, g_iConstInfoVictim, g_iConstInfoColorR, g_iConstInfoColorG, g_iConstInfoColorB } enum _:g_iExtResults { g_iConstExtResultShort = -2, g_iConstExtResultNone = -1 } stock iFtExtPosReturn(const szFile[]) { new iTemp; for (iTemp = strlen(szFile) - 2; iTemp >= -1; iTemp--) { if (iTemp == -1) break; //log_to_file(szFile, "iTemp: %d. Processing character: ^"%c^".", iTemp, szFile[iTemp]) if (szFile[iTemp] == '.') { iTemp++; //log_to_file(szFile, "iTemp: %d. Found extension: ^"%s^".", iTemp, szFile[iTemp]) break; } else if (szFile[iTemp] == '/' || szFile[iTemp] == '\' || szFile[iTemp] == ' ') { iTemp = -1; break; } } return iTemp; } bFtContainsFolderStart(const szDirectory[], const szFolder[]) { new iPosFolderNameStart, iStrlLenDirectory = strlen(szDirectory); while (iPosFolderNameStart < iStrlLenDirectory && (szDirectory[iPosFolderNameStart] == '/' || szDirectory[iPosFolderNameStart] == '\')) iPosFolderNameStart++; new iStrLenFolder = strlen(szFolder); if (iStrlLenDirectory - (iPosFolderNameStart + 1) < iStrLenFolder + 1 || szDirectory[iPosFolderNameStart + iStrLenFolder + 1] != '/' && szDirectory[iPosFolderNameStart + iStrLenFolder + 1] != '\') { //ftD7Log(_, _, "[bFtContainsFolderStart] szDirectory: ^"%s^". szFolder: ^"%s^". False.", szDirectory, szFolder) return 0; } for (new iID; iID < iStrLenFolder; iID++) { if (szDirectory[iPosFolderNameStart + iID] != szFolder[iID]) { //ftD7Log(_, _, "[bFtContainsFolderStart] szDirectory: ^"%s^". szFolder: ^"%s^". False.", szDirectory, szFolder) return 0; } else if (iID == iStrLenFolder - 1) { //ftD7Log(_, _, "[bFtContainsFolderStart] szDirectory: ^"%s^". szFolder: ^"%s^". True.", szDirectory, szFolder) return 1; } } //ftD7Log(_, _, "[bFtContainsFolderStart] szDirectory: ^"%s^". szFolder: ^"%s^". False.", szDirectory, szFolder) return 0; } enum (<<= 1) { g_iConstBitStopWAV = 1, g_iConstBitStopMp3 } ftPlaySound(const szSound[], const iID = 0, const iBsStopSounds = 0, const bSpeak = 1) { new iPosExt = iFtExtPosReturn(szSound) if (equali(szSound[iPosExt], "mp3")) client_cmd(iID, "%s%smp3 play ^"%s^"", !(iBsStopSounds & g_iConstBitStopWAV) ? "" : "stopsound; ", !(iBsStopSounds & g_iConstBitStopMp3) ? "" : "mp3 stop; ", szSound) else client_cmd(iID, "%s%s%s ^"%s^"", !(iBsStopSounds & g_iConstBitStopWAV) ? "" : "stopsound; ", !(iBsStopSounds & g_iConstBitStopMp3) ? "" : "mp3 stop; ", !bSpeak ? "spk" : "speak", szSound) } public plugin_natives() { set_native_filter("fwNativeFilter") } public fwNativeFilter(const szName[], const iID, const iTrap) { // Credits to Schmurgel /* it's a trap? */ if (equal(szName, "zp_get_user_zombie") && iTrap) { /* yes it's a trap, zp is not running */ g_iZPRunning = 0; return PLUGIN_HANDLED } return (!iTrap) ? PLUGIN_HANDLED : PLUGIN_CONTINUE } public plugin_init() { register_plugin("D7 Announcer Kills: Dota 2", g_szConstVersion, "D i 5 7 i n c T") register_event("HLTV", "fwEventHltvRoundStart", "a", "1=0", "2=0") register_message(get_user_msgid("SayText"), "fwMsgSayTextPre") register_message(get_user_msgid("DeathMsg"), "fwMsgDeathPre") register_cvar("D7AnnouncerKillsD2Version", g_szConstVersion, FCVAR_SERVER | FCVAR_SPONLY) set_cvar_string("D7AnnouncerKillsD2Version", g_szConstVersion) g_iMaxPlayers = get_maxplayers(); g_iIDPCVarIgnoreBots = register_cvar("D7AnnouncerKillsD2IgnoreBots", "0"); /* Check if Zombie Plague is running */ if (LibraryExists("zp50_core", LibType_Library)) { /* zp50 is running */ g_iZPRunning = 5; } else if (get_cvar_pointer("zp_on")) /* Cvar is registered! */ { /* Check if ZP is really running! */ zp_get_user_zombie(1) /* trigger: native_filter. */ } else g_iZPRunning = 0; /* for (new i; i <= 256; i++) { ftD7Log("a", _, "[plugin_init] Character %d: ^"%c^".", i, i) }*/ } public fwEventHltvRoundStart() { g_iIDFirstBlood = 0; g_iCountKillsTeam = 0; /* remove_task(g_iIDTaskAnnounceSound) while (g_iCountAnnouncersText) { remove_task(g_iIDAnnouncersText[g_iCountAnnouncersText - 1] + g_iIDTaskAnnounceTextRemove) fwTaskAnnounceTextRemove(g_iIDAnnouncersText[g_iCountAnnouncersText - 1] + g_iIDTaskAnnounceTextRemove) } */ for (new iID = 1; iID <= g_iMaxPlayers; iID++) { g_iKills[iID] = 0; remove_task(iID + g_iIDTaskResetMulti) fwTaskResetMulti(iID + g_iIDTaskResetMulti) } } public fwTaskUpdateName(iID) { iID -= g_iIDTaskUpdateName; // client_disconnect doesn't cover all the disconnect cases // so we need to be sure the player is still connected if (!is_user_connected(iID)) return; get_user_name(iID, g_szName[iID], charsmax(g_szName[])) } // Credits to Johnny got his gun public fwMsgSayTextPre() { if (get_msg_args() != 4) return; static szBuffer[21]; get_msg_arg_string(2, szBuffer, charsmax(szBuffer)) if (!equali(szBuffer, "#Cstrike_Name_Change")) return; new iID = get_msg_arg_int(1); remove_task(iID + g_iIDTaskUpdateName) set_task(0.1, "fwTaskUpdateName", iID + g_iIDTaskUpdateName) } public client_putinserver(iID) { remove_task(iID + g_iIDTaskUpdateName) set_task(0.1, "fwTaskUpdateName", iID + g_iIDTaskUpdateName) } #if AMXX_VERSION_NUM <= 182 public client_disconnect(iID) #else public client_disconnected(iID) #endif { remove_task(iID + g_iIDTaskUpdateName) g_iKills[iID] = 0; remove_task(iID + g_iIDTaskResetMulti) fwTaskResetMulti(iID + g_iIDTaskResetMulti) remove_task(iID + g_iIDTaskAnnounceTextRemove) fwTaskAnnounceTextRemove(iID + g_iIDTaskAnnounceTextRemove) } public fwTaskResetMulti(iID) { iID -= g_iIDTaskResetMulti; g_iMulti[iID] = 0; //ftD7Log(_, _, "[fwTaskResetMulti] ^"%s^".", g_szName[iID]) } public fwTaskAnnounceText(const szInfo[], iID) { iID -= g_iIDTaskAnnounceText; //ftD7Log(_, iID, "iID: %s. K: %d. M: %d. iIDVictim: %d.", g_szName[iID], szInfo[g_iConstInfoCount], szInfo[g_iConstInfoMulti], szInfo[g_iConstInfoVictim]) new szTemp[128], iTemp; if (szInfo[g_iConstInfoCount] >= 0) { for (iTemp = 0; iTemp < strlen(g_szConstTextCount[szInfo[g_iConstInfoCount]]); iTemp++) szTemp[iTemp] = ' ';//copy(szTemp[iTemp], charsmax(szTemp) - iTemp, " "); //replace_all(szTemp, charsmax(szTemp), "", "") //replace_all(szTemp, charsmax(szTemp), "Ÿ", "") // red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, // effects = 2, Float:fxtime = 6.0, Float:holdtime = 3.0, // Float:fadeintime = 0.1, Float:fadeouttime = 1.5, bool:reliable = true #if defined _dhudmessage_included set_dhudmessage ( szInfo[g_iConstInfoColorR], szInfo[g_iConstInfoColorG], szInfo[g_iConstInfoColorB], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0, false ) #else set_dhudmessage ( szInfo[g_iConstInfoColorR], szInfo[g_iConstInfoColorG], szInfo[g_iConstInfoColorB], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0 ) #endif show_dhudmessage(0, "%s%s%s", (iID == g_iIDAnnouncersText[1]) ? "^n^n" : "", g_szName[iID], szTemp) //ftD7Log("a", iID, "%s%s", g_szName[iID], szTemp) szTemp = ""; for (iTemp = 0; iTemp < strlen(g_szName[iID]); iTemp++) copy(szTemp[iTemp], charsmax(szTemp) - iTemp, " "); //replace_all(szTemp, charsmax(szTemp), "", "") //replace_all(szTemp, charsmax(szTemp), "Ÿ", "") #if defined _dhudmessage_included set_dhudmessage ( g_iConstTextCountColor[szInfo[g_iConstInfoCount]][0], g_iConstTextCountColor[szInfo[g_iConstInfoCount]][1], g_iConstTextCountColor[szInfo[g_iConstInfoCount]][2], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0, false ) #else set_dhudmessage ( g_iConstTextCountColor[szInfo[g_iConstInfoCount]][0], g_iConstTextCountColor[szInfo[g_iConstInfoCount]][1], g_iConstTextCountColor[szInfo[g_iConstInfoCount]][2], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0 ) #endif show_dhudmessage(0, "%s%s %s", (iID == g_iIDAnnouncersText[1]) ? "^n^n" : "", szTemp, g_szConstTextCount[szInfo[g_iConstInfoCount]]) //ftD7Log("a", iID, "%s %s", szTemp, g_szConstTextCount[szInfo[g_iConstInfoCount]]) if (szInfo[g_iConstInfoMulti] >= 0) { #if defined _dhudmessage_included set_dhudmessage ( g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][0], g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][1], g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][2], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0, false ) #else set_dhudmessage ( g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][0], g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][1], g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][2], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0 ) #endif show_dhudmessage(0, "%s%s", (iID == g_iIDAnnouncersText[1]) ? "^n^n^n" : "^n", g_szConstTextMultiAdd[szInfo[g_iConstInfoMulti]]) } } else if (szInfo[g_iConstInfoMulti] >= 0) { for (iTemp = 0; iTemp < strlen(g_szConstTextMulti[szInfo[g_iConstInfoMulti]]); iTemp++) copy(szTemp[iTemp], charsmax(szTemp) - iTemp, " "); //replace_all(szTemp, charsmax(szTemp), "", "") //replace_all(szTemp, charsmax(szTemp), "Ÿ", "") #if defined _dhudmessage_included set_dhudmessage ( szInfo[g_iConstInfoColorR], szInfo[g_iConstInfoColorG], szInfo[g_iConstInfoColorB], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0, false ) #else set_dhudmessage ( szInfo[g_iConstInfoColorR], szInfo[g_iConstInfoColorG], szInfo[g_iConstInfoColorB], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0 ) #endif show_dhudmessage(0, "%s%s%s", (iID == g_iIDAnnouncersText[1]) ? "^n^n" : "", g_szName[iID], szTemp) //ftD7Log("a", iID, "%s%s", g_szName[iID], szTemp) szTemp = ""; for (iTemp = 0; iTemp < strlen(g_szName[iID]); iTemp++) copy(szTemp[iTemp], charsmax(szTemp) - iTemp, " "); //replace_all(szTemp, charsmax(szTemp), "", "") //replace_all(szTemp, charsmax(szTemp), "Ÿ", "") #if defined _dhudmessage_included set_dhudmessage ( g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][0], g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][1], g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][2], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0, false ) #else set_dhudmessage ( g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][0], g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][1], g_iConstTextMultiColor[szInfo[g_iConstInfoMulti]][2], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0 ) #endif show_dhudmessage(0, "%s%s %s", (iID == g_iIDAnnouncersText[1]) ? "^n^n" : "", szTemp, g_szConstTextMulti[szInfo[g_iConstInfoMulti]]) //ftD7Log("a", iID, "%s %s", szTemp, g_szConstTextMulti[szInfo[g_iConstInfoMulti]]) } else if (szInfo[g_iConstInfoVictim]) { for (iTemp = 0; iTemp < strlen(g_szConstTextFirstBlood) + 1 + strlen(g_szName[szInfo[g_iConstInfoVictim]]); iTemp++) copy(szTemp[iTemp], charsmax(szTemp) - iTemp, " "); //replace_all(szTemp, charsmax(szTemp), "", "") //replace_all(szTemp, charsmax(szTemp), "Ÿ", "") #if defined _dhudmessage_included set_dhudmessage ( szInfo[g_iConstInfoColorR], szInfo[g_iConstInfoColorG], szInfo[g_iConstInfoColorB], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0, false ) #else set_dhudmessage ( szInfo[g_iConstInfoColorR], szInfo[g_iConstInfoColorG], szInfo[g_iConstInfoColorB], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0 ) #endif show_dhudmessage(0, "%s%s%s", (iID == g_iIDAnnouncersText[1]) ? "^n^n" : "", g_szName[iID], szTemp) //ftD7Log("a", iID, "%s%s", g_szName[iID], szTemp) szTemp = ""; for (iTemp = 0; iTemp < strlen(g_szName[iID]); iTemp++) copy(szTemp[iTemp], charsmax(szTemp) - iTemp, " "); //replace_all(szTemp, charsmax(szTemp), "", "") //replace_all(szTemp, charsmax(szTemp), "Ÿ", "") #if defined _dhudmessage_included set_dhudmessage ( g_iConstTextFirstBloodColor[0], g_iConstTextFirstBloodColor[1], g_iConstTextFirstBloodColor[2], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0, false ) #else set_dhudmessage ( g_iConstTextFirstBloodColor[0], g_iConstTextFirstBloodColor[1], g_iConstTextFirstBloodColor[2], -1.0, 0.15, 0, 0.0, g_fConstTaskAnnounceTextDelay + ((g_fConstTaskAnnounceTextDelay >= 0.2) ? 0.1 : 0.05), 0.0, 0.0 ) #endif show_dhudmessage(0, "%s%s %s %s", (iID == g_iIDAnnouncersText[1]) ? "^n^n" : "", szTemp, g_szConstTextFirstBlood, g_szName[szInfo[g_iConstInfoVictim]]) //ftD7Log("a", iID, "%s %s %s", szTemp, g_szConstTextFirstBlood, g_szName[szInfo[g_iConstInfoVictim]]) } } public fwTaskAnnounceSound(const szSound[], iIDTask) { ftPlaySound(szSound) } public fwTaskAnnounceTextRemove(iID) { iID -= g_iIDTaskAnnounceTextRemove; remove_task(iID + g_iIDTaskAnnounceText) if (iID == g_iIDAnnouncersText[0]) { g_iCountAnnouncersText--; g_iIDAnnouncersText[0] = g_iIDAnnouncersText[1]; g_iIDAnnouncersText[1] = 0; } else if (iID == g_iIDAnnouncersText[1]) { g_iCountAnnouncersText--; g_iIDAnnouncersText[1] = 0; } } // After fwHamKilledPlayerPre // Before fwHamKilledPlayer public fwMsgDeathPre()//const iIDMsg, const iMsgDest, const iIDEnt { fwKilledPlayer(get_msg_arg_int(2), get_msg_arg_int(1)) } public zp_user_infected_post(iID, iIDAttacker) { if (g_iZPRunning != 4) return; fwKilledPlayer(iID, iIDAttacker) } public zp_fw_core_infect_post(iID, iIDAttacker) { if (g_iZPRunning != 5) return; fwKilledPlayer(iID, iIDAttacker) } public zp_fw_core_cure_post(iID, iIDAttacker) { if (g_iZPRunning != 5) return; fwKilledPlayer(iID, iIDAttacker) } public fwKilledPlayer(const iIDVictim, const iIDAttacker) { if (!iIDAttacker || iIDVictim == iIDAttacker) return; g_iKills[iIDVictim] = 0; if (!is_user_connected(iIDAttacker)) return; new CsTeams:iTeamAttacker = cs_get_user_team(iIDAttacker); if (iTeamAttacker == CS_TEAM_SPECTATOR || iTeamAttacker == CS_TEAM_UNASSIGNED) return; new CsTeams:iTeamVictim; if (!g_iZPRunning) { iTeamVictim = cs_get_user_team(iIDVictim); } else if (g_iZPRunning == 4) { iTeamAttacker = zp_get_user_zombie(iIDAttacker) ? CS_TEAM_T : CS_TEAM_CT; iTeamVictim = (iTeamAttacker == CS_TEAM_CT) ? CS_TEAM_T : CS_TEAM_CT; } else if (g_iZPRunning == 5) { iTeamAttacker = zp_core_is_zombie(iIDAttacker) ? CS_TEAM_T : CS_TEAM_CT; iTeamVictim = (iTeamAttacker == CS_TEAM_CT) ? CS_TEAM_T : CS_TEAM_CT; } //ftD7Log(_, _, "[fwKilledPlayer] iIDVictim(team): ^"%s^"(%d). iIDAttacker(team): ^"%s^"(%d).", g_szName[iIDVictim], iTeamVictim, g_szName[iIDAttacker], iTeamAttacker) if (iTeamAttacker == CS_TEAM_T) { if (g_iCountKillsTeam >= 0) g_iCountKillsTeam = -1; else g_iCountKillsTeam--; } else if (iTeamAttacker == CS_TEAM_CT) { if (g_iCountKillsTeam <= 0) g_iCountKillsTeam = 1; else g_iCountKillsTeam++; } if (iTeamAttacker == iTeamVictim || get_pcvar_num(g_iIDPCVarIgnoreBots) && is_user_bot(iIDAttacker)) return; if (g_iKills[iIDAttacker] < sizeof g_szSoundsCount + 2) g_iKills[iIDAttacker]++; if (g_iMulti[iIDAttacker] < sizeof g_szSoundsMulti + 1) g_iMulti[iIDAttacker]++; remove_task(iIDAttacker + g_iIDTaskResetMulti) set_task(g_fConstTaskMultiDelay, "fwTaskResetMulti", iIDAttacker + g_iIDTaskResetMulti) new Float:fTemp; if (g_iKills[iIDAttacker] >= 3 || g_iMulti[iIDAttacker] >= 2 || !g_iIDFirstBlood) { remove_task(g_iIDTaskAnnounceSound) if (!g_iIDFirstBlood) { set_task(0.1, "fwTaskAnnounceSound", g_iIDTaskAnnounceSound, g_szSoundFirstBlood, charsmax(g_szSoundFirstBlood)) fTemp += g_fSoundFirstBloodDuration; } if (g_iKills[iIDAttacker] >= 3) { if (fTemp <= 0) set_task(0.1, "fwTaskAnnounceSound", g_iIDTaskAnnounceSound, g_szSoundsCount[g_iKills[iIDAttacker] - 3], charsmax(g_szSoundsCount[])) else set_task(fTemp, "fwTaskAnnounceSound", g_iIDTaskAnnounceSound, g_szSoundsCount[g_iKills[iIDAttacker] - 3], charsmax(g_szSoundsCount[])) fTemp += g_fSoundsCountDuration[g_iKills[iIDAttacker] - 3]; } if (g_iMulti[iIDAttacker] >= 2) { if (fTemp <= 0) set_task(0.1, "fwTaskAnnounceSound", g_iIDTaskAnnounceSound, g_szSoundsMulti[g_iMulti[iIDAttacker] - 2], charsmax(g_szSoundsMulti[])) else set_task(fTemp, "fwTaskAnnounceSound", g_iIDTaskAnnounceSound, g_szSoundsMulti[g_iMulti[iIDAttacker] - 2], charsmax(g_szSoundsMulti[])) fTemp += g_fSoundsMultiDuration[g_iMulti[iIDAttacker] - 2]; } remove_task(iIDAttacker + g_iIDTaskAnnounceTextRemove) fwTaskAnnounceTextRemove(iIDAttacker + g_iIDTaskAnnounceTextRemove) set_task(fTemp, "fwTaskAnnounceTextRemove", iIDAttacker + g_iIDTaskAnnounceTextRemove) if (!g_iCountAnnouncersText) { g_iCountAnnouncersText++; g_iIDAnnouncersText[g_iCountAnnouncersText - 1] = iIDAttacker; } else if (g_iCountAnnouncersText == 1) { if (g_iIDAnnouncersText[g_iCountAnnouncersText - 1] != iIDAttacker) { g_iCountAnnouncersText++; g_iIDAnnouncersText[g_iCountAnnouncersText - 1] = iIDAttacker; } } else if (g_iCountAnnouncersText == 2) { if (g_iIDAnnouncersText[g_iCountAnnouncersText - 1] != iIDAttacker) { remove_task(g_iIDAnnouncersText[g_iCountAnnouncersText - 2] + g_iIDTaskAnnounceText) g_iIDAnnouncersText[g_iCountAnnouncersText - 2] = g_iIDAnnouncersText[g_iCountAnnouncersText - 1]; g_iIDAnnouncersText[g_iCountAnnouncersText - 1] = iIDAttacker; } } new szTemp[g_iConstTaskAnnounceTextInfo]; szTemp[g_iConstInfoCount] = g_iKills[iIDAttacker] - 3; szTemp[g_iConstInfoMulti] = g_iMulti[iIDAttacker] - 2; szTemp[g_iConstInfoVictim] = g_iIDFirstBlood ? 0 : iIDVictim; szTemp[g_iConstInfoColorR] = (iTeamAttacker == CS_TEAM_T) ? 255 : 0; szTemp[g_iConstInfoColorG] = 0; szTemp[g_iConstInfoColorB] = (iTeamAttacker == CS_TEAM_T) ? 0 : 255; remove_task(iIDAttacker + g_iIDTaskAnnounceText) if (g_fConstTaskAnnounceTextDelay >= 0.2) set_task(0.1, "fwTaskAnnounceText", iIDAttacker + g_iIDTaskAnnounceText, szTemp, g_iConstTaskAnnounceTextInfo) set_task(g_fConstTaskAnnounceTextDelay, "fwTaskAnnounceText", iIDAttacker + g_iIDTaskAnnounceText, szTemp, g_iConstTaskAnnounceTextInfo, "b") //ftD7Log(_, iIDAttacker, "[fwKilledPlayer] Announcers: %d. 1: ^"%s^". 2: ^"%s^".", g_iCountAnnouncersText, g_szName[g_iIDAnnouncersText[0]], (g_iCountAnnouncersText > 1) ? g_szName[g_iIDAnnouncersText[1]] : "") } if (g_iCountKillsTeam <= -5 || g_iCountKillsTeam >= 5) { if (fTemp <= 0) { remove_task(g_iIDTaskAnnounceSound) set_task(0.1, "fwTaskAnnounceSound", g_iIDTaskAnnounceSound, g_szSoundOwnage, charsmax(g_szSoundOwnage)) } else set_task(fTemp, "fwTaskAnnounceSound", g_iIDTaskAnnounceSound, g_szSoundOwnage, charsmax(g_szSoundOwnage)) } if (!g_iIDFirstBlood) { g_iIDFirstBlood = iIDAttacker; } } public plugin_precache() { new iTemp, iID; if (g_szSoundFirstBlood[0]) { if (!bFtContainsFolderStart(g_szSoundFirstBlood, "sound")) format(g_szSoundFirstBlood, charsmax(g_szSoundFirstBlood), "sound/%s", g_szSoundFirstBlood) precache_generic(g_szSoundFirstBlood) iTemp = iFtExtPosReturn(g_szSoundFirstBlood); if (iTemp >= 0 && equali(g_szSoundFirstBlood[iTemp], "wav")) { g_fSoundFirstBloodDuration = sfile_get_duration(g_szSoundFirstBlood); replace(g_szSoundFirstBlood, charsmax(g_szSoundFirstBlood), g_szSoundFirstBlood[iTemp - 1], "") } } if (g_szSoundOwnage[0]) { if (!bFtContainsFolderStart(g_szSoundOwnage, "sound")) format(g_szSoundOwnage, charsmax(g_szSoundOwnage), "sound/%s", g_szSoundOwnage) precache_generic(g_szSoundOwnage) iTemp = iFtExtPosReturn(g_szSoundOwnage); if (iTemp >= 0 && equali(g_szSoundOwnage[iTemp], "wav")) { g_fSoundFirstBloodDuration = sfile_get_duration(g_szSoundOwnage); replace(g_szSoundOwnage, charsmax(g_szSoundOwnage), g_szSoundOwnage[iTemp - 1], "") } } for (iID = 0; iID < sizeof g_szSoundsCount; iID++) { if (!g_szSoundsCount[iID][0]) continue; if (!bFtContainsFolderStart(g_szSoundsCount[iID], "sound")) format(g_szSoundsCount[iID], charsmax(g_szSoundsCount[]), "sound/%s", g_szSoundsCount[iID]) precache_generic(g_szSoundsCount[iID]) iTemp = iFtExtPosReturn(g_szSoundsCount[iID]); if (iTemp >= 0 && equali(g_szSoundsCount[iID][iTemp], "wav")) { g_fSoundFirstBloodDuration = sfile_get_duration(g_szSoundsCount[iID]); replace(g_szSoundsCount[iID], charsmax(g_szSoundsCount[]), g_szSoundsCount[iID][iTemp - 1], "") } } for (iID = 0; iID < sizeof g_szSoundsMulti; iID++) { if (!g_szSoundsMulti[iID][0]) continue; if (!bFtContainsFolderStart(g_szSoundsMulti[iID], "sound")) format(g_szSoundsMulti[iID], charsmax(g_szSoundsMulti[]), "sound/%s", g_szSoundsMulti[iID]) precache_generic(g_szSoundsMulti[iID]) iTemp = iFtExtPosReturn(g_szSoundsMulti[iID]); if (iTemp >= 0 && equali(g_szSoundsMulti[iID][iTemp], "wav")) { g_fSoundFirstBloodDuration = sfile_get_duration(g_szSoundsMulti[iID]); replace(g_szSoundsMulti[iID], charsmax(g_szSoundsMulti[]), g_szSoundsMulti[iID][iTemp - 1], "") } } } bitsums.inc Attached Files dhudmessage.inc (2.9 KB) soundinfo.inc (12.0 KB) Get Plugin or Get Source (D7AnnouncerKillsD2.sma - 28.5 KB) D7KillAnnouncerDota2Sounds.zip (463.0 KB) Przeczytaj cały wpis
  25. MYGO.pl

    D7 Kill Assist

    D i 5 7 i n c T's Kill Assist Enables kill assist. The player who has done the most damage to the killed victim(including the victim itself) will be shown as an assister in the death(frag) message. Uses fake name change by sending messages to clients instead of changing it server-side, eliminating any compatibility issues with other plug-ins that rely on player name such as ranking plug-ins, etc. Joined name parts are guaranteed to be different for better readability and equal in length at the same time. Runs on any GoldSource(Half-Life 1) engine game. Supports Counter-Strike: Condition Zero bots. None. None. This plug-in requires the following: - Ham Bots API. Latest version as of 2015 December 22 of the script(cs_ham_bots_api.sma) and include(cs_ham_bots_api.inc) are attached along below. To disable support for CZ bots or if there are any mod compatibility issues because of it, simply comment #include <cs_ham_bots_api> and recompile. - BitSum stocks include file (bitsums.inc). Attached along below. Change the killer and assister names joiner by editing the following string and recompiling: new const g_szNameJoiner[] = " + "; Get source and compile locally. Spection - For his CS Revo Kill Assist plug-in from which I got the fake name change code. MeRcyLeZZ - For his HamSandwich register bots API. dorin2oo7 - For his images I used to style up my post. NiHiLaNTh, schmurgel1983, KliPPy, meTaLiCroSS - For being true friends and always helping and teaching me new stuff. Code: T = needs testing X = done - = cancelled [-] re-write with manual death message sending and restore name on name change(pre or post) [X] re-write with fake name change(SVC_UPDATEUSERINFO) v1.0.0 [T] fix damage taken not resetting for spawned player v1.0.1 [ ] add individual messages for hltv [ ] add minimum damage required to consider as assist [ ] add forwards for sub-plugins [ ] Code(for easy readability): PHP Code: // Modules #include <amxmodx> #include <fakemeta> #include <hamsandwich> // Plug-in APIs #include <cs_ham_bots_api> // Stocks #include <bitsums> //#include <D7Debug> const g_iSizeName = 31; new g_iMaxPlayers, Float:g_fDamage[33][33], g_iBsConnected, g_iBsNameRestore; new const g_szNameJoiner[] = " + "; public plugin_init() { register_plugin("D7 Kill assist", "1.0.1", "D i 5 7 i n c T, Spection") //register_event("HLTV", "fwEvHltvRoundStart", "a", "1=0", "2=0") RegisterHam(Ham_Spawn, "player", "fwHamSpawnPlayer", 1) RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamagePlayer", 1) RegisterHam(Ham_Killed, "player", "fwHamKilledPlayerPre") RegisterHam(Ham_Killed, "player", "fwHamKilledPlayer", 1) #if defined _cs_ham_bots_api_included RegisterHamBots(Ham_Spawn, "fwHamSpawnPlayer", 1) RegisterHamBots(Ham_TakeDamage, "fwHamTakeDamagePlayer", 1) RegisterHamBots(Ham_Killed, "fwHamKilledPlayerPre") RegisterHamBots(Ham_Killed, "fwHamKilledPlayer", 1) #endif g_iMaxPlayers = get_maxplayers(); /* register_clcmd("say /tmulti", "fwClCmdSayTestMulti") register_clcmd("say /tdead", "fwClCmdSayTestDead") register_clcmd("say /tmultidead", "fwClCmdSayTestMultiDead") register_clcmd("say /rs", "fwClCmdSayRespawn")*/ } /* public fwEvHltvRoundStart() { client_print(0, print_center, "Round start") for (new iID = 1; iID <= g_iMaxPlayers; iID++) g_fDamage[iID] = Float:""; }*/ public client_putinserver(iID) { #if AMXX_VERSION_NUM <= 182 set_task(0.1, "fwTaskPlayerCheckConnected", iID, _, _, "b") #endif bitsum_add(g_iBsConnected, iID) } #if AMXX_VERSION_NUM <= 182 public fwTaskPlayerCheckConnected(const iID) { if (bitsum_get(g_iBsConnected, iID) && !is_user_connected(iID)) { client_disconnect(iID) } } public client_disconnect(iID) #else public client_disconnected(iID) #endif { #if AMXX_VERSION_NUM <= 182 remove_task(iID) #endif bitsum_del(g_iBsConnected, iID) for (new iID2 = 1; iID2 <= g_iMaxPlayers; iID2++) { g_fDamage[iID][iID2] = 0.0; g_fDamage[iID2][iID] = 0.0; } } public fwHamSpawnPlayer(const iID) { if (!is_user_alive(iID)) return; for (new iID2 = 1; iID2 <= g_iMaxPlayers; iID2++) { g_fDamage[iID2][iID] = 0.0; } } public fwHamTakeDamagePlayer(const iIDVictim, const iIDInflictor, const iIDAttacker, const Float:fDamage)//, const iBsDamageType { if (!(0 <= iIDAttacker <= g_iMaxPlayers) || GetHamReturnStatus() == HAM_SUPERCEDE) return; if (iIDAttacker) g_fDamage[iIDAttacker][iIDVictim] += fDamage; else g_fDamage[iIDVictim][iIDVictim] += fDamage; } public fwHamKilledPlayerPre(const iIDVictim, iIDAttacker) { if ((1 <= iIDAttacker <= g_iMaxPlayers) && !bitsum_get(g_iBsConnected, iIDAttacker)) return PLUGIN_CONTINUE; if (!iIDAttacker) iIDAttacker = iIDVictim; new Float:fDamage, iIDAssister; for (new iID = 1; iID <= g_iMaxPlayers; iID++) { /* if (g_fDamage[iID][iIDVictim]) ftD7Log(_, _, "[fwHamKilledPlayerPre] iIDAttacker: ^"%s^". iIDAssister: ^"%s^". iIDVictim: ^"%s^". ^n\ g_fDamage[%s][%s]: %.2f. fDamage: %.2f.", szNameAttacker, szNameAssister, g_szName[iIDVictim], g_szName[iID], g_szName[iIDVictim], g_fDamage[iID][iIDVictim], fDamage) */ if (iID == iIDAttacker || fDamage >= g_fDamage[iID][iIDVictim]) { g_fDamage[iID][iIDVictim] = 0.0; continue; } iIDAssister = iID; fDamage = g_fDamage[iID][iIDVictim]; g_fDamage[iID][iIDVictim] = 0.0; } if (!iIDAssister) return PLUGIN_CONTINUE; new szNameAttacker[g_iSizeName], szNameAssister[g_iSizeName]; get_user_name(iIDAttacker, szNameAttacker, charsmax(szNameAttacker)) get_user_name(iIDAssister, szNameAssister, charsmax(szNameAssister)) //ftD7Log(_, _, "[fwHamKilledPlayerPre] iIDAttacker: ^"%s^". iIDVictim: %d. iIDAssister: ^"%s^".", szNameAttacker, iIDVictim, szNameAssister) static iSizeNameEqual; if (!iSizeNameEqual) { iSizeNameEqual = floatround(float(g_iSizeName - sizeof g_szNameJoiner) / 2, floatround_floor); } new iLenghtString, szNameJoined[g_iSizeName]; iLenghtString = iSizeNameEqual - strlen(szNameAssister); if (iLenghtString <= 0) iLenghtString = iSizeNameEqual; else iLenghtString += iSizeNameEqual; formatex(szNameJoined, iLenghtString - 1, szNameAttacker) iLenghtString = strlen(szNameJoined); new iPos; while ((szNameAssister[iPos] == szNameJoined[iPos] || szNameAssister[iPos] == ' ') && iPos < iLenghtString) { iPos++; } iPos -= (iSizeNameEqual + (iSizeNameEqual - iLenghtString)); if (iPos < 0) iPos = 0; formatex(szNameJoined[iLenghtString], g_iSizeName - iLenghtString - 1, "%s%s", g_szNameJoiner, szNameAssister[iPos]) //ftD7Log(_, _, "[fwHamKilledPlayerPre] iIDAttacker: ^"%s^". iIDAssister: ^"%s^". szNameJoined: ^"%s^".", szNameAttacker, szNameAssister, szNameJoined) bitsum_add(g_iBsNameRestore, iIDAttacker) message_begin(MSG_ALL, SVC_UPDATEUSERINFO) write_byte(iIDAttacker - 1) write_long(get_user_userid(iIDAttacker)) write_char('\') write_char('n') write_char('a') write_char('m') write_char('e') write_char('\') write_string(szNameJoined) for (iPos = 0; iPos < 16; iPos++) write_byte(0) message_end() return PLUGIN_CONTINUE; } // DeathMsg is triggered after fwHamKilledPlayerPre and before fwHamKilledPlayer public fwHamKilledPlayer(const iIDVictim, iIDAttacker) { if (bitsum_get(g_iBsNameRestore, iIDAttacker)) bitsum_del(g_iBsNameRestore, iIDAttacker) else if (bitsum_get(g_iBsNameRestore, iIDVictim)) { bitsum_del(g_iBsNameRestore, iIDVictim) iIDAttacker = iIDVictim; } else return; new szUserInfo[256] copy_infokey_buffer(engfunc(EngFunc_GetInfoKeyBuffer, iIDAttacker), szUserInfo, charsmax(szUserInfo)) message_begin(MSG_ALL, SVC_UPDATEUSERINFO) write_byte(iIDAttacker - 1) write_long(get_user_userid(iIDAttacker)) write_string(szUserInfo) write_long(0) write_long(0) write_long(0) write_long(0) message_end() } cs_ham_bots_api.sma cs_ham_bots_api.inc bitsums.inc Attached Files Get Plugin or Get Source (D7KillAssist.sma - 9.0 KB) Przeczytaj cały wpis
×
×
  • Dodaj nową pozycję...