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

    28693
  • Dołączył

  • Ostatnia wizyta

    nigdy
  • Wygrane w rankingu

    11

Treść opublikowana przez MYGO.pl

  1. TF2 DropWeapon The purpose of this plugin is to re-enable dropping weapons from players into the worls and picking them back up / re-equipping single inventory slots. This allows for weapon handling similar to other Source games like CS. I feel like it's important to mention that the goal of this plugin is not to give you arbitrary weapons (falsify inventory) to arbitrary classes, but to merely give weapons already owned by a player back to them in a controlled manner, like you would expect from other valve games. Weapon class restrictions are also untouched! You wont be able to equip scouts with rocket launchers using this plugin. For players, the idea is simple Use your drop item key (Default `bind L dropitem`) to drop your active weapon (CTF flag as priority). To pick an item back up use your action item key (default H) or, for a more reliable pickup, use a +use bind. Unless disabled, you can also just walk over the weapon to pick it up, given you do not have another weapon in the same slot. If you just want this as a library for other plugins, you can set `sm_tf2dropweapon_enabled 0` to set the plugin in library mode and disable all interactive/player functionallity. For plugin devs Using this plugin you can drop weapons, pick up any tf_dropped_weapon to a player, regenerate loadout slots from the current player inventory, equip stock items for players on a whim, even by the weapon's classname; or react to weapons being dropped and picked up. See the include file for more information. This plugin also partially restores SDKHook_WeaponDrop (i think) and SDKHook_DropWeapon native (bypassHooks needs to be false). ConVars & Commands sm_tf2dropweapon_supresscleanup 0 By default the game checks the game mode and deletes already existing weapons before spawning more. Set to 1 to disable that check. sm_tf2dropweapon_usetopickup 1 The default key for picking up weapons seems to have issues. Set to 1 to allow +use to pick up weapons. sm_tf2dropweapon_pickupany 1 There are some restriction for picking up weapons. Set to 1 to ignore these. Note: Setting to one uses a reimplementation that might be more prone to gamedata updates, so try 0 if you're running into issues. sm_tf2dropweapon_touchpickup 1 Set to 1 to pick up weapons, that fit into a slot that is currently empty. sm_tf2dropweapon_enabled 1 Enables sm_dropweapon/sm_pickupweapon, dropitem hook and proximity pickup. Set to 0 if you just got this plugin as library. The commands were used for testing, but feel free to enable them for your players: sm_dropweapon Drop your weapon sm_pickupweapon Look at a weapon first sm_giveweapon ADMFLAG_CHEATS - Usage: (\<weapon>\|\<class> \<slot> ['stock']). Gives a player a weapon. Either use a weapon class name, or player class name and slot. For class and slot, gives from the loadout. If stock is specified uses a stock weapon. sm_dwgive ADMFLAG_CHEATS - Same as sm_giveweapon. Just a shorter alias that should not clash with other give weapon plugins. Natives/Forwards overview PHP Code: // React to when a weapons is dropped forward Action TF2DW_OnClientDropWeapon(int client, int weapon) // Listen to when a weapon was dropped forward void TF2DW_OnClientDropWeaponPost(int client, int droppedWeapon) // React to when a weapon is picked up forward Action TF2DW_OnClientPickupWeapon(int client, int droppedWeapon) // Listen to when a weapon was picked up forward void TF2DW_OnClientPickupWeapon(int client, int droppedWeapon) // Force a player to drop a weapon in the given loadout slot native int TF2DW_DropWeaponLoadoutSlot(int client, int loadoutSlot) // Equip a player with a weapon based on weapon classname and active player class (stock) native int TF2DW_GiveWeaponByClassname(int client, const char[] classname) // Equip a player with a weapon based on weapon slot and active player class (uses loadout unless stockItem is true) native int TF2DW_GiveWeaponForLoadoutSlot(int client, int loadoutSlot, bool stockItem=false) // Spawn a stock dropped weapon in the world based on weapon class name and specified player class native int TF2DW_CreateDroppedWeaponByClassname(const char[] classname, TFClassType class, const float position[3]) // Spawn a dropped weapon in the world based on player loadout, player class and weapon slot native int TF2DW_CreateDroppedWeaponFromLoadout(int client, TFClassType class, int slot, const float position[3]) // Get the stock item definition index for a given player class and loadout slot native int TF2DW_GetStockWeaponItemDef(TFClassType class, int slot) // Get a weapons default max ammo and clip size based on player class data and item attributes native bool TF2DW_GetWeaponDefaultMaxClipAndAmmo(int itemDef, TFClassType playerClass=TFClass_Unknown, int& maxClip=0, int& maxAmmo=0) Dependencies TF Econ Data TF2Utils TF2PlayerClassData Optionally use TF2 Gravity Hands to prevent weapon-less players from A-posing GitHub Wyświetl pełny artykuł
  2. I haven't been successful when searching for this feature and any posts I found were only instructing the requester to search first which I have. Players are requesting the ability to restrict weapons (specifically nades) by team on certain maps. They feel some flashes/smokes are an unfair advantage to one team on certain maps. Has this been done? Can the existing restmenu.sma be modified to include team restriction by restricted weapon? Przeczytaj cały wpis
  3. Hello guys! I use zombie swarm mode and frostnade plugin, when I use frost grenade on the zombie in zombie swarm, after the freeze/chill the zombie walks slower than his original speed. Zombie is set on speed "320" walks very fast can catch up to normal human, but frost grenade after use makes zombie permanently slower for the rest of the round. I need zombie to stay at fast speed after being frozen. This bug don't happen to napalm(fire) grenade, only happens for frost grenade. I tried to make chill speed = 0, min max chance for chill = 0. It didn't work frostnade sma PHP Code: #include <amxmodx> #include <cstrike> #include <fakemeta> #include <fun> #include <hamsandwich> new const VERSION[] = "2.14"; #define message_begin_fl(%1,%2,%3,%4) engfunc(EngFunc_MessageBegin, %1, %2, %3, %4) #define write_coord_fl(%1) engfunc(EngFunc_WriteCoord, %1) #define m_pPlayer 41 #define m_pActiveItem 373 #define m_flFlashedUntil 514 #define m_flFlashHoldTime 517 #define OFFSET_WEAPON_CSWID 43 #define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame #define MAX_WEAPONS 32 #define AMMO_FLASHBANG 11 #define AMMO_HEGRENADE 12 #define AMMO_SMOKEGRENADE 13 #define DMG_GRENADE (1<<24) // thanks arkshine #define FFADE_IN 0x0000 // just here so we don't pass 0 into the function #define BREAK_GLASS 0x01 #define STATUS_HIDE 0 #define STATUS_SHOW 1 #define STATUS_FLASH 2 #define GLOW_AMOUNT 1.0 #define FROST_RADIUS 240.0 #define NT_FLASHBANG (1<<0) // 1; CSW:25 #define NT_HEGRENADE (1<<1) // 2; CSW:4 #define NT_SMOKEGRENADE (1<<2) // 4; CSW:9 new const GRENADE_NAMES[][] = { "weapon_hegrenade", "weapon_flashbang", "weapon_smokegrenade" }; #define ICON_HASNADE 1 #define ICON_ISCHILLED 2 #define TASK_REMOVE_CHILL 100 #define TASK_REMOVE_FREEZE 200 new const MODEL_FROZEN[] = "models/pi_shrub.mdl"; new const MODEL_GLASSGIBS[] = "models/glassgibs.mdl"; new const SOUND_EXPLODE[] = "frostnade/frostnova.wav"; new const SOUND_FROZEN[] = "debris/glass1.wav"; new const SOUND_UNFROZEN[] = "debris/glass3.wav"; new const SOUND_CHILLED[] = "player/pl_duct2.wav"; new const SOUND_PICKUP[] = "items/gunpickup2.wav"; new const SPRITE_TRAIL[] = "sprites/laserbeam.spr"; new const SPRITE_SMOKE[] = "sprites/steam1.spr"; new const SPRITE_EXPLO[] = "sprites/shockwave.spr"; new pcv_enabled, pcv_override, pcv_nadetypes, pcv_teams, pcv_price, pcv_limit, pcv_buyzone, pcv_color, pcv_icon, pcv_by_radius, pcv_hitself, pcv_los, pcv_maxdamage, pcv_mindamage, pcv_chill_maxchance, pcv_chill_minchance, pcv_chill_duration, pcv_chill_variance, pcv_chill_speed, pcv_freeze_maxchance, pcv_freeze_minchance, pcv_freeze_duration, pcv_freeze_variance; new maxPlayers, gmsgScreenFade, gmsgStatusIcon, gmsgBlinkAcct, gmsgAmmoPickup, gmsgTextMsg, gmsgWeapPickup, glassGibs, trailSpr, smokeSpr, exploSpr, mp_friendlyfire, czero, bot_quota, czBotHams, fmFwdPPT, fnFwdPlayerChilled, fnFwdPlayerFrozen, bool:roundRestarting; new isChilled[33], isFrozen[33], frostKilled[33], novaDisplay[33], Float:glowColor[33][3], Float:oldGravity[33], oldRenderFx[33], Float:oldRenderColor[33][3], oldRenderMode[33], Float:oldRenderAmt[33], hasFrostNade[33], nadesBought[33]; public plugin_init() { register_plugin("FrostNades",VERSION,"Avalanche"); register_cvar("fn_version",VERSION,FCVAR_SERVER); pcv_enabled = register_cvar("fn_enabled","1"); pcv_override = register_cvar("fn_override","1"); pcv_nadetypes = register_cvar("fn_nadetypes","1"); // NT_SMOKEGRENADE pcv_teams = register_cvar("fn_teams","2"); pcv_price = register_cvar("fn_price","300"); pcv_icon = register_cvar("fn_icon","1"); pcv_limit = register_cvar("fn_limit","2"); pcv_buyzone = register_cvar("fn_buyzone","0"); pcv_color = register_cvar("fn_color","0 206 209"); pcv_by_radius = register_cvar("fn_by_radius","0.0"); pcv_hitself = register_cvar("fn_hitself","0"); pcv_los = register_cvar("fn_los","1"); pcv_maxdamage = register_cvar("fn_maxdamage","20.0"); pcv_mindamage = register_cvar("fn_mindamage","1.0"); pcv_chill_maxchance = register_cvar("fn_chill_maxchance","0"); pcv_chill_minchance = register_cvar("fn_chill_minchance","0"); pcv_chill_duration = register_cvar("fn_chill_duration","0"); pcv_chill_variance = register_cvar("fn_chill_variance","0"); pcv_chill_speed = register_cvar("fn_chill_speed","0"); pcv_freeze_maxchance = register_cvar("fn_freeze_maxchance","110.0"); pcv_freeze_minchance = register_cvar("fn_freeze_minchance","40.0"); pcv_freeze_duration = register_cvar("fn_freeze_duration","4.0"); pcv_freeze_variance = register_cvar("fn_freeze_variance","0.5"); mp_friendlyfire = get_cvar_pointer("mp_friendlyfire"); new mod[6]; get_modname(mod,5); if(equal(mod,"czero")) { czero = 1; bot_quota = get_cvar_pointer("bot_quota"); } maxPlayers = get_maxplayers(); gmsgScreenFade = get_user_msgid("ScreenFade"); gmsgStatusIcon = get_user_msgid("StatusIcon"); gmsgBlinkAcct = get_user_msgid("BlinkAcct"); gmsgAmmoPickup = get_user_msgid("AmmoPickup"); gmsgWeapPickup = get_user_msgid("WeapPickup"); gmsgTextMsg = get_user_msgid("TextMsg"); register_forward(FM_SetModel,"fw_setmodel",1); register_message(get_user_msgid("DeathMsg"),"msg_deathmsg"); register_event("ResetHUD", "event_resethud", "b"); register_event("TextMsg", "event_round_restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in"); register_event("HLTV", "event_new_round", "a", "1=0", "2=0"); RegisterHam(Ham_Spawn,"player","ham_player_spawn",1); RegisterHam(Ham_Killed,"player","ham_player_killed",1); RegisterHam(Ham_Player_ResetMaxSpeed,"player","ham_player_resetmaxspeed",0); RegisterHam(Ham_Think,"grenade","ham_grenade_think",0); RegisterHam(Ham_Use, "player_weaponstrip", "ham_player_weaponstrip_use", 1); for(new i=0; i<sizeof GRENADE_NAMES; i++) { RegisterHam(Ham_Item_Deploy, GRENADE_NAMES[i], "ham_grenade_deploy", 1); RegisterHam(Ham_Item_Holster, GRENADE_NAMES[i], "ham_grenade_holster", 1); RegisterHam(Ham_Item_AddToPlayer, GRENADE_NAMES[i], "ham_grenade_addtoplayer", 1); RegisterHam(Ham_Item_AddDuplicate, GRENADE_NAMES[i], "ham_grenade_addduplicate", 1); } register_clcmd("say /fn","buy_frostnade"); register_clcmd("say_team /fn","buy_frostnade"); register_clcmd("say /frostnade","buy_frostnade"); register_clcmd("say_team /frostnade","buy_frostnade"); fnFwdPlayerChilled = CreateMultiForward("frostnades_player_chilled", ET_STOP, FP_CELL, FP_CELL); fnFwdPlayerFrozen = CreateMultiForward("frostnades_player_frozen", ET_STOP, FP_CELL, FP_CELL); } public plugin_end() { DestroyForward(fnFwdPlayerChilled); DestroyForward(fnFwdPlayerFrozen); } public plugin_precache() { precache_model(MODEL_FROZEN); glassGibs = precache_model(MODEL_GLASSGIBS); precache_sound(SOUND_EXPLODE); // grenade explodes precache_sound(SOUND_FROZEN); // player is frozen precache_sound(SOUND_UNFROZEN); // frozen wears off precache_sound(SOUND_CHILLED); // player is chilled precache_sound(SOUND_PICKUP); // player buys frostnade trailSpr = precache_model(SPRITE_TRAIL); smokeSpr = precache_model(SPRITE_SMOKE); exploSpr = precache_model(SPRITE_EXPLO); } public client_putinserver(id) { isChilled[id] = 0; isFrozen[id] = 0; frostKilled[id] = 0; novaDisplay[id] = 0; hasFrostNade[id] = 0; if(czero && !czBotHams && is_user_bot(id) && get_pcvar_num(bot_quota) > 0) set_task(0.1,"czbot_hook_ham",id); } public client_disconnect(id) { if(isChilled[id]) task_remove_chill(TASK_REMOVE_CHILL+id); if(isFrozen[id]) task_remove_freeze(TASK_REMOVE_FREEZE+id); } // registering a ham hook for "player" won't register it for CZ bots, // for some reason. so we have to register it by entity. public czbot_hook_ham(id) { if(!czBotHams && is_user_connected(id) && is_user_bot(id) && get_pcvar_num(bot_quota) > 0) { RegisterHamFromEntity(Ham_Spawn,id,"ham_player_spawn",1); RegisterHamFromEntity(Ham_Killed,id,"ham_player_killed",1); RegisterHamFromEntity(Ham_Player_ResetMaxSpeed,id,"ham_player_resetmaxspeed",1); czBotHams = 1; } } // intercept server log messages to replace grenade kills with frostgrenade kills public plugin_log() { static arg[512]; if(get_pcvar_num(pcv_enabled) && read_logargc() >= 5) { read_logargv(1, arg, 7); // "killed" if(equal(arg, "killed")) { read_logargv(2, arg, 127); // info of player that was killed // get ID of player that was killed new dummy[1], killedUserId; parse_loguser(arg, dummy, 0, killedUserId); new killedId = find_player("k", killedUserId); if(killedId && frostKilled[killedId]) { // override with frostgrenade message read_logdata(arg, 511); replace(arg, 511, "with ^"grenade^"", "with ^"frostgrenade^""); log_message("%s", arg); return PLUGIN_HANDLED; } } } return PLUGIN_CONTINUE; } /**************************************** * PRIMARY FUNCTIONS AND SUCH ****************************************/ public buy_frostnade(id) { if(!get_pcvar_num(pcv_enabled) || get_pcvar_num(pcv_override)) return PLUGIN_CONTINUE; if(!is_user_alive(id)) return PLUGIN_HANDLED; if(get_pcvar_num(pcv_buyzone) && !cs_get_user_buyzone(id)) { // #Cstrike_NotInBuyZone won't work for some reason client_print(id,print_center,"You are not in a buy zone."); return PLUGIN_HANDLED; } if(!(get_pcvar_num(pcv_teams) & _:cs_get_user_team(id))) { // have to do it this way to format message_begin(MSG_ONE,gmsgTextMsg,_,id); write_byte(print_center); write_string("#Alias_Not_Avail"); write_string("Frost Grenade"); message_end(); return PLUGIN_HANDLED; } if(hasFrostNade[id]) { client_print(id,print_center,"#Cstrike_Already_Own_Weapon"); return PLUGIN_HANDLED; } new limit = get_pcvar_num(pcv_limit); if(limit && nadesBought[id] >= limit) { client_print(id,print_center,"#Cstrike_TitlesTXT_Cannot_Carry_Anymore"); return PLUGIN_HANDLED; } new money = cs_get_user_money(id), price = get_pcvar_num(pcv_price); // need more vespene gas if(money < price) { client_print(id,print_center,"#Cstrike_TitlesTXT_Not_Enough_Money"); message_begin(MSG_ONE_UNRELIABLE,gmsgBlinkAcct,_,id); write_byte(2); message_end(); return PLUGIN_HANDLED; } // try to use smokegrenade, then flashbang, then hegrenade new wpnid = CSW_SMOKEGRENADE, ammoid = AMMO_SMOKEGRENADE, wpnName[20] = "weapon_smokegrenade", type = get_pcvar_num(pcv_nadetypes); if(!(type & NT_SMOKEGRENADE)) { if(type & NT_FLASHBANG) { wpnid = CSW_FLASHBANG; ammoid = AMMO_FLASHBANG; wpnName = "weapon_flashbang"; } else if(type & NT_HEGRENADE) { wpnid = CSW_HEGRENADE; ammoid = AMMO_HEGRENADE; wpnName = "weapon_hegrenade"; } } hasFrostNade[id] = wpnid; nadesBought[id]++; cs_set_user_money(id,money - price); new ammo = cs_get_user_bpammo(id,wpnid); // give him one if(!ammo) give_item(id,wpnName); else { cs_set_user_bpammo(id,wpnid,ammo+1); // just so the player can see what kind it is on his HUD message_begin(MSG_ONE,gmsgAmmoPickup,_,id); write_byte(ammoid); write_byte(ammo+1); message_end(); message_begin(MSG_ONE,gmsgWeapPickup,_,id); write_byte(wpnid); message_end(); // won't play via cs_set_user_bpammo engfunc(EngFunc_EmitSound,id,CHAN_ITEM,SOUND_PICKUP,VOL_NORM,ATTN_NORM,0,PITCH_NORM); // for icon management grenade_added(id, wpnid); } return PLUGIN_HANDLED; } // entity is given a model (used to detect for thrown grenades) public fw_setmodel(ent,model[]) { if(!get_pcvar_num(pcv_enabled)) return FMRES_IGNORED; new owner = pev(ent,pev_owner); if(!is_user_connected(owner)) return FMRES_IGNORED; // this isn't going to explode new Float:dmgtime; pev(ent,pev_dmgtime,dmgtime); if(dmgtime == 0.0) return FMRES_IGNORED; new type, csw; if(model[7] == 'w' && model[8] == '_') { switch(model[9]) { case 'h': { type = NT_HEGRENADE; csw = CSW_HEGRENADE; } case 'f': { type = NT_FLASHBANG; csw = CSW_FLASHBANG; } case 's': { type = NT_SMOKEGRENADE; csw = CSW_SMOKEGRENADE; } } } if(!type) return FMRES_IGNORED; new team = _:cs_get_user_team(owner); // have a frostnade (override off) ;OR; override enabled, on valid team, using valid frostnade type if(hasFrostNade[owner] == csw || (get_pcvar_num(pcv_override) && (get_pcvar_num(pcv_teams) & team) && (get_pcvar_num(pcv_nadetypes) & type))) { // not using override if(hasFrostNade[owner] == csw) { hasFrostNade[owner] = 0; if(get_pcvar_num(pcv_icon) == ICON_HASNADE) { show_icon(owner, STATUS_HIDE); } } set_pev(ent,pev_team,team); set_pev(ent,pev_bInDuck,1); // flag it as a frostnade new rgb[3], Float:rgbF[3]; get_rgb_colors(team,rgb); IVecFVec(rgb, rgbF); // glowshell set_pev(ent,pev_rendermode,kRenderNormal); set_pev(ent,pev_renderfx,kRenderFxGlowShell); set_pev(ent,pev_rendercolor,rgbF); set_pev(ent,pev_renderamt,16.0); set_beamfollow(ent,10,10,rgb,100); } return FMRES_IGNORED; } // freeze a player in place whilst he's frozen public fw_playerprethink(id) { /*if(isChilled[id]) { // remember rendering changes new fx = pev(id,pev_renderfx), Float:color[3], mode = pev(id,pev_rendermode), Float:amount; pev(id,pev_rendercolor,color); pev(id,pev_renderamt,amount); if(fx != kRenderFxGlowShell) { oldRenderFx[id] = fx; set_pev(id,pev_renderfx,kRenderFxGlowShell); } if(color[0] != glowColor[id][0] || color[1] != glowColor[id][1] || color[2] != glowColor[id][2]) { oldRenderColor[id] = color; set_pev(id,pev_rendercolor,glowColor[id]); } if(mode != kRenderNormal) { oldRenderMode[id] = mode; set_pev(id,pev_rendermode,kRenderNormal); } if(amount != GLOW_AMOUNT) { oldRenderAmt[id] = amount; set_pev(id,pev_renderamt,GLOW_AMOUNT); } }*/ if(isFrozen[id]) { set_pev(id,pev_velocity,Float:{0.0,0.0,0.0}); // stop motion new Float:gravity; pev(id,pev_gravity,gravity); // remember any gravity changes if(gravity != 0.000000001 && gravity != 999999999.9) oldGravity[id] = gravity; // if are on the ground and about to jump, set the gravity too high to really do so if((pev(id,pev_button) & IN_JUMP) && !(pev(id,pev_oldbuttons) & IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND)) set_pev(id,pev_gravity,999999999.9); // otherwise, set the gravity so low that they don't fall else set_pev(id,pev_gravity,0.000000001); } return FMRES_IGNORED; } // override grenade kill message with skull and crossbones public msg_deathmsg(msg_id,msg_dest,msg_entity) { new victim = get_msg_arg_int(2); if(!is_user_connected(victim) || !frostKilled[victim]) return PLUGIN_CONTINUE; static weapon[8]; get_msg_arg_string(4,weapon,7); if(equal(weapon,"grenade")) set_msg_arg_string(4,"frostgrenade"); //frostKilled[victim] = 0; return PLUGIN_CONTINUE; } // catch HUD reset to re-display icon if necessary public event_resethud(id) { if(!is_user_alive(id) || !get_pcvar_num(pcv_enabled)) return; if(get_pcvar_num(pcv_icon) == ICON_HASNADE) { new status = player_has_frostnade(id); show_icon(id, status); } return; } // round is restarting (TAG: sv_restartround) public event_round_restart() { // just remember for event_new_round roundRestarting = true; } // start of a new round public event_new_round() { if(roundRestarting) { roundRestarting = false; // clear frost grenades from all players (for override mode) for(new i=1;i<=maxPlayers;i++) { hasFrostNade[i] = 0; } } } // rezzed public ham_player_spawn(id) { nadesBought[id] = 0; if(is_user_alive(id)) { if(isChilled[id]) task_remove_chill(TASK_REMOVE_CHILL+id); if(isFrozen[id]) task_remove_freeze(TASK_REMOVE_FREEZE+id); } return HAM_IGNORED; } // killed to death public ham_player_killed(id) { hasFrostNade[id] = 0; if(get_pcvar_num(pcv_enabled) && get_pcvar_num(pcv_icon) == ICON_HASNADE) { show_icon(id, STATUS_HIDE); } if(isChilled[id]) task_remove_chill(TASK_REMOVE_CHILL+id); if(isFrozen[id]) task_remove_freeze(TASK_REMOVE_FREEZE+id); return HAM_IGNORED; } // movement speed is changed public ham_player_resetmaxspeed(id) { if(get_pcvar_num(pcv_enabled)) { set_user_chillfreeze_speed(id); } return HAM_IGNORED; } // grenade is ticking away public ham_grenade_think(ent) { // not a frostnade if(!pev_valid(ent) || !pev(ent,pev_bInDuck)) return HAM_IGNORED; new Float:dmgtime; pev(ent,pev_dmgtime,dmgtime); if(dmgtime > get_gametime()) return HAM_IGNORED; // and boom goes the dynamite frostnade_explode(ent); return HAM_SUPERCEDE; } // a player_weaponstrip is used public ham_player_weaponstrip_use(ent, idcaller, idactivator, use_type, Float:value) { if(idcaller >= 1 && idcaller <= maxPlayers) { // clear frostnade when using override hasFrostNade[idcaller] = 0; if(is_user_alive(idcaller) && get_pcvar_num(pcv_enabled) && get_pcvar_num(pcv_icon) == ICON_HASNADE) { new status = player_has_frostnade(idcaller); show_icon(idcaller, status); } } return HAM_IGNORED; } // some kind of grenade is deployed public ham_grenade_deploy(ent) { if(pev_valid(ent)) { grenade_deployed(get_pdata_cbase(ent, m_pPlayer, 4), get_pdata_int(ent, OFFSET_WEAPON_CSWID, 4)); } return HAM_IGNORED; } // some kind of grenade is holstered public ham_grenade_holster(ent) { if(pev_valid(ent)) { grenade_holstered(get_pdata_cbase(ent, m_pPlayer, 4), get_pdata_int(ent, OFFSET_WEAPON_CSWID, 4)); } return HAM_IGNORED; } // some kind of grenade is added to a player's inventory public ham_grenade_addtoplayer(ent, id) { if(pev_valid(ent)) { grenade_added(id, get_pdata_int(ent, OFFSET_WEAPON_CSWID, 4)); } return HAM_IGNORED; } // some kind of grenade is added to a player's inventory, when he already has one public ham_grenade_addduplicate(ent, orig) { if(pev_valid(orig)) { grenade_added(pev(orig, pev_owner), get_pdata_int(orig, OFFSET_WEAPON_CSWID, 4)); } return HAM_IGNORED; } // handle when player id deploys a grenade with weapon id wid grenade_deployed(id, wid) { // if we should worry about managing my icon now if(get_pcvar_num(pcv_enabled) && is_user_alive(id) && get_pcvar_num(pcv_icon) == ICON_HASNADE) { // if I just switched to a frost grenade if( wid == hasFrostNade[id] || (get_pcvar_num(pcv_override) && (get_pcvar_num(pcv_teams) & _:cs_get_user_team(id)) && is_wid_in_nadetypes(wid)) ) { show_icon(id, STATUS_FLASH); } } } // handle when player id holsters a grenade with weapon id wid grenade_holstered(id, wid) { // if we should worry about managing my icon now if(get_pcvar_num(pcv_enabled) && is_user_alive(id) && get_pcvar_num(pcv_icon) == ICON_HASNADE) { // if I just holstered a frost grenade if( wid == hasFrostNade[id] || (get_pcvar_num(pcv_override) && (get_pcvar_num(pcv_teams) & _:cs_get_user_team(id)) && is_wid_in_nadetypes(wid)) ) { // only do STATUS_SHOW or STATUS_HIDE... during holster, current weapon // will still technically be the frost grenade, but we don't want to // mistakenly flash the icon new status = (player_has_frostnade(id) != STATUS_HIDE ? STATUS_SHOW : STATUS_HIDE); show_icon(id, status); } } } // handle when player id gets a grenade with weapon id wid added to his inventory grenade_added(id, wid) { // if we should worry about managing my icon now if(get_pcvar_num(pcv_enabled) && is_user_alive(id) && get_pcvar_num(pcv_icon) == ICON_HASNADE) { // if I just got a frost grenade if( wid == hasFrostNade[id] || (get_pcvar_num(pcv_override) && (get_pcvar_num(pcv_teams) & _:cs_get_user_team(id)) && is_wid_in_nadetypes(wid)) ) { new status = player_has_frostnade(id); show_icon(id, status); } } } // a frost grenade explodes public frostnade_explode(ent) { new nadeTeam = pev(ent,pev_team), owner = pev(ent,pev_owner), Float:nadeOrigin[3]; pev(ent,pev_origin,nadeOrigin); // make the smoke message_begin_fl(MSG_PVS,SVC_TEMPENTITY,nadeOrigin,0); write_byte(TE_SMOKE); write_coord_fl(nadeOrigin[0]); // x write_coord_fl(nadeOrigin[1]); // y write_coord_fl(nadeOrigin[2]); // z write_short(smokeSpr); // sprite write_byte(random_num(30,40)); // scale write_byte(5); // framerate message_end(); // explosion create_blast(nadeTeam,nadeOrigin); emit_sound(ent,CHAN_ITEM,SOUND_EXPLODE,VOL_NORM,ATTN_NORM,0,PITCH_NORM); // cache our cvars new ff = get_pcvar_num(mp_friendlyfire), Float:by_radius = get_pcvar_float(pcv_by_radius), hitself = get_pcvar_num(pcv_hitself), los = get_pcvar_num(pcv_los), Float:maxdamage = get_pcvar_float(pcv_maxdamage), Float:mindamage = get_pcvar_float(pcv_mindamage), Float:chill_maxchance = get_pcvar_float(pcv_chill_maxchance), Float:chill_minchance = get_pcvar_float(pcv_chill_minchance), Float:freeze_maxchance, Float:freeze_minchance; if(!by_radius) { freeze_maxchance = get_pcvar_float(pcv_freeze_maxchance); freeze_minchance = get_pcvar_float(pcv_freeze_minchance); } new ta, Float:targetOrigin[3], Float:distance, tr = create_tr2(), Float:fraction, Float:damage, gotFrozen = 0; for(new target=1;target<=maxPlayers;target++) { // dead, invincible, or self attack that is not allowed if(!is_user_alive(target) || pev(target,pev_takedamage) == DAMAGE_NO || (pev(target,pev_flags) & FL_GODMODE) ||(target == owner && !hitself)) continue; // this is a team attack with ff disabled, excluding self attack ta = (_:cs_get_user_team(target) == nadeTeam); if(ta && !ff && target != owner) continue; pev(target,pev_origin,targetOrigin); distance = vector_distance(nadeOrigin,targetOrigin); // too far if(distance > FROST_RADIUS) continue; // check line of sight if(los) { nadeOrigin[2] += 2.0; engfunc(EngFunc_TraceLine,nadeOrigin,targetOrigin,DONT_IGNORE_MONSTERS,ent,tr); nadeOrigin[2] -= 2.0; get_tr2(tr,TR_flFraction,fraction); if(fraction != 1.0 && get_tr2(tr,TR_pHit) != target) continue; } // damaged if(maxdamage > 0.0) { damage = radius_calc(distance,FROST_RADIUS,maxdamage,mindamage); if(ta) damage /= 2.0; // half damage for friendlyfire if(damage > 0.0) { frostKilled[target] = 1; ExecuteHamB(Ham_TakeDamage,target,ent,owner,damage,DMG_GRENADE); if(!is_user_alive(target)) continue; // dead now frostKilled[target] = 0; } } // frozen if((by_radius && radius_calc(distance,FROST_RADIUS,100.0,0.0) >= by_radius) || (!by_radius && random_num(1,100) <= floatround(radius_calc(distance,FROST_RADIUS,freeze_maxchance,freeze_minchance)))) { if(freeze_player(target,owner,nadeTeam)) { gotFrozen = 1; emit_sound(target,CHAN_ITEM,SOUND_FROZEN,1.0,ATTN_NONE,0,PITCH_NORM); } } // chilled if(by_radius || random_num(1,100) <= floatround(radius_calc(distance,FROST_RADIUS,chill_maxchance,chill_minchance))) { if(chill_player(target,owner,nadeTeam)) { if(!gotFrozen) emit_sound(target,CHAN_ITEM,SOUND_CHILLED,VOL_NORM,ATTN_NORM,0,PITCH_NORM); } } } free_tr2(tr); set_pev(ent,pev_flags,pev(ent,pev_flags)|FL_KILLME); } freeze_player(id,attacker,nadeTeam) { new fwdRetVal = PLUGIN_CONTINUE; ExecuteForward(fnFwdPlayerFrozen, fwdRetVal, id, attacker); if(fwdRetVal == PLUGIN_HANDLED || fwdRetVal == PLUGIN_HANDLED_MAIN) { return 0; } if(!isFrozen[id]) { pev(id,pev_gravity,oldGravity[id]); // register our forward only when we need it if(!fmFwdPPT) { fmFwdPPT = register_forward(FM_PlayerPreThink,"fw_playerprethink",0); } } isFrozen[id] = nadeTeam; set_pev(id,pev_velocity,Float:{0.0,0.0,0.0}); set_user_chillfreeze_speed(id); new Float:duration = get_pcvar_float(pcv_freeze_duration), Float:variance = get_pcvar_float(pcv_freeze_variance); duration += random_float(-variance,variance); remove_task(TASK_REMOVE_FREEZE+id); set_task(duration,"task_remove_freeze",TASK_REMOVE_FREEZE+id); if(!pev_valid(novaDisplay[id])) create_nova(id); if(get_pcvar_num(pcv_icon) == ICON_ISCHILLED) { show_icon(id, STATUS_FLASH); } return 1; } public task_remove_freeze(taskid) { new id = taskid-TASK_REMOVE_FREEZE; if(pev_valid(novaDisplay[id])) { new Float:origin[3]; pev(novaDisplay[id],pev_origin,origin); // add some tracers message_begin_fl(MSG_PVS,SVC_TEMPENTITY,origin,0); write_byte(TE_IMPLOSION); write_coord_fl(origin[0]); // x write_coord_fl(origin[1]); // y write_coord_fl(origin[2] + 8.0); // z write_byte(64); // radius write_byte(10); // count write_byte(3); // duration message_end(); // add some sparks message_begin_fl(MSG_PVS,SVC_TEMPENTITY,origin,0); write_byte(TE_SPARKS); write_coord_fl(origin[0]); // x write_coord_fl(origin[1]); // y write_coord_fl(origin[2]); // z message_end(); // add the shatter message_begin_fl(MSG_PAS,SVC_TEMPENTITY,origin,0); write_byte(TE_BREAKMODEL); write_coord_fl(origin[0]); // x write_coord_fl(origin[1]); // y write_coord_fl(origin[2] + 24.0); // z write_coord_fl(16.0); // size x write_coord_fl(16.0); // size y write_coord_fl(16.0); // size z write_coord(random_num(-50,50)); // velocity x write_coord(random_num(-50,50)); // velocity y write_coord_fl(25.0); // velocity z write_byte(10); // random velocity write_short(glassGibs); // model write_byte(10); // count write_byte(25); // life write_byte(BREAK_GLASS); // flags message_end(); emit_sound(novaDisplay[id],CHAN_ITEM,SOUND_UNFROZEN,VOL_NORM,ATTN_NORM,0,PITCH_NORM); set_pev(novaDisplay[id],pev_flags,pev(novaDisplay[id],pev_flags)|FL_KILLME); } isFrozen[id] = 0; novaDisplay[id] = 0; // unregister forward if we are no longer using it unregister_prethink(); if(!is_user_connected(id)) return; // restore speed, but then check for chilled ExecuteHam(Ham_Player_ResetMaxSpeed, id); set_user_chillfreeze_speed(id); set_pev(id,pev_gravity,oldGravity[id]); new status = STATUS_HIDE; // sometimes trail fades during freeze, reapply if(isChilled[id]) { status = STATUS_SHOW; new rgb[3]; get_rgb_colors(isChilled[id],rgb); set_beamfollow(id,30,8,rgb,100); } if(get_pcvar_num(pcv_icon) == ICON_ISCHILLED) { show_icon(id, status); } } chill_player(id,attacker,nadeTeam) { new fwdRetVal = PLUGIN_CONTINUE; ExecuteForward(fnFwdPlayerChilled, fwdRetVal, id, attacker); if(fwdRetVal == PLUGIN_HANDLED || fwdRetVal == PLUGIN_HANDLED_MAIN) { return 0; } // we aren't already been chilled if(!isChilled[id]) { oldRenderFx[id] = pev(id,pev_renderfx); pev(id,pev_rendercolor,oldRenderColor[id]); oldRenderMode[id] = pev(id,pev_rendermode); pev(id,pev_renderamt,oldRenderAmt[id]); isChilled[id] = nadeTeam; // fix -- thanks Exolent // register our forward only when we need it //if(!fmFwdPPT) fmFwdPPT = register_forward(FM_PlayerPreThink,"fw_playerprethink",0); } isChilled[id] = nadeTeam; set_user_chillfreeze_speed(id); new Float:duration = get_pcvar_float(pcv_chill_duration), Float:variance = get_pcvar_float(pcv_chill_variance); duration += random_float(-variance,variance); remove_task(TASK_REMOVE_CHILL+id); set_task(duration,"task_remove_chill",TASK_REMOVE_CHILL+id); new rgb[3]; get_rgb_colors(nadeTeam,rgb); IVecFVec(rgb, glowColor[id]); // glowshell set_user_rendering(id, kRenderFxGlowShell, rgb[0], rgb[1], rgb[2], kRenderNormal, floatround(GLOW_AMOUNT)); set_beamfollow(id,30,8,rgb,100); // I decided to let the frostnade tint override a flashbang, // because if you are frozen, then you have much bigger problems. // add a blue tint to their screen message_begin(MSG_ONE,gmsgScreenFade,_,id); write_short(floatround(4096.0 * duration)); // duration write_short(floatround(3072.0 * duration)); // hold time (4096.0 * 0.75) write_short(FFADE_IN); // flags write_byte(rgb[0]); // red write_byte(rgb[1]); // green write_byte(rgb[2]); // blue write_byte(100); // alpha message_end(); if(get_pcvar_num(pcv_icon) == ICON_ISCHILLED && !isFrozen[id]) { show_icon(id, STATUS_SHOW); } return 1; } public task_remove_chill(taskid) { new id = taskid-TASK_REMOVE_CHILL; isChilled[id] = 0; // unregister forward if we are no longer using it //unregister_prethink(); if(!is_user_connected(id)) return; // set speed to normal, then check for frozen ExecuteHam(Ham_Player_ResetMaxSpeed, id); set_user_chillfreeze_speed(id); // reset rendering set_user_rendering(id, oldRenderFx[id], floatround(oldRenderColor[id][0]), floatround(oldRenderColor[id][1]), floatround(oldRenderColor[id][2]), oldRenderMode[id], floatround(oldRenderAmt[id])); clear_beamfollow(id); // calculate end of flashbang new Float:flashedUntil = get_pdata_float(id,m_flFlashedUntil), Float:flashHoldTime = get_pdata_float(id,m_flFlashHoldTime), Float:endOfFlash = flashedUntil + (flashHoldTime * 0.67); // not blinded if(get_gametime() >= endOfFlash) { // clear tint message_begin(MSG_ONE,gmsgScreenFade,_,id); write_short(0); // duration write_short(0); // hold time write_short(FFADE_IN); // flags write_byte(0); // red write_byte(0); // green write_byte(0); // blue write_byte(255); // alpha message_end(); } if(get_pcvar_num(pcv_icon) == ICON_ISCHILLED && !isFrozen[id]) { show_icon(id, STATUS_HIDE); } } // make a frost nova at a player's feet create_nova(id) { new nova = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target")); engfunc(EngFunc_SetSize,nova,Float:{-8.0,-8.0,-4.0},Float:{8.0,8.0,4.0}); engfunc(EngFunc_SetModel,nova,MODEL_FROZEN); // random orientation new Float:angles[3]; angles[1] = random_float(0.0,360.0); set_pev(nova,pev_angles,angles); // put it at their feet new Float:novaOrigin[3]; pev(id,pev_origin,novaOrigin); engfunc(EngFunc_SetOrigin,nova,novaOrigin); // make it translucent new rgb[3]; get_rgb_colors(isFrozen[id], rgb); IVecFVec(rgb, angles); // let's just use angles set_pev(nova,pev_rendercolor,angles); // see above set_pev(nova,pev_rendermode,kRenderTransAlpha); set_pev(nova,pev_renderfx,kRenderFxGlowShell); set_pev(nova,pev_renderamt,128.0); novaDisplay[id] = nova; } /**************************************** * UTILITY FUNCTIONS ****************************************/ // check if prethink is still being used, if not, unhook it unregister_prethink() { if(fmFwdPPT) { new i; for(i=1;i<=maxPlayers;i++) if(/*isChilled[i] ||*/ isFrozen[i]) break; if(i > maxPlayers) { unregister_forward(FM_PlayerPreThink,fmFwdPPT,0); fmFwdPPT = 0; } } } // make the explosion effects create_blast(team,Float:origin[3]) { new rgb[3]; get_rgb_colors(team,rgb); // smallest ring message_begin_fl(MSG_PVS,SVC_TEMPENTITY,origin,0); write_byte(TE_BEAMCYLINDER); write_coord_fl(origin[0]); // x write_coord_fl(origin[1]); // y write_coord_fl(origin[2]); // z write_coord_fl(origin[0]); // x axis write_coord_fl(origin[1]); // y axis write_coord_fl(origin[2] + 385.0); // z axis write_short(exploSpr); // sprite write_byte(0); // start frame write_byte(0); // framerate write_byte(4); // life write_byte(60); // width write_byte(0); // noise write_byte(rgb[0]); // red write_byte(rgb[1]); // green write_byte(rgb[2]); // blue write_byte(100); // brightness write_byte(0); // speed message_end(); // medium ring message_begin_fl(MSG_PVS,SVC_TEMPENTITY,origin,0); write_byte(TE_BEAMCYLINDER); write_coord_fl(origin[0]); // x write_coord_fl(origin[1]); // y write_coord_fl(origin[2]); // z write_coord_fl(origin[0]); // x axis write_coord_fl(origin[1]); // y axis write_coord_fl(origin[2] + 470.0); // z axis write_short(exploSpr); // sprite write_byte(0); // start frame write_byte(0); // framerate write_byte(4); // life write_byte(60); // width write_byte(0); // noise write_byte(rgb[0]); // red write_byte(rgb[1]); // green write_byte(rgb[2]); // blue write_byte(100); // brightness write_byte(0); // speed message_end(); // largest ring message_begin_fl(MSG_PVS,SVC_TEMPENTITY,origin,0); write_byte(TE_BEAMCYLINDER); write_coord_fl(origin[0]); // x write_coord_fl(origin[1]); // y write_coord_fl(origin[2]); // z write_coord_fl(origin[0]); // x axis write_coord_fl(origin[1]); // y axis write_coord_fl(origin[2] + 555.0); // z axis write_short(exploSpr); // sprite write_byte(0); // start frame write_byte(0); // framerate write_byte(4); // life write_byte(60); // width write_byte(0); // noise write_byte(rgb[0]); // red write_byte(rgb[1]); // green write_byte(rgb[2]); // blue write_byte(100); // brightness write_byte(0); // speed message_end(); // light effect message_begin_fl(MSG_PAS,SVC_TEMPENTITY,origin,0); write_byte(TE_DLIGHT); write_coord_fl(origin[0]); // x write_coord_fl(origin[1]); // y write_coord_fl(origin[2]); // z write_byte(floatround(FROST_RADIUS/5.0)); // radius write_byte(rgb[0]); // r write_byte(rgb[1]); // g write_byte(rgb[2]); // b write_byte(8); // life write_byte(60); // decay rate message_end(); } // give an entity a beam trail set_beamfollow(ent,life,width,rgb[3],brightness) { clear_beamfollow(ent); message_begin(MSG_BROADCAST,SVC_TEMPENTITY); write_byte(TE_BEAMFOLLOW); write_short(ent); // entity write_short(trailSpr); // sprite write_byte(life); // life write_byte(width); // width write_byte(rgb[0]); // red write_byte(rgb[1]); // green write_byte(rgb[2]); // blue write_byte(brightness); // brightness message_end(); } // removes beam trails from an entity clear_beamfollow(ent) { message_begin(MSG_BROADCAST,SVC_TEMPENTITY); write_byte(TE_KILLBEAM); write_short(ent); // entity message_end(); } // gets the appropriate color and displays the frostnade icon to the player with the given status show_icon(id, status) { static rgb[3]; if(status) get_rgb_colors(_:cs_get_user_team(id), rgb); // only get colors if we need to message_begin(MSG_ONE,gmsgStatusIcon,_,id); write_byte(status); // status (0=hide, 1=show, 2=flash) write_string("dmg_cold"); // sprite name write_byte(rgb[0]); // red write_byte(rgb[1]); // green write_byte(rgb[2]); // blue message_end(); } // checks if a weapon id is included in fn_nadetypes is_wid_in_nadetypes(wid) { new types = get_pcvar_num(pcv_nadetypes); return ( (wid == CSW_HEGRENADE && (types & NT_HEGRENADE)) || (wid == CSW_FLASHBANG && (types & NT_FLASHBANG)) || (wid == CSW_SMOKEGRENADE && (types & NT_SMOKEGRENADE)) ); } // checks if a player has a frostnade, taking into account fn_override and such. // returns: STATUS_HIDE = no frostnade, STATUS_SHOW = has frostnade but not deployed, STATUS_FLASH = has frostnade and deployed player_has_frostnade(id) { new retVal = STATUS_HIDE, curwpn = get_user_weapon(id); // no override, variable explicitly set if(hasFrostNade[id]) { retVal = (curwpn == hasFrostNade[id] ? STATUS_FLASH : STATUS_SHOW); } // override enabled, and I'm on the right team else if(get_pcvar_num(pcv_override) && (get_pcvar_num(pcv_teams) & _:cs_get_user_team(id))) { new types = get_pcvar_num(pcv_nadetypes); if((types & NT_HEGRENADE) && cs_get_user_bpammo(id, CSW_HEGRENADE) > 0) { retVal = (curwpn == CSW_HEGRENADE ? STATUS_FLASH : STATUS_SHOW); } if(retVal != STATUS_FLASH && (types & NT_FLASHBANG) && cs_get_user_bpammo(id, CSW_FLASHBANG) > 0) { retVal = (curwpn == CSW_FLASHBANG ? STATUS_FLASH : STATUS_SHOW); } if(retVal != STATUS_FLASH && (types & NT_SMOKEGRENADE) && cs_get_user_bpammo(id, NT_SMOKEGRENADE) > 0) { retVal = (curwpn == NT_SMOKEGRENADE ? STATUS_FLASH : STATUS_SHOW); } } return retVal; } // gets RGB colors from the cvar get_rgb_colors(team,rgb[3]) { static color[12], parts[3][4]; get_pcvar_string(pcv_color,color,11); // if cvar is set to "team", use colors based on the given team if(equali(color,"team",4)) { if(team == 1) { rgb[0] = 150; rgb[1] = 0; rgb[2] = 0; } else { rgb[0] = 0; rgb[1] = 0; rgb[2] = 150; } } else { parse(color,parts[0],3,parts[1],3,parts[2],3); rgb[0] = str_to_num(parts[0]); rgb[1] = str_to_num(parts[1]); rgb[2] = str_to_num(parts[2]); } } // scale a value equally (inversely?) with the distance that something // is from the center of another thing. that makes pretty much no sense, // so basically, the closer we are to the center of a ring, the higher // our value gets. // // EXAMPLE: distance = 60.0, radius = 240.0, maxVal = 100.0, minVal = 20.0 // we are 0.75 (1.0-(60.0/240.0)) of the way to the radius, so scaled with our // values, it comes out to 80.0 (20.0 + (0.75 * (100.0 - 20.0))) Float:radius_calc(Float:distance,Float:radius,Float:maxVal,Float:minVal) { if(maxVal <= 0.0) return 0.0; if(minVal >= maxVal) return minVal; return minVal + ((1.0 - (distance / radius)) * (maxVal - minVal)); } // sets a user's chilled/frozen speed if applicable // (NOTE: does NOT reset his maxspeed if he is not chilled/frozen) set_user_chillfreeze_speed(id) { if(isFrozen[id]) { set_user_maxspeed(id, 1.0); } else if(isChilled[id]) { set_user_maxspeed(id, get_default_maxspeed(id)*(get_pcvar_float(pcv_chill_speed)/100.0)); } } // gets the maxspeed a user should have, given his current weapon stock Float:get_default_maxspeed(id) { new wEnt = get_pdata_cbase(id, m_pActiveItem), Float:result = 250.0; if(pev_valid(wEnt)) { ExecuteHam(Ham_CS_Item_GetMaxSpeed, wEnt, result); } return result; } Zombie swarm sma PHP Code: #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <engine> #include <fakemeta> //Sets the sky you want for your server #define SKYNAME "space" //The time before zombies have leap at round start. Has to be a float/decimal #define LEAP_CD 5.0 #define MAX_PLAYERS 32 new bool:g_restart_attempt[MAX_PLAYERS + 1] #define ZOMBIE_MISS 2 new miss_zombie[ZOMBIE_MISS][] = {"zombie/claw_miss1.wav", "zombie/claw_miss2.wav" } #define ZOMBIE_HIT 3 new hit_zombie[ZOMBIE_HIT][] = {"zombie/claw_strike1.wav", "zombie/claw_strike2.wav","zombie/claw_strike3.wav" } #define ZOMBIE_PAIN 2 new pain_zombie[ZOMBIE_PAIN][] = {"zombie_swarm/zombie_pain1.wav", "zombie_swarm/zombie_pain2.wav" } #define HUMAN_PAIN 2 new pain_human[HUMAN_PAIN][] = {"zombie_swarm/human_pain1.wav", "zombie_swarm/human_pain2.wav" } #define Keysmenu_1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<9) #define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2) #define SLOT_PRIMARY 1 #define SLOT_SECONDARY 2 #define SLOT_KNIFE 3 #define SLOT_GRENADE 4 #define SLOT_C4 5 #define 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)) #define SECONDARY_WEAPONS_BIT_SUM ((2<<CSW_P228)|(2<<CSW_ELITE)|(2<<CSW_FIVESEVEN)|(CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)) stock g_WeaponSlots[] = { 0, 2, 0, 1, 4, 1, 5, 1, 1, 4, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1 ,1, 4, 2, 1, 1, 3, 1 } stock g_MaxBPAmmo[] = { 0, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 21, 90, 120, 90, 2, 35, 90, 90, 0, 100 } new bool:g_zombie[33] new bool:buying new bool:g_speed new mod_name[32] = "Zombie Swarm" //Pcvars... new zomb_switch, zomb_hp,zomb_ap,zomb_speed,zomb_lightning, zomb_leap,zomb_money,zomb_zdmg, zomb_hdmg,zomb_ammo, zomb_nvg, zomb_obj, bool:g_leap[33] new MODEL[256], zomb_model, use_model new bombMap = 0 new hostageMap = 0 //The old commands new g_autoteam, g_limitteams, g_flashlight new hudsync #define PLUGIN "Zombie Swarm" #define VERSION "" #define AUTHOR "Mini_Midget" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar(PLUGIN,VERSION,FCVAR_SERVER) register_dictionary("zombie_swarm.txt") register_logevent("logevent_round_start",2, "1=Round_Start") register_logevent("logevent_round_end", 2, "1=Round_End") register_event("ResetHUD","event_hud_reset", "be") register_event("TextMsg","event_restart_attempt", "a", "2=#Game_will_restart_in") register_event("CurWeapon","event_cur_weapon","be", "1=1") register_event("Damage","event_damage_scream","be","2!0","3=0") register_event("Damage", "event_damage", "be", "2!0","3=0","4!0") register_event("StatusIcon", "event_status_icon", "be", "1=1", "1=2", "2=c4") register_event("HLTV", "event_new_round", "a", "1=0", "2=0") register_forward(FM_ClientUserInfoChanged,"fw_info") register_forward(FM_PlayerPreThink,"fw_prethink") register_forward(FM_PlayerPostThink,"fw_postthink") register_forward(FM_Touch,"fw_Touch"); register_forward( FM_EmitSound, "fw_EmitSound" ) register_forward(FM_CmdStart, "fw_Cmd") register_forward(FM_GetGameDescription,"GameDesc") register_message(get_user_msgid("Scenario"),"message_scenario"); register_message(get_user_msgid("BombDrop"),"message_bombdrop"); register_message(get_user_msgid("AmmoPickup"),"message_ammopickup"); register_message(get_user_msgid("TextMsg"),"message_textmsg"); register_message(get_user_msgid("HostagePos"),"message_hostagepos"); register_clcmd("say","clcmd_say") register_menucmd(register_menuid("Buy Menu"), Keysmenu_1, "buy_menu") register_clcmd("fullupdate","clcmd_fullupdate") register_concmd("zombie_swarm", "zsonoff", ADMIN_IMMUNITY, "<0/1> Disable/Enable Zombie Swarm") zomb_switch = register_cvar("zs_enabled","1") zomb_hp = register_cvar("zs_health","4000") zomb_ap = register_cvar("zs_armour","500") zomb_speed = register_cvar("zs_speed","320") zomb_lightning = register_cvar("zs_lightning","2") zomb_leap = register_cvar("zs_leap","1") zomb_money = register_cvar("zs_money","7000") zomb_zdmg = register_cvar("zs_zdmg","55") zomb_hdmg = register_cvar("zs_hdmg","150") zomb_ammo = register_cvar("zs_ammo","0") zomb_nvg = register_cvar("zs_nvg","0") zomb_obj = register_cvar("zs_objectives","1") zomb_model = register_cvar("zs_model","zombie_swarm") use_model = register_cvar("zs_use","1") if(fm_find_ent_by_class(1, "info_bomb_target") || fm_find_ent_by_class(1, "func_bomb_target")) bombMap = 1; if(fm_find_ent_by_class(1,"hostage_entity")) hostageMap = 1 g_autoteam = get_cvar_num("mp_autoteambalance") g_limitteams = get_cvar_num("mp_limitteams") g_flashlight = get_cvar_num("mp_flashlight") server_cmd("sv_skyname %s", SKYNAME) server_cmd("sv_maxspeed 1000") set_cvar_num("mp_autoteambalance",0) set_cvar_num("mp_limitteams", 1) set_cvar_num("mp_flashlight", 1) set_task(1.0, "lightning_effects") set_task(1.0, "ambience_loop") format(mod_name, 31, "Zombie Swarm %s", VERSION) hudsync = CreateHudSyncObj() } public plugin_precache() { precache_model("models/player/zombie_swarm/zombie_swarm.mdl") precache_model("models/v_knife_zombie.mdl") precache_sound("zombie_swarm/ambience.wav") new i for (i = 0; i < ZOMBIE_MISS; i++) precache_sound(miss_zombie[i]) for (i = 0; i < ZOMBIE_HIT; i++) precache_sound(hit_zombie[i]) for (i = 0; i < ZOMBIE_PAIN; i++) precache_sound(pain_zombie[i]) for (i = 0; i < HUMAN_PAIN; i++) precache_sound(pain_human[i]) } public client_putinserver(id) { g_zombie[id] = false g_restart_attempt[id] = false g_speed = false client_cmd(id, "stopsound") } public zsonoff(id,level,cid) { if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED new szArg[5] read_argv(1, szArg, 4) if (equali(szArg,"1") || equali(szArg,"on")) { if (get_cvar_num("zombie_swarm") == 1) { console_print(id, "%s is already on!", PLUGIN) return PLUGIN_HANDLED } zs_on() set_hudmessage(255, 255, 255, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, -1) show_hudmessage(0, "%s is now ON!", PLUGIN) console_print(0, "%s has been turned ON!", PLUGIN) client_print(0, print_chat, "%s has been turned ON!", PLUGIN) return PLUGIN_HANDLED } if (equali(szArg,"0") || equali(szArg,"off")) { if (get_cvar_num("zs_enabled") == 0) { console_print(id, "%s is already off!", PLUGIN) return PLUGIN_HANDLED } zs_off() set_hudmessage(255, 255, 255, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, -1) show_hudmessage(0, "%s has been turned OFF!", PLUGIN) console_print(0, "%s has been turned OFF!", PLUGIN) client_print(0, print_chat, "%s has been turned OFF!", PLUGIN) return PLUGIN_HANDLED } console_print(id, "Invalid argument!") client_print(id, print_chat, "Invalid argument!") return PLUGIN_HANDLED } public zs_on() { new maxplayers = get_maxplayers() for (new i = 1; i <= maxplayers; i++) { g_zombie[i] = false g_restart_attempt[i] = false } set_cvar_num("zs_enabled", 1) set_task(1.0, "lightning_effects") set_task(1.0, "ambience_loop") set_cvar_num("mp_autoteambalance",0) set_cvar_num("mp_limitteams", 1) set_cvar_num("mp_flashlight", 1) set_cvar_num("sv_restartround", 3) } public zs_off() { new maxplayers = get_maxplayers() for (new i = 1; i <= maxplayers; i++) { g_zombie[i] = false g_restart_attempt[i] = false client_cmd(i, "stopsound") } set_cvar_num("zs_enabled", 0) set_lights("#OFF") remove_task(12175) set_cvar_num("mp_autoteambalance",g_autoteam) set_cvar_num("mp_limitteams", g_limitteams) set_cvar_num("mp_flashlight", g_flashlight) set_cvar_num("sv_restartround", 3) } public GameDesc() { forward_return(FMV_STRING, mod_name) return FMRES_SUPERCEDE } public event_new_round(id) { if(hostageMap && get_pcvar_num(zomb_obj)) set_task(0.1,"move_hostages") buying = true new Float:buy_time = get_cvar_float("mp_buytime") * 60 set_task(buy_time, "buy_false", 7294) g_speed = false new freeze = get_cvar_num("mp_freezetime") set_task(float(freeze),"allow_speed") } public allow_speed() { g_speed = true new players[32], num, i get_players(players, num) for (i = 0 ; i < num; i++) if (g_zombie[players[i]]) set_user_maxspeed(players[i], (get_pcvar_float(zomb_speed))) } public logevent_round_start(id) { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED if (get_pcvar_num(zomb_nvg)) server_cmd("amx_restrict on nvgs") else server_cmd("amx_restrict off nvgs") set_task (0.5 , "team_check") set_task (5.0 , "StartMsg") if (g_zombie[id]) set_user_maxspeed(id,(get_pcvar_float(zomb_speed))) return PLUGIN_CONTINUE } public logevent_round_end() { if (task_exists(7294)) remove_task(7294) } public buy_false() buying = false public clcmd_fullupdate() return PLUGIN_HANDLED public event_restart_attempt() { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED new players[32], num get_players(players, num, "a") for (new i; i < num; i++) g_restart_attempt[players[i]] = true return PLUGIN_CONTINUE } public event_hud_reset(id) { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED if (g_restart_attempt[id]) g_restart_attempt[id] = false set_task(0.2,"event_player_spawn",id) return PLUGIN_CONTINUE } public event_player_spawn(id) { if(!is_user_alive(id)) return PLUGIN_HANDLED new CsTeams:team = cs_get_user_team(id) new CsArmorType:ArmorType = CS_ARMOR_VESTHELM if(team == CS_TEAM_T) { g_zombie[id] = true set_task(random_float(0.1,0.5), "Reset_Weapons", id) //Strips zombies if they do have guns set_user_health(id,get_pcvar_num(zomb_hp)) cs_set_user_armor(id,get_pcvar_num(zomb_ap),ArmorType) set_user_footsteps(id, 1) set_user_gravity(id,0.875) cs_set_user_money(id,0) if (g_speed) set_user_maxspeed(id,(get_pcvar_float(zomb_speed))) if (!cs_get_user_nvg(id)) { cs_set_user_nvg(id,1) engclient_cmd(id, "nightvision") } } else if(team == CS_TEAM_CT) { g_zombie[id] = false set_user_footsteps(id, 0) cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num(zomb_money)) if (get_pcvar_num(use_model)) cs_reset_user_model(id) } ShowHUD(id) return PLUGIN_CONTINUE } public fw_info(id,buffer) { if (g_zombie[id]) return FMRES_SUPERCEDE return FMRES_IGNORED } public fw_postthink(id) { if (!is_user_alive(id) || !get_pcvar_num(use_model)) return FMRES_IGNORED if (g_zombie[id]) { new szModel[33] get_pcvar_string(zomb_model, MODEL, 255) cs_get_user_model(id, szModel, 32) if (containi(szModel, MODEL) ==-1 ) { new info = engfunc(EngFunc_GetInfoKeyBuffer, id) engfunc(EngFunc_SetClientKeyValue, id, info, "model", MODEL) } } return FMRES_IGNORED } public fw_prethink(id) { if (!(pev(id, pev_button) & (IN_JUMP | IN_DUCK) == (IN_JUMP | IN_DUCK))) return FMRES_IGNORED; if (!(pev(id, pev_flags) & FL_ONGROUND) || fm_get_speed(id) < 80 || !g_leap[id] || !g_zombie[id]) return FMRES_IGNORED; static Float:velocity[3] velocity_by_aim(id, 500, velocity) velocity[2] = 300.0 set_pev(id, pev_velocity, velocity) g_leap[id] = false set_task(LEAP_CD, "leap_again", id) return FMRES_IGNORED } public leap_again(id) { g_leap[id] = true } public ShowHUD(id) { if(!is_user_alive(id)) return PLUGIN_HANDLED if(g_zombie[id]) { new hp = get_user_health(id) new ap = get_user_armor(id) set_hudmessage(255, 180, 0, 0.02, 0.90, 0, 0.0, 0.3, 0.0, 0.0) ShowSyncHudMsg(id, hudsync , "HP: %d |AP : %d", hp, ap) } set_task(0.1 , "ShowHUD" , id) return PLUGIN_CONTINUE } public event_cur_weapon(id) { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED if(!is_user_alive(id)) return PLUGIN_HANDLED new weapon = read_data(2) new clip = read_data(3) if (g_WeaponSlots[weapon] == SLOT_PRIMARY || g_WeaponSlots[weapon] == SLOT_SECONDARY) { switch (get_pcvar_num(zomb_ammo)) { case 1: { new ammo = cs_get_user_bpammo(id, weapon) if (ammo < g_MaxBPAmmo[weapon]) { cs_set_user_bpammo(id, weapon, g_MaxBPAmmo[weapon]) } } case 2: { give_ammo(id , weapon , clip) } } } if ( g_zombie[id] && g_speed ) set_user_maxspeed(id,(get_pcvar_float(zomb_speed))) if (g_zombie[id] && g_WeaponSlots[weapon] == SLOT_KNIFE) set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, "models/v_knife_zombie.mdl")) return PLUGIN_CONTINUE } public give_ammo(id , weapon , clip) { if (!is_user_alive(id)) return PLUGIN_HANDLED if (!clip) { new weapname[33] get_weaponname(weapon , weapname , 32) new wpn = -1 while((wpn = fm_find_ent_by_class(wpn , weapname)) != 0) { if(id == pev(wpn,pev_owner)) { cs_set_weapon_ammo(wpn , maxclip(weapon)) break; } } } return PLUGIN_CONTINUE } public event_status_icon(id) { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED engclient_cmd(id, "drop", "weapon_c4") set_task(0.1, "delete_c4") return PLUGIN_CONTINUE } public delete_c4() { new ent = find_ent_by_class(-1, "weaponbox") while (ent > 0) { new model[33] entity_get_string(ent, EV_SZ_model, model, 32) if (equali(model, "models/w_backpack.mdl")) { remove_entity(ent) return PLUGIN_CONTINUE } ent = find_ent_by_class(ent, "weaponbox") } return PLUGIN_CONTINUE } public Reset_Weapons(id) { if(!is_user_alive(id)) return PLUGIN_HANDLED if(g_zombie[id]) { strip_user_weapons(id) give_item(id,"weapon_knife") if (is_user_bot(id)) { return PLUGIN_HANDLED } else if (get_pcvar_num(zomb_leap)) { set_task(LEAP_CD,"cooldown_begin",id) set_hudmessage(255, 255, 255, -1.0, 0.40, 0, 6.0, 14.0) show_hudmessage(id, "%L",LANG_PLAYER,"LEAP_WAIT",floatround(LEAP_CD)) } } return PLUGIN_CONTINUE } public cooldown_begin(id) { if (!is_user_alive(id)) return PLUGIN_HANDLED if (g_zombie[id]) { set_hudmessage(255, 255, 255, -1.0, 0.40, 0, 6.0, 5.0) show_hudmessage(id, "%L",LANG_PLAYER,"LEAP_READY") g_leap[id] = true } return PLUGIN_CONTINUE } public team_check() { new players[32],num,i,id get_players(players,num,"d") for(i = 0; i < num; i++) { id = players[i] if (!g_zombie[id]) { user_silentkill(id) cs_set_user_team(id,CS_TEAM_T) } } return PLUGIN_HANDLED } public StartMsg(id) { client_print(0,print_chat,"%L",LANG_PLAYER,"WELCOME_MSG", VERSION) client_print(0,print_chat,"%L",LANG_PLAYER,"ZOMBIE_MSG", get_pcvar_num(zomb_hp), get_pcvar_num(zomb_ap), get_pcvar_num(zomb_speed)) client_print(0,print_chat,"%L",LANG_PLAYER,"HELP_MSG") } public lightning_effects() { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED if (get_pcvar_num(zomb_lightning) == 0) { set_lights("#OFF") remove_task(12175) set_task(20.0,"lightning_effects") } else if (get_pcvar_num(zomb_lightning) == 1) { set_lights("a") set_task(random_float(10.0,17.0),"thunder_clap",12175) } else if (get_pcvar_num(zomb_lightning) == 2) { set_lights("f") remove_task(12175) set_task(20.0,"lightning_effects") } return PLUGIN_CONTINUE } public thunder_clap() { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED set_lights("p") client_cmd(0,"speak ambience/thunder_clap.wav") set_task(1.25,"lightning_effects",12175) return PLUGIN_CONTINUE } public ambience_loop() { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED client_cmd(0,"spk zombie_swarm/ambience.wav") set_task(17.0,"ambience_loop") return PLUGIN_CONTINUE } public fw_Touch(pToucher, pTouched) { if(!get_pcvar_num(zomb_switch)) return FMRES_IGNORED if ( !pev_valid(pToucher) || !pev_valid(pTouched) ) return FMRES_IGNORED if ( !is_user_connected(pTouched) ) return FMRES_IGNORED if ( !g_zombie[pTouched] ) return FMRES_IGNORED new className[32] pev(pToucher, pev_classname, className, 31) if ( equal(className, "weaponbox") || equal(className, "armoury_entity" ) || equal(className, "weapon_shield" ) ) return FMRES_SUPERCEDE return FMRES_IGNORED } public fw_EmitSound(id, channel, sample[]) { if(!get_pcvar_num(zomb_switch)) return FMRES_IGNORED if ( !is_user_alive(id) || !g_zombie[id] ) return FMRES_IGNORED if ( sample[0] == 'w' && sample[1] == 'e' && sample[8] == 'k' && sample[9] == 'n' ) { switch(sample[17]) { case 'l': return FMRES_SUPERCEDE case 's', 'w': { emit_sound(id, CHAN_WEAPON, miss_zombie[random_num(0, ZOMBIE_MISS - 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM) return FMRES_SUPERCEDE } case 'b', '1', '2', '3', '4': { emit_sound(id, CHAN_WEAPON, hit_zombie[random_num(0, ZOMBIE_HIT - 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM) return FMRES_SUPERCEDE } } } else if (equal(sample,"items/nvg_on.wav") || (equal(sample,"items/nvg_off.wav"))) return FMRES_SUPERCEDE return FMRES_IGNORED } public fw_Cmd(id, handle, seed) { new impulse = get_uc(handle, UC_Impulse) if (impulse == 100 && g_zombie[id]) { set_uc(handle, UC_Impulse, 0) } return FMRES_HANDLED } public event_damage_scream(id) { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED if(!is_user_alive(id)) return PLUGIN_HANDLED if ( g_zombie[id] ) { emit_sound(id, CHAN_VOICE, pain_zombie[random_num(0, ZOMBIE_PAIN - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) } else { emit_sound(id, CHAN_VOICE, pain_human[random_num(0, HUMAN_PAIN - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) } return PLUGIN_HANDLED } public event_damage(id) { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED if(!is_user_alive(id)) return PLUGIN_HANDLED new damage = read_data(2) new weapon, hitzone new attacker = get_user_attacker(id, weapon, hitzone) new Float:Random_Float[3] for(new i = 0; i < 3; i++) Random_Float[i] = random_float(100.0, 125.0) new current_hp = get_user_health(attacker) new max_hp = get_pcvar_num(zomb_hp) new zdmg = get_pcvar_num(zomb_zdmg) new hdmg = get_pcvar_num(zomb_hdmg) current_hp += damage if (attacker > sizeof g_zombie) return PLUGIN_CONTINUE if ( g_zombie[attacker] && weapon == CSW_KNIFE ) { if (zdmg <= 0) return PLUGIN_CONTINUE else if (damage >= zdmg) Punch_View(id, Random_Float) if ( current_hp >= max_hp ) { set_user_health(attacker, max_hp) } else { set_user_health(attacker, current_hp) } } else if ( !g_zombie[attacker] && hitzone == HIT_HEAD) { if (hdmg <= 0) return PLUGIN_CONTINUE else if (damage >= hdmg) Punch_View(id, Random_Float) } return PLUGIN_HANDLED } public clcmd_say(id) { if(!get_pcvar_num(zomb_switch)) return PLUGIN_HANDLED static ARGS[15] read_args(ARGS,14) remove_quotes(ARGS) if(equali(ARGS,"/help")) { zombie_help(id) } else if (equali(ARGS,"/bm")) { if ( !is_user_alive(id) ) { client_print(id, print_center, "%L", id, "BUY_ALIVE") return PLUGIN_HANDLED } else if ( g_zombie[id] ) { client_print(id, print_center, "%L", id, "BUY_HUMAN") return PLUGIN_HANDLED } else if ( !cs_get_user_buyzone(id) ) { client_print(id, print_center, "%L", id, "BUY_BUYZONE") return PLUGIN_HANDLED } else if (!buying) { new Float:time_buy = get_cvar_float("mp_buytime") * 60 client_print(id, print_center, "%L", id, "BUY_TIME", floatround(time_buy)) return PLUGIN_HANDLED } else { show_menu(id, Keysmenu_1, "\yBuy Menu\w^n^n1. .40 Dual Elites \y($800)\w^n2. INGRAM MAC-10 \y($1400)\w^n3. IDF Defender \y($2000)\w^n4. CV-47 \y($2500)\w^n5. KREIG 552 \y($3500)\w^n6. D3/AU-1 \y($5000)\w^n^n0. Exit") } return PLUGIN_HANDLED } return PLUGIN_CONTINUE } public zombie_help(id) { new help_title[64], len static msg[2047] format(help_title,63,"%L",id,"HELP_HEADER") len = format(msg,2046,"<body bgcolor=#f5f5f5><font color=#000000><br>") len += format(msg[len],2046-len,"<center><h2>%L</h2><br><table><tr><td><p><b><font color=#000000>",id,"HELP_TITLE") len += format(msg[len],2046-len,"<h2>%L</h2>",id,"HELP_OBJECTIVE") len += format(msg[len],2046-len,"%L<br>",id,"HELP_ZOMBIE") len += format(msg[len],2046-len,"%L<br>",id,"HELP_ZOMBIE_KNIFE") len += format(msg[len],2046-len,"%L<br>",id,"HELP_ZOMBIE_NVG") if (get_pcvar_num(zomb_leap)) len += format(msg[len],2046-len,"%L<br>",id,"HELP_ZOMBIE_LEAP") if (get_pcvar_num(zomb_zdmg) >= 1) len += format(msg[len],2046-len,"%L<br>",id,"HELP_ZOMBIE_HIT",get_pcvar_num(zomb_zdmg)) len += format(msg[len],2046-len,"<h2>%L</h2>",id,"HELP_HUMAN") len += format(msg[len],2046-len,"%L<br>",id,"HELP_HUMAN_GUNS") if (get_pcvar_num(zomb_nvg)) len += format(msg[len],2046-len,"%L<br>",id,"HELP_HUMAN_NVG") if (get_pcvar_num(zomb_hdmg) >= 1) len += format(msg[len],2046-len,"%L<br>",id,"HELP_HUMAN_HIT",get_pcvar_num(zomb_hdmg)) len += format(msg[len],2046-len,"<h2>%L</h2>",id,"HELP_TIPS") len += format(msg[len],2046-len,"%L<br>",id,"HELP_TIPS_ONE") len += format(msg[len],2046-len,"%L<br>",id,"HELP_TIPS_TWO") len += format(msg[len],2046-len,"%L<br>",id,"HELP_ENJOY") len += format(msg[len],2046-len,"</b><br></td></tr></table><br>Mini_Midget</center>") show_motd(id,msg,help_title) } public buy_menu(id, key) { new money = cs_get_user_money(id) new dualcost = 800 new mac10cost = 1400 new idfcost = 2000 new akcost = 2500 new kreigcost = 3500 new D3cost = 5000 switch (key) { case 0: { if(money < dualcost) { client_print(id, print_center, "%L",id, "BUY_MONEY", dualcost) } else { drop_sec(id) cs_set_user_money(id, money - dualcost) give_item(id,"weapon_elite") } } case 1: { if(money < mac10cost) { client_print(id, print_center, "%L",id, "BUY_MONEY", mac10cost) } else { drop_prim(id) cs_set_user_money(id, money - mac10cost) give_item(id,"weapon_mac10") } } case 2: { if(money < idfcost) { client_print(id, print_center, "%L",id, "BUY_MONEY", idfcost) } else { drop_prim(id) cs_set_user_money(id, money - idfcost) give_item(id,"weapon_galil") } } case 3: { if(money < akcost) { client_print(id, print_center, "%L",id, "BUY_MONEY", akcost) } else { drop_prim(id) cs_set_user_money(id, money - akcost) give_item(id,"weapon_ak47") } } case 4: { if(money < kreigcost) { client_print(id, print_center, "%L",id, "BUY_MONEY", kreigcost) } else { drop_prim(id) cs_set_user_money(id, money - kreigcost) give_item(id,"weapon_sg552") } } case 5: { if(money < D3cost) { client_print(id, print_center, "%L",id, "BUY_MONEY", D3cost) } else { drop_prim(id) cs_set_user_money(id, money - D3cost) give_item(id,"weapon_g3sg1") } } case 9: return PLUGIN_HANDLED } return PLUGIN_HANDLED } public message_hostagepos(msg_id,msg_dest,msg_entity) { if(!get_pcvar_num(zomb_obj)) return PLUGIN_CONTINUE return PLUGIN_HANDLED; } public message_textmsg(msg_id,msg_dest,msg_entity) { if(!bombMap || !get_pcvar_num(zomb_obj)) return PLUGIN_CONTINUE; static message[16]; get_msg_arg_string(2, message, 15); if(equal(message,"#Game_bomb_drop")) return PLUGIN_HANDLED; return PLUGIN_CONTINUE; } public message_ammopickup(msg_id,msg_dest,msg_entity) { if(!bombMap || !get_pcvar_num(zomb_obj)) return PLUGIN_CONTINUE; if(get_msg_arg_int(1) == 14) // C4 return PLUGIN_HANDLED; return PLUGIN_CONTINUE; } public message_bombdrop(msg_id,msg_dest,msg_entity) { if(!get_pcvar_num(zomb_obj)) return PLUGIN_HANDLED; return PLUGIN_CONTINUE; } public message_scenario(msg_id,msg_dest,msg_entity) { if(get_msg_args() > 1 && get_pcvar_num(zomb_obj)) { new sprite[8]; get_msg_arg_string(2, sprite, 7); if(equal(sprite,"hostage")) return PLUGIN_HANDLED; } return PLUGIN_CONTINUE; } public move_hostages() { new ent; while((ent = fm_find_ent_by_class(ent,"hostage_entity")) != 0) set_pev(ent, pev_origin, Float:{8192.0,8192.0,8192.0}); } //Stocks by VEN stock drop_prim(id) { new weapons[32], num get_user_weapons(id, weapons, num) for (new i = 0; i < num; i++) { if (PRIMARY_WEAPONS_BIT_SUM & (1<<weapons[i])) { static wname[32] get_weaponname(weapons[i], wname, sizeof wname - 1) engclient_cmd(id, "drop", wname) } } } stock drop_sec(id) { new weapons[32], num get_user_weapons(id, weapons, num) for (new i = 0; i < num; i++) { if (SECONDARY_WEAPONS_BIT_SUM & (2<<weapons[i])) { static wname[32] get_weaponname(weapons[i], wname, sizeof wname - 1) engclient_cmd(id, "drop", wname) } } } //Stock by Cheap_Suit stock Punch_View(id, Float:ViewAngle[3]) { entity_set_vector(id, EV_VEC_punchangle, ViewAngle) } //Stock by v3x stock maxclip(weapon) { new ca = 0 switch (weapon) { case CSW_P228 : ca = 13 case CSW_SCOUT : ca = 10 case CSW_HEGRENADE : ca = 0 case CSW_XM1014 : ca = 7 case CSW_C4 : ca = 0 case CSW_MAC10 : ca = 30 case CSW_AUG : ca = 30 case CSW_SMOKEGRENADE : ca = 0 case CSW_ELITE : ca = 30 case CSW_FIVESEVEN : ca = 20 case CSW_UMP45 : ca = 25 case CSW_SG550 : ca = 30 case CSW_GALI : ca = 35 case CSW_FAMAS : ca = 25 case CSW_USP : ca = 12 case CSW_GLOCK18 : ca = 20 case CSW_AWP : ca = 10 case CSW_MP5NAVY : ca = 30 case CSW_M249 : ca = 100 case CSW_M3 : ca = 8 case CSW_M4A1 : ca = 30 case CSW_TMP : ca = 30 case CSW_G3SG1 : ca = 20 case CSW_FLASHBANG : ca = 0; case CSW_DEAGLE : ca = 7 case CSW_SG552 : ca = 30 case CSW_AK47 : ca = 30 case CSW_P90 : ca = 50 } return ca; } // Get entity's speed (from fakemeta_util) stock fm_get_speed(entity) { static Float:velocity[3] pev(entity, pev_velocity, velocity) return floatround(vector_length(velocity)); } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang5129\\ f0\\ fs16 \n\\ par } */ Przeczytaj cały wpis
  4. From this video https://www.youtube.com/watch?v=6WErujpPS6g Just blocks the command when the player has no class, tested quickly on my server~ I expect this to get fixed quickly but have fun. I looked and couldn't see anyone else post a fix yet. Attached Files Get Plugin or Get Source (exploit_fix.sp - 495 Bytes) exploit_fix.smx (3.5 KB) Wyświetl pełny artykuł
  5. CSGO Drop Plugin Description Items are dropped at the end of the map in CSGO. This plugin allows the item to drop during the duration of the map. You can send item infos to discord server as a notification with webhook. It shows server's name, player's name, item's name and item's price. You can set currency of the price of the item via cvar. Cvars sm_csgo_drop_tag Description: Chat tag. Do not use [] sm_csgo_drop_webhook Description: Discord webhook url. sm_csgo_drop_trydropping_time Description: How many seconds should a drop attempt be made? sm_csgo_drop_currency Description: Currency of item price sm_csgo_drop_attempts Description: Show drop attempts in chat? sm_csgo_drop_sound Description: Play a sound when the drop drops? [0 - no | 1 - to client | 2 - to everyone] sm_csgo_drop_ignore_nonsteam Description: Ignores non-steam drops Download https://github.com/Schwarper/csgodro...s/tag/csgodrop Attached Thumbnails Wyświetl pełny artykuł
  6. Hello i am new but i want pug mod but all function manual controling admins.. i want real matchmaking for my server host. Rehlds server matchmaking mod work for properly.. Which include… Forceready Warmup Teamscore transfer after 15 rounds Knife round Overtime Timeout pause option Map cutting option (just like fastcup before map cutting) Anyone make me this mod I appreciate fully… i know there are many mods but i dont like.. i want like this.. Thanks Escape* Przeczytaj cały wpis
  7. I need a resetscore plugin that costs money if the player wants to reset his score. And add the specific messages, if he has enough money or not, and so on. Przeczytaj cały wpis
  8. This plugin damages and knockback my own self which is not what I want. I want this plugin to only damage enemy team and knocking them back without any effect on yourself PHP Code: /* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <engine> #include <fakemeta> #include <hamsandwich> #define VERSION "0.1" const PEV_NADE_TYPE = pev_flTimeStepSound const NADE_TYPE_SMOKE = 4444 /// Sound Greande M24. new const g_soundexpl[] = "weapons/m24_exp1.wav" //// new cvar_removedropped, cvar_smokegrenades, g_msgScreenShake, g_msgScreenFade new g_trailSpr new const Float:RADIUS = 240.0 #define JUMP_EXP 500.0 #define JUMP_DAMAGE 20 #define PA_LOW 0.0 #define PA_HIGH 0.0 new g_index_gibs, spriteexpl public plugin_precache() { g_index_gibs = precache_model("models/rockgibs.mdl") g_trailSpr = precache_model("sprites/laserbeam.spr") spriteexpl = precache_model("sprites/fexplo1.spr") engfunc(EngFunc_PrecacheSound, g_soundexpl) } public plugin_init() { register_plugin("[M24] Grenade", VERSION, "Driss") register_forward(FM_SetModel, "fw_SetModel") RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade") /// Cvar cvar_removedropped = register_cvar("m24_remove_dropped", "0") cvar_smokegrenades = register_cvar("m24_smoke_grenades", "1") // Cvar On/off :) g_msgScreenFade = get_user_msgid("ScreenFade") g_msgScreenShake = get_user_msgid("ScreenShake") } public fw_SetModel(entity, const model[]) { // We don't care if (strlen(model) < 8) return; // Remove weapons? if (get_pcvar_float(cvar_removedropped) > 0.0) { // Get entity's classname static classname[10] pev(entity, pev_classname, classname, charsmax(classname)) // Check if it's a weapon box if (equal(classname, "weaponbox")) { // They get automatically removed when thinking set_pev(entity, pev_nextthink, get_gametime() + get_pcvar_float(cvar_removedropped)) return; } } // Narrow down our matches a bit if (model[7] != 'w' || model[8] != '_') return; // Get damage time of grenade static Float:dmgtime pev(entity, pev_dmgtime, dmgtime) // Grenade not yet thrown if (dmgtime == 0.0) return; else if (model[9] == 's' && model[10] == 'm' && get_pcvar_num(cvar_smokegrenades)) // Flare { fm_set_rendering(entity, kRenderFxGlowShell, 0, 70, 10, kRenderNormal, 16); // And a colored trail message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_BEAMFOLLOW) // TE id write_short(entity) // entity write_short(g_trailSpr) // sprite write_byte(10) // life write_byte(10) // width write_byte(0) // r write_byte(0) // g write_byte(0) // b write_byte(200) // brightness message_end() // Set grenade type on the thrown grenade entity set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_SMOKE) } } // Ham Grenade Think Forward public fw_ThinkGrenade(entity, ptd) { // Invalid entity if (!pev_valid(entity)) return HAM_IGNORED; // Get damage time of grenade static Float:dmgtime, Float:current_time pev(entity, pev_dmgtime, dmgtime) current_time = get_gametime() // Check if it's time to go off if (dmgtime > current_time) return HAM_IGNORED; // Check if it's one of our custom nades switch (pev(entity, PEV_NADE_TYPE)) { case NADE_TYPE_SMOKE: // M24 { bomb_Explode(entity) return HAM_SUPERCEDE; } } return HAM_IGNORED; } public bomb_Explode(Entity) { if(Entity < 0) return static Float:Origin[3] pev(Entity, pev_origin, Origin) heart_explode(Entity) make_metal_gibs(Entity) for(new victim = 1; victim <= get_maxplayers(); victim++) { if (!is_user_alive(victim)) continue new Float:VictimOrigin[3] pev(victim, pev_origin, VictimOrigin) new Float:Distance = get_distance_f(Origin, VictimOrigin) if(Distance <= RADIUS) { static Float:NewSpeed NewSpeed = JUMP_EXP * (1.0 - (Distance / RADIUS)) static Float:Velocity[3] get_speed_vector(Origin, VictimOrigin, NewSpeed, Velocity) set_pev(victim, pev_velocity, Velocity) new Float:fVec[3]; fVec[0] = random_float(PA_LOW , PA_HIGH); fVec[1] = random_float(PA_LOW , PA_HIGH); fVec[2] = random_float(PA_LOW , PA_HIGH); entity_set_vector(victim, EV_VEC_punchangle , fVec); message_begin(MSG_ONE , g_msgScreenShake , {0,0,0} ,victim) write_short( 1<<14 ); write_short( 1<<14 ); write_short( 1<<14 ); message_end(); message_begin(MSG_ONE_UNRELIABLE , g_msgScreenFade , {0,0,0} , victim); write_short( 1<<10 ); write_short( 1<<10 ); write_short( 1<<12 ); write_byte( 225 ); write_byte( 0 ); write_byte( 0 ); write_byte( 125 ); message_end(); set_user_takedamage(victim, JUMP_DAMAGE) } } engfunc(EngFunc_RemoveEntity, Entity) } public heart_explode(ent) { static Float:flOrigin [ 3 ] pev ( ent, pev_origin, flOrigin ) engfunc(EngFunc_EmitSound, ent, CHAN_WEAPON,g_soundexpl, 1.0, ATTN_NORM, 0, PITCH_NORM) engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0) write_byte(TE_SPRITE) engfunc(EngFunc_WriteCoord, flOrigin[0]+random_float(-5.0, 5.0)) engfunc(EngFunc_WriteCoord, flOrigin[1]+random_float(-5.0, 5.0)) engfunc(EngFunc_WriteCoord, flOrigin[2]+50.0) write_short(spriteexpl) write_byte(30) write_byte(200) message_end() } public make_metal_gibs(ent) { static Float:flOrigin[3] pev(ent, pev_origin, flOrigin) message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_BREAKMODEL) engfunc(EngFunc_WriteCoord, flOrigin[0]) engfunc(EngFunc_WriteCoord, flOrigin[1]) engfunc(EngFunc_WriteCoord, flOrigin[2]) engfunc(EngFunc_WriteCoord, 150) engfunc(EngFunc_WriteCoord, 150) engfunc(EngFunc_WriteCoord, 150) engfunc(EngFunc_WriteCoord, random_num(-50,50)) engfunc(EngFunc_WriteCoord, random_num(-50,50)) engfunc(EngFunc_WriteCoord, random_num(-50,50)) write_byte(30) write_short(g_index_gibs) write_byte(random_num(20, 30)) write_byte(20) write_byte(0x04) //0x02 - metal message_end() } stock 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 } stock set_user_takedamage(index, damage) { if(!is_user_alive(index)) return new vec[3] FVecIVec(get_target_origin_f(index), vec) message_begin(MSG_ONE, get_user_msgid("Damage"), _, index) write_byte(0) write_byte(damage) write_long(DMG_CRUSH) write_coord(vec[0]) write_coord(vec[1]) write_coord(vec[2]) message_end() if(pev(index, pev_health) - 20.0 <= 0) ExecuteHamB(Ham_Killed, index, index, 1) else ExecuteHamB(Ham_TakeDamage, index, 0, index, float(damage), DMG_BLAST) } stock Float:get_target_origin_f(index) { new Float:orig[3] pev(index, pev_origin, orig) if(index > get_maxplayers()) { new Float:mins[3], Float:maxs[3] pev(index, pev_mins, mins) pev(index, pev_maxs, maxs) if(!mins[2]) orig[2] += maxs[2] / 2 } return orig } // Set entity's rendering type (from fakemeta_util) stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) { static Float:color[3] color[0] = float(r) color[1] = float(g) color[2] = float(b) set_pev(entity, pev_renderfx, fx) set_pev(entity, pev_rendercolor, color) set_pev(entity, pev_rendermode, render) set_pev(entity, pev_renderamt, float(amount)) } /// Thanks (ArabicMan) Przeczytaj cały wpis
  9. Hi, i use the script, but i need black screen or player freeze and dont join team While logged into the system. How feasible is this for someone? Can someone rewrite the code? https://pastebin.com/cXBp6hiL Przeczytaj cały wpis
  10. - I'm having a bug that breaks survivors default speed to faster speed. - In my server my special infected have much faster run speed and when finishing the round. As playing the survivor round. Then I have gain insane speed from the special infected that i played as, In the end round scoreboard. Or When the round changes to Infected > To > Survivors. Is there a way to limit survivors run speed with a command? Przeczytaj cały wpis
  11. Hello, for a long time I have been going through a problem in ZP 5.0 that the game mode does not start if 2 players are on the same team. I need a plugin that detects when it has 2 players on the server (on the same team or not) and performs a sv_restart 1 for autobalance separates them. I really need this... Przeczytaj cały wpis
  12. Hello i got this: Code: L 02/20/2023 - 16:12:18: [Map_Spawns_Editor.amxx] performance issue. Function plugin_precache executed more than 11.8ms. L 02/20/2023 - 16:12:18: [AQS.amxx] performance issue. Function plugin_precache executed more than 1.2ms. L 02/20/2023 - 16:12:18: [zp50_class_zombie.amxx] performance issue. Function plugin_precache executed more than 3.5ms. L 02/20/2023 - 16:12:18: [zp50_class_human.amxx] performance issue. Function plugin_precache executed more than 1.1ms. L 02/20/2023 - 16:12:18: [zp50_class_nemesis.amxx] performance issue. Function plugin_precache executed more than 10.1ms. L 02/20/2023 - 16:12:18: [zp50_class_survivor.amxx] performance issue. Function plugin_precache executed more than 5.4ms. L 02/20/2023 - 16:12:18: [zp50_class_zombie.amxx] performance issue. Function native_class_zombie_register executed more than 5.7ms. L 02/20/2023 - 16:12:18: [zp50_class_zombie_classic.amxx] performance issue. Function plugin_precache executed more than 5.7ms. L 02/20/2023 - 16:12:18: [zp50_class_zombie.amxx] performance issue. Function native_class_zombie_register executed more than 3.1ms. L 02/20/2023 - 16:12:18: [zp50_zp43_compat.amxx] performance issue. Function native_register_zombie_class executed more than 3.2ms. L 02/20/2023 - 16:12:18: [zp_zlongjump.amxx] performance issue. Function plugin_precache executed more than 3.2ms. L 02/20/2023 - 16:12:18: [zp50_class_zombie.amxx] performance issue. Function native_class_zombie_register executed more than 2.5ms. L 02/20/2023 - 16:12:18: [zp50_zp43_compat.amxx] performance issue. Function native_register_zombie_class executed more than 2.6ms. L 02/20/2023 - 16:12:18: [jumper_zombie_v2.amxx] performance issue. Function plugin_precache executed more than 2.6ms. L 02/20/2023 - 16:12:18: [zp50_class_zombie.amxx] performance issue. Function native_class_zombie_register executed more than 3.0ms. L 02/20/2023 - 16:12:18: [zp50_zp43_compat.amxx] performance issue. Function native_register_zombie_class executed more than 3.0ms. L 02/20/2023 - 16:12:18: [zp50_class_zombie_heavy.amxx] performance issue. Function plugin_precache executed more than 3.0ms. L 02/20/2023 - 16:12:18: [zp50_class_human.amxx] performance issue. Function native_class_human_register executed more than 20.7ms. L 02/20/2023 - 16:12:18: [zp50_class_human_classic.amxx] performance issue. Function plugin_precache executed more than 20.8ms. L 02/20/2023 - 16:12:18: [zp50_pipe_bomb.amxx] performance issue. Function plugin_precache executed more than 4.0ms. L 02/20/2023 - 16:12:18: [zp50_arx_160.amxx] performance issue. Function plugin_precache executed more than 2.5ms. L 02/20/2023 - 16:12:18: [zp50_modern_m4a1.amxx] performance issue. Function plugin_precache executed more than 20.3ms. L 02/20/2023 - 16:12:18: [zp_weapon_chainsaw.amxx] performance issue. Function plugin_precache executed more than 2.7ms. L 02/20/2023 - 16:12:18: [zp_extra_balrog_ethereal.amxx] performance issue. Function plugin_precache executed more than 4.0ms. L 02/20/2023 - 16:12:18: [zp_extra_pkm_th1.amxx] performance issue. Function plugin_precache executed more than 5.9ms. L 02/20/2023 - 16:12:18: [zp_extra_thanatos7.amxx] performance issue. Function plugin_precache executed more than 4.7ms. L 02/20/2023 - 16:12:18: [zp50_xm1014_skull.amxx] performance issue. Function plugin_precache executed more than 2.4ms. L 02/20/2023 - 16:12:18: [zp_extra_turbulent7.amxx] performance issue. Function plugin_precache executed more than 6.4ms. L 02/20/2023 - 16:12:18: [zp50_golden_ak47.amxx] performance issue. Function plugin_precache executed more than 9.3ms. L 02/20/2023 - 16:12:18: [zp50_charger.amxx] performance issue. Function plugin_precache executed more than 7.7ms. L 02/20/2023 - 16:12:18: [zp50_psg1.amxx] performance issue. Function plugin_precache executed more than 2.5ms. L 02/20/2023 - 16:12:18: [zp50_aw50.amxx] performance issue. Function plugin_precache executed more than 9.4ms. L 02/20/2023 - 16:12:18: [zp50_sg500_skull.amxx] performance issue. Function plugin_precache executed more than 2.6ms. L 02/20/2023 - 16:12:18: [zp50_death_ak47.amxx] performance issue. Function plugin_precache executed more than 6.1ms. L 02/20/2023 - 16:12:18: [zp50_fire_m4a1.amxx] performance issue. Function plugin_precache executed more than 3.5ms. L 02/20/2023 - 16:12:18: [zp_extra_minigun.amxx] performance issue. Function plugin_precache executed more than 2.2ms. L 02/20/2023 - 16:12:18: [zp_extension_nrl.amxx] performance issue. Function plugin_precache executed more than 4.5ms. L 02/20/2023 - 16:12:18: [zp_extra_conc.amxx] performance issue. Function plugin_precache executed more than 3.4ms. L 02/20/2023 - 16:12:18: [zp50_admin_models.amxx] performance issue. Function plugin_precache executed more than 16.0ms. L 02/20/2023 - 16:12:18: [zp50_knockback.amxx] performance issue. Function plugin_precache executed more than 1.3ms. L 02/20/2023 - 16:12:18: [zp50_objective_remover.amxx] performance issue. Function plugin_precache executed more than 2.2ms. L 02/20/2023 - 16:12:18: [zp50_grenade_fire.amxx] performance issue. Function plugin_precache executed more than 4.8ms. L 02/20/2023 - 16:12:18: [zp50_grenade_frost.amxx] performance issue. Function plugin_precache executed more than 6.3ms. L 02/20/2023 - 16:12:18: [ze_frostnade_effects.amxx] performance issue. Function plugin_precache executed more than 1.8ms. L 02/20/2023 - 16:12:19: [zp50_core.amxx] performance issue. Function plugin_init executed more than 3.8ms.What is this? Przeczytaj cały wpis
  13. I have server with shop plugins i want to block the gravity the first round someone can help me I post here the lines of my shop plugins PHP Code: #include <amxmodx> #include <cstrike> #include <fun> #include <hamsandwich> #include <fakemeta> #define VERSION "5.4" #define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers ) #define MAX_PLAYERS 32 #define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame #define FURIEN_VIP ADMIN_RESERVATION new g_iMaxPlayers new const g_ModelSuperKnife[] = "models/x_knife_skin.mdl" new const g_ModelSuperM4A1[] = "models/v_golden_m4a1.mdl" new bool:g_HasSuperKnife[MAX_PLAYERS+1] new bool:g_HasSuperM4A1[MAX_PLAYERS+1] new bool:g_HasSpeed[MAX_PLAYERS+1] new bool:g_HasGravityT[MAX_PLAYERS+1] new bool:g_HasGravityCt[MAX_PLAYERS+1] enum _:ItemsT { Item_SuperKnife_T = 1, Item_Gravity_T, Item_Speed } enum _:ItemsCT { Item_SuperKnife_Ct = 1, Item_Gravity_Ct, Item_M249, Item_G3SG1, Item_He, Item_Flash, Item_SuperM4A1 } new g_pCvarTCost[ItemsT], g_pCvarCTCost[ItemsCT] new g_pCvarQuantityGravityT, g_pCvarQuantityGravityCt new g_pCvarQuantitySpeed public plugin_init() { register_plugin("BaseBuilder Shop", VERSION, "Ace67") register_clcmd("say /shop", "ShowShop") register_clcmd("say_team /shop", "ShowShop") register_clcmd("say shop", "ShowShop"); register_clcmd("say_team shop", "ShowShop"); g_pCvarTCost[Item_SuperKnife_T] = register_cvar("shopbb_cost_superknife_t", "10000") g_pCvarTCost[Item_Gravity_T] = register_cvar("shopbb_cost_gravity_t", "8000") g_pCvarTCost[Item_Speed] = register_cvar("shopbb_cost_speed", "6000") g_pCvarCTCost[Item_SuperKnife_Ct] = register_cvar("shopbb_cost_superknife_ct", "800") g_pCvarCTCost[Item_Gravity_Ct] = register_cvar("shopbb_cost_gravity_ct", "8000") g_pCvarCTCost[Item_M249] = register_cvar("shopbb_cost_m249", "7000") g_pCvarCTCost[Item_G3SG1] = register_cvar("shopbb_cost_g3sg1", "8000") g_pCvarCTCost[Item_He] = register_cvar("shopbb_cost_he", "12000") g_pCvarCTCost[Item_Flash] = register_cvar("shopbb_cost_flash", "2000") g_pCvarCTCost[Item_SuperM4A1] = register_cvar("shopbb_cost_SuperM4A1", "9000") g_pCvarQuantityGravityT = register_cvar("shopbb_quantity_gravity_t", "0.125") g_pCvarQuantityGravityCt = register_cvar("shopbb_quantity_gravity_ct", "0.125") g_pCvarQuantitySpeed = register_cvar("shopbb_quantity_speed", "400.0") RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1) RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre") RegisterHam(Ham_Item_Deploy, "weapon_knife", "ham_ItemDeploy_Post", 1) RegisterHam(Ham_Item_Deploy, "weapon_m4a1", "ham_ItemDeploy_Post_M4", 1); RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Player_ResetMaxSpeed", 1) g_iMaxPlayers = get_maxplayers() set_cvar_num("sv_maxspeed", 999) } public plugin_precache() { precache_model(g_ModelSuperKnife) precache_model(g_ModelSuperM4A1) } public Player_ResetMaxSpeed( id ) { if ( is_user_alive ( id ) ) { if ( get_user_maxspeed(id) != -1.0 ) { if ( g_HasSpeed[id] ) { set_user_maxspeed(id, 600.0) } } } } public client_connect( id ) { client_cmd(id, "cl_forwardspeed 999;cl_sidespeed 999;cl_backspeed 999") g_HasSuperKnife[id] = false g_HasSuperM4A1[id] = false g_HasSpeed[id] = false; } public client_disconnect(id) { g_HasSuperKnife[id] = false; g_HasSuperM4A1[id] = false; } public ShowShop(id) { if ( is_user_alive(id) ) { new Text[32] if ( cs_get_user_team(id) == CS_TEAM_T ) { new menu = menu_create ("\w^x03[\r ZOMBIE SHOP \w]", "ShopT") formatex(Text, charsmax(Text), "\wSuperKnife \y[\r%d $\y]", get_pcvar_num(g_pCvarTCost[Item_SuperKnife_T])) menu_additem(menu, Text, "1") formatex(Text, charsmax(Text), "\wLow Gravity \y[\r%d $\y]", get_pcvar_num(g_pCvarTCost[Item_Gravity_T])) menu_additem(menu, Text, "2") formatex(Text, charsmax(Text), "\wFast Speed \y[\r%d $\y]", get_pcvar_num(g_pCvarTCost[Item_Speed])) menu_additem(menu, Text, "3") menu_setprop(menu, MPROP_EXITNAME, "Quit") menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu) } else { new menu2 = menu_create ("\w^x03[\r HUMAN SHOP \w]", "ShopCt") formatex(Text, charsmax(Text), "\wSuperKnife \y[\r%d $\y]", get_pcvar_num(g_pCvarCTCost[Item_SuperKnife_Ct])) menu_additem(menu2, Text, "1") formatex(Text, charsmax(Text), "\wLow Gravity \y[\r%d $\y]", get_pcvar_num(g_pCvarCTCost[Item_Gravity_Ct])) menu_additem(menu2, Text, "2") formatex(Text, charsmax(Text), "\wM249 \y[\r%d $\y]", get_pcvar_num(g_pCvarCTCost[Item_M249])) menu_additem(menu2, Text, "3") formatex(Text, charsmax(Text), "\wG3SG1 \y[\r%d $\y]", get_pcvar_num(g_pCvarCTCost[Item_G3SG1])) menu_additem(menu2, Text, "4") formatex(Text, charsmax(Text), "\wHE Grenade \y[\r%d $\y]", get_pcvar_num(g_pCvarCTCost[Item_He])) menu_additem(menu2, Text, "5") formatex(Text, charsmax(Text), "\wFlashbang \y[\r%d $\y]", get_pcvar_num(g_pCvarCTCost[Item_Flash])) menu_additem(menu2, Text, "6") formatex(Text, charsmax(Text), "\wS.M4A1 (VIP) \y[\r%d $\y]", get_pcvar_num(g_pCvarCTCost[Item_SuperM4A1])) menu_additem(menu2, Text, "7") menu_setprop(menu2, MPROP_EXITNAME, "Quit") menu_setprop(menu2, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu2) } } else { client_print(id, print_chat, "You must be alive for buy !") } } public ShopT(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } if ( !is_user_alive(id) ) { client_print(id, print_chat, "You must be alive for buy !") menu_destroy(menu) return PLUGIN_HANDLED } new info[3] new access, callback menu_item_getinfo(menu, item, access, info, 2, _, _, callback) new key = str_to_num(info) new iNewMoney = cs_get_user_money(id) - get_pcvar_num(g_pCvarTCost[key]) if ( iNewMoney < 0 ) { client_print(id, print_chat, "You don't have enough money !") menu_destroy(menu) return PLUGIN_HANDLED } else { switch(key) { case Item_SuperKnife_T: { if ( g_HasSuperKnife[id] ) { client_print(id, print_chat, "You have already the SuperKnife !") menu_destroy(menu) return PLUGIN_HANDLED } give_item(id, "weapon_knife") set_pev(id, pev_viewmodel2, "models/x_knife_skin.mdl") cs_set_user_money(id, iNewMoney, 1) g_HasSuperKnife[id] = true; client_print(id, print_chat, "You have bought SuperKnife !") } case Item_Gravity_T: { if ( g_HasGravityT[id] ) { client_print(id, print_chat, "You have already Low Gravity !") menu_destroy(menu) return PLUGIN_HANDLED } cs_set_user_money(id, iNewMoney, 1) set_user_gravity(id, get_pcvar_float(g_pCvarQuantityGravityT) ) client_print(id, print_chat, "You have bought Low Gravity !") g_HasGravityT[id] = true; } case Item_Speed: { if ( g_HasSpeed[id] ) { client_print(id, print_chat, "You have already Fast Speed !") menu_destroy(menu) return PLUGIN_HANDLED } cs_set_user_money(id, iNewMoney, 1) set_user_maxspeed(id,get_pcvar_float(g_pCvarQuantitySpeed) ) g_HasSpeed[id] = true; client_print(id, print_chat, "You have bought Fast Speed !") } } } menu_destroy(menu) return PLUGIN_HANDLED } public ShopCt(id, menu2, item) { if (item == MENU_EXIT) { menu_destroy(menu2) return PLUGIN_HANDLED } if ( !is_user_alive(id) ) { client_print(id, print_chat, "You must be alive !") menu_destroy(menu2) return PLUGIN_HANDLED } new info[3] new access, callback menu_item_getinfo(menu2, item, access, info, 2, _, _, callback) new key = str_to_num(info) new iNewMoney = cs_get_user_money(id) - get_pcvar_num(g_pCvarCTCost[key]) if ( iNewMoney < 0 ) { client_print(id, print_chat, "You don't have enough money ! !") menu_destroy(menu2) return PLUGIN_HANDLED } else { switch(key) { case Item_SuperKnife_Ct: { if ( g_HasSuperKnife[id] ) { client_print(id, print_chat, "You have already the SuperKnife !") menu_destroy(menu2) return PLUGIN_HANDLED } cs_set_user_money(id, iNewMoney, 1) g_HasSuperKnife[id] = true; client_print(id, print_chat, "You have bought SuperKnife !") } case Item_Gravity_Ct: { if ( g_HasGravityCt[id] ) { client_print(id, print_chat, "You have already Low Gravity !") menu_destroy(menu2) return PLUGIN_HANDLED } cs_set_user_money(id, iNewMoney, 1) set_user_gravity(id, get_pcvar_float(g_pCvarQuantityGravityCt)) client_print(id, print_chat, "You have bought Low Gravity !") g_HasGravityCt[id] = true; } case Item_M249: { if ( user_has_weapon(id, CSW_M249) ) { client_print(id, print_chat, "You have already M249 !") menu_destroy(menu2) return PLUGIN_HANDLED } cs_set_user_money(id, iNewMoney, 1) cs_set_user_bpammo( id, CSW_M249, 200 ) give_item(id, "weapon_m249") client_print(id, print_chat, "You have bought M249 !") } case Item_G3SG1: { if ( user_has_weapon(id, CSW_G3SG1) ) { client_print(id, print_chat, "You have already G3SG1 !") menu_destroy(menu2) return PLUGIN_HANDLED } cs_set_user_money(id, iNewMoney, 1) cs_set_user_bpammo( id, CSW_G3SG1, 200 ) give_item(id, "weapon_g3sg1") client_print(id, print_chat, "You have bought G3SG1 !") } case Item_He: { if ( user_has_weapon(id, CSW_HEGRENADE) ) { client_print(id, print_chat, "You have already Grenade !") menu_destroy(menu2) return PLUGIN_HANDLED } cs_set_user_money(id, iNewMoney, 1) give_item(id, "weapon_hegrenade") client_print(id, print_chat, "You have bought HeGrenade !") } case Item_Flash: { if ( cs_get_user_bpammo(id, CSW_FLASHBANG) == 2 ) { client_print(id, print_chat, "You have already 2 flashbangs !") menu_destroy(menu2) return PLUGIN_HANDLED } cs_set_user_money(id, iNewMoney, 1) give_item(id, "weapon_flashbang") client_print(id, print_chat, "You have bought Flashbang !") } case Item_SuperM4A1: { if(!(get_user_flags(id) & FURIEN_VIP)) { if ( g_HasSuperM4A1[id] ) client_print(id, print_chat, "You have already S.M4A1 !") menu_destroy(menu2) return PLUGIN_HANDLED } cs_set_user_money(id, iNewMoney, 1) cs_set_user_bpammo( id, CSW_M4A1, 200 ) give_item(id, "weapon_m4a1") client_print(id, print_chat, "You have bought S.M4A1 !") g_HasSuperM4A1[id] = true; } } } menu_destroy(menu2) return PLUGIN_HANDLED } public Player_Spawn_Post(id) { if ( is_user_alive ( id ) ) { client_print(id, print_chat, "Say /shop in the chat for buy an item !") if ( g_HasSuperKnife[id] && get_user_weapon(id) == CSW_KNIFE ) if ( g_HasSuperM4A1[id] && get_user_weapon(id) == CSW_M4A1 ) { set_pev(id, pev_viewmodel2, g_ModelSuperKnife) set_pev(id, pev_viewmodel2, g_ModelSuperM4A1) } g_HasSuperKnife[id] = false g_HasSuperM4A1[id] = false g_HasSpeed[id] = false } } public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits) { if ( IsPlayer(attacker) && g_HasSuperKnife[attacker] && is_user_alive(attacker) && inflictor == attacker && get_user_weapon(attacker) == CSW_KNIFE ) { SetHamParamFloat( 4, damage * 154.0 ) } if ( IsPlayer(attacker) && g_HasSuperM4A1[attacker] && is_user_alive(attacker) && inflictor == attacker && get_user_weapon(attacker) == CSW_M4A1 ) { SetHamParamFloat( 4, damage * 3.5 ); } } public ham_ItemDeploy_Post(weapon_ent) { static owner owner = get_pdata_cbase(weapon_ent, 41, 4) if ( is_user_alive(owner) && g_HasSuperKnife[owner] ) { set_pev(owner, pev_viewmodel2, g_ModelSuperKnife); } } public ham_ItemDeploy_Post_M4(weapon_ent) { static owner; owner = get_pdata_cbase(weapon_ent, 41, 4); if ( is_user_alive(owner) && g_HasSuperM4A1[owner] ) { set_pev(owner, pev_viewmodel2, g_ModelSuperM4A1); } } Przeczytaj cały wpis
  14. Not sure if a plugin like this exists but I've seen on some servers a random player name in the top 40 rank on the server is shown on the screen during game play. It's a small message usually in green. Not sure what this plugin is called. Anyone know the name of it and if it can be adjusted to display a random name that ranks in the top 15 instead of the top 40? Przeczytaj cały wpis
  15. Remake of Store Plugin Description: I wanted to remake it because it's an old and favorite plugin. I've tested it many times but still if you find a bug I'll be here to fix it. If you have any ideas, please don't forget to let me know. There was a problem about memory stack. I used #pragma dynamic 999999. I'll find a way to fix this. I don't know if this is a problem. If you are using this plugin for the first time, download models and materials from original post. Original post: https://forums.alliedmods.net/showthread.php?t=276677 For name tags, name colors and message colors: https://forums.alliedmods.net/showthread.php?t=286913 Download https://github.com/Schwarper/store-p...ases/tag/store Wyświetl pełny artykuł
  16. hey there, is there any plugin (cuz i haven;t found) that if there are more than lets say, 20 players on server, on a new start round it choose 2 terr, not 1? i would be wonderful if it works like >10 players (1 terr), >20 players (2 terr), >30 players (3 terr) thank you! Przeczytaj cały wpis
  17. All Class Revive Marker Revive your fallen teammates like the medic from their revive markers just by pressing R. Check the github for more info, a video demonstrating it and the compiled plugin ready to be downloaded. Github Repository Wyświetl pełny artykuł
  18. Hey, i'm looking for blockmaker with surf blocks. I have one created by Albertd but there is a lot of bugs. Don't know if there is any other bm like that on the internet right now, but I hope there is.. a better one.. :D Thanks for help! Przeczytaj cały wpis
  19. I would like to detect if some player is shooting over another player's head. I thought to create some invisible cube with specific dimensions and place it a few units over player's head. And detect when another player hit this cube with a gun. The problem is, I dont know how to create it. And how to make it "following" the player it's assigned to? Or maybe you guys have better idea? Przeczytaj cały wpis
  20. Hello, I need help with this "Zombie Health Left" Plugin. Instead of showing the actual Health it just shows "s%" as the zombie health. Why is that so? #include <amxmodx> #include <zombieplague> public plugin_init() { register_plugin("ZP: Show Victim HP On Damage", "1.0", "<VeCo>") register_event("Damage","event_damage","b","2 !0","3=0","4!0") } public event_damage(id) { new killer = get_user_attacker(id) if(zp_get_user_zombie(id)) client_print(killer,print_center,"HP: %i",get_user_health(id)) } Przeczytaj cały wpis
  21. Description Creates a colored beam ring on player jump. Found a similar plugin in a community server once, but since I couldn't find the author source code, I made a similar one. Features Allow clients to configure their color by menu or RGB args. (stored in cookies) Allow configuring which teams should trigger the jump beam ring. Allow configuring the beam model/color/alpha/duration/start & end radius/width/amplitude. Beam only transmitted to teammates. Cvars A configuration file named "l4d_jump_beamring.cfg" will automatically be created for you upon the first run in the "\cfg\sourcemod\" folder. PHP Code: // Beam alpha transparency. // 0 = Invisible, 255 = Fully Visible. // - // Default: "255" // Minimum: "0.000000" // Maximum: "255.000000" l4d_jump_beamring_alpha "255" // Beam amplitude. // - // Default: "0.0" // Minimum: "0.000000" l4d_jump_beamring_amplitude "0.0" // Beam color. // Use "random" for random colors. // Use three values between 0-255 separated by spaces ("<0-255> <0-255> <0-255>"). // - // Default: "255 255 0" l4d_jump_beamring_color "255 255 0" // Beam duration (seconds). // - // Default: "1.0" // Minimum: "0.100000" l4d_jump_beamring_duration "1.0" // Enable/Disable the plugin. // 0 = Disable, 1 = Enable. // - // Default: "1" // Minimum: "0.000000" // Maximum: "1.000000" l4d_jump_beamring_enable "1" // Beam end radius. // - // Default: "70.0" // Minimum: "0.000000" l4d_jump_beamring_end_radius "70.0" // Beam model. // - // Default: "sprites/laserbeam.vmt" l4d_jump_beamring_model "sprites/laserbeam.vmt" // Beam start radius. // - // Default: "35.0" // Minimum: "0.000000" l4d_jump_beamring_start_radius "35.0" // Which teams can trigger the beam. // 0 = NONE, 1 = SURVIVOR, 2 = INFECTED, 4 = SPECTATOR, 8 = HOLDOUT. // Add numbers greater than 0 for multiple options. // Example: "3", enables for SURVIVOR and INFECTED. // - // Default: "1" // Minimum: "0.000000" // Maximum: "15.000000" l4d_jump_beamring_team "1" // Beam width. // - // Default: "1.0" // Minimum: "0.000000" l4d_jump_beamring_width "1.0" Public Commands sm_jumpcolor => Open a menu to client select their jump beam ring color. Usage: sm_jumpcolor <255> <255> <255> Admin Commands sm_print_cvars_l4d_jump_beamring => Print the plugin related cvars and their respective values to the console. (z flag required) Change Log Spoiler 1.0.1 (12-February-2022) - Public release. 1.0.0 (20-December-2022) - Private release. To-Do Better multi-language menu support. Post Reply Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome. Thank you! AsphyxiaJLSA - for requesting. Silvers - for the color menu snippet from [L4D & L4D2] Flashlight plugin. Installation Put the "l4d_jump_beamring.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder. Attached Files Get Plugin or Get Source (l4d_jump_beamring.sp - 22.1 KB) Wyświetl pełny artykuł
  22. i use Sourcemod and metamod. but i want to use this plugin - CustomRounds when i compile i get error and i don't get a compiled plugin source: https://github.com/SomethingFromSomewhere/Custom-Rounds please help in screenshot log of compile.exe Attached Thumbnails Wyświetl pełny artykuł
  23. This plugin simply reenables player collision Original plugin version by BenSib https://dodsplugins.mtxserv.fr/viewtopic.php?f=6&t=24 Fixed compilation errors for sourcemod v1.11 or 1.12 Attached Files dod_collision.smx (3.1 KB) Get Plugin or Get Source (dod_collision.sp - 830 Bytes) Wyświetl pełny artykuł
  24. The plugin allows you to set the movement speed for different types of weapons. Designed for CS:S and CS:GO, but it will probably work in other games, but at the beginning of the round you will have to switch between weapon slots every time. Will conflict with other plugins that change the movement speed by changing the "m_flLaggedMovementValue" parameter. The speed is specified as a multiplier of the standard movement speed (the number must be greater than 0.0, otherwise the value will be ignored). The name of the weapon is given as its class without the "weapon_" prefix. Attached Files weapons_movement_speed 1.0.1_11.02.2023.zip (1.9 KB) Wyświetl pełny artykuł
  25. This plugins display the hitbox touched. Possibility to have a sound on headshot (read the .sp, make the change and recompile) (deactivated by default). First plugin version by Feuersturm https://dodsplugins.mtxserv.fr/viewtopic.php?f=6&t=95 Fixed compilation errors for sourcemod v1.11 or 1.12 Attached Files dod_hitinfo.smx (5.1 KB) Get Plugin or Get Source (dod_hitinfo.sp - 3.6 KB) Wyświetl pełny artykuł
×
×
  • Dodaj nową pozycję...