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

    28682
  • Dołączył

  • Ostatnia wizyta

    nigdy
  • Wygrane w rankingu

    11

Treść opublikowana przez MYGO.pl

  1. Hi, It's a plugin that prevents bots (RCBOT2) making Team Killing. You feel the impact of bullets, you are slowed down but you no longer lose life. Sorry for my english, but i'm french. ;-) Attached Files Get Plugin or Get Source (dod_anti_bot_tk.sp - 2.1 KB) Wyświetl pełny artykuł
  2. hi, need plugin for switch all dead CT to T on last round before change map for basebuilder Przeczytaj cały wpis
  3. Hello everyone so basicly iam loking for plugin that when someone died when he type /ghost he will return from death and he can look around the map and moving like alive players but he cant prees buttons or holding weapons and he can only attack the other alive dead players and alive players can see them or touch them and when one tr stil alive they will all return to death Przeczytaj cały wpis
  4. . Enforce Gametypes (l4d_enforce_gametypes) by Mystik Spiral Objective: Prevent client using mm_dedicated_force_servers to override sv_gametypes on server. If mp_gamemode from incoming connection is not included in sv_gametypes, reject client connection. If sv_gametypes is not set in your server.cfg file, it should default to: coop,realism,survival,versus,scavenge,dash,ho ldout,shootzones Description and options: My server has sv_gametypes set to "coop,realism,nightmaredifficulty", but I was seeing other active game modes. I discovered that clients were setting mm_dedicated_force_servers to my server IP address and port, then connecting from lobby. Apparently, mm_dedicated_force_servers overrides the value for sv_gametypes. This simple plugin checks the value of mp_gamemode (set during lobby reservation) and compares it to the values in sv_gametypes... if there is no match the client connections are rejected. This plugin does not have any configurable console variables. Notes: This plugin does everything I expect it to do and I do not plan to add any new features. However, if you use this and find any bugs, please let me know and I will do my best to correct them. I have only tested this with L4D2, but I expect it should also work with L4D1. It will probably work with any game that uses sv_gametypes and mp_gamemode. Version history: Code: 25-Apr-2023 v1.0 - Initial releaseInstallation: Place the l4d_enforce_gametypes.smx file in the SourceMod "plugins" directory. Attached Files Get Plugin or Get Source (l4d_enforce_gametypes.sp - 3.7 KB) Wyświetl pełny artykuł
  5. https://forums.alliedmods.net/showthread.php?t=283342 ^^^ This is the original thread with the plugin I have right now. You see, whenever the aimbot is on, it tries to headshot with every weapon, including the AWP. I simply request a modification to the plugin that makes the aimbot aim for the chest (where the AWP one-shots) rather than the head. Much thanks. <3 Przeczytaj cały wpis
  6. I'm using this combo sounds plugin but I keep getting this error in console and only the knife sounds are audible in the server. Any ideas? [AMXX] Run time error 25: parameter error [AMXX] [0] ultimate_sounds.sma::death_msg (line 366) String formatted incorrectly - parameter 10 (total 9) Line 366 would be this one: PHP Code: ShowSyncHudMsg(0, gmsgHudSync, "%L", LANG_PLAYER, messageshp[ random_num(0,MESSAGESHP-1) ],ite ,ict ,name,get_user_health(last)) PHP Code: /******************************************************************************** * AMX Mod X script. * * Ultimate Sounds (Ultimate_Sounds.sma) * Copyright (C) 2006-2008 Bmann_420 / Dizzy / Hoboman * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * In addition, as a special exception, the author gives permission to * link the code of this program with the Half-Life Game Engine ("HL * Engine") and Modified Game Libraries ("MODs") developed by Valve, * L.L.C ("Valve"). You must obey the GNU General Public License in all * respects for all of the code used other than the HL Engine and MODs * from Valve. If you modify this file, you may extend this exception * to your version of the file, but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from your * version. * ********************************************************************************* * * AMXX Ultimate Sounds Vers. 1.7 * Last Update: 1/26/2007 * * by Dizzy / Bmann_420 & Hoboman * Link: http://forums.alliedmods.net/showthread.php?t=7342 * * ********************************************************************************* * * /////////////////////////////////////////////////// * // AMXMOD[X] // * // ::Ultimate sounds:: // * // Origional: by Hephaistos // * // Ported by: Dizzy // * // Edited by: Hoboman, bmann_420 // * // // * // cvar: // * // streak_mode < flags > // * // "a" - messages // * // "b" - sounds // * // // * // knife_mode < flags > // * // "a" - messages // * // "b" - sounds // * // // * // hs_mode < flags > // * // "a" - messages // * // "b" - sounds // * // // * // lastman_mode < flags > // * // "a" - messages // * // "b" - hp // * // "c" - sounds // * /////////////////////////////////////////////////// * ********************************************************************************* */ // Plugin Info new const PLUGIN[] = "Ultimate Sounds" new const VERSION[] = "1.8" new const AUTHOR[] = "Dizzy / Bmann_420" // Includes #include <amxmodx> //Defines #define KNIFEMESSAGES 5 #define MESSAGESNOHP 5 #define MESSAGESHP 5 #define LEVELS 12 //Pcvars new streak_mode, knife_mode, hs_mode, lastman_mode new gmsgHudSync new kills[33] = {0,...}; new deaths[33] = {0,...}; new alone_ann = 0 new levels[12] = {4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 20, 25}; //Streak Sounds new stksounds[12][] = { "kisounds/supercombo", "kisounds/hypercombo", "kisounds/brutalcombo", "kisounds/mastercombo", "kisounds/awesomecombo", "kisounds/blastercombo", "kisounds/monstercombo", "kisounds/kingcombo", "kisounds/killercombo", "kisounds/ultracombo", "kisounds/ultimatecombo", "kisounds/zkcombo" } new stkmessages[12][] = { "%s: Super Combo!", "%s: Hyper Combo!", "%s: Brutal Combo!", "%s: Master Combo!", "%s: Awesome Combo!", "%s: Blaster Combo!", "%s: Monster Combo!", "%s: King Combo!", "%s: Killer Combo!", "%s: Ultra Combo!", "%s: Ultimate Combo!", "%s: Monster Kill!" } new knifemessages[KNIFEMESSAGES][] = { "KNIFE_MSG_1", "KNIFE_MSG_2", "KNIFE_MSG_3", "KNIFE_MSG_4", "KNIFE_MSG_5" } new messagesnohp[MESSAGESNOHP][] = { "NOHP_MSG_1", "NOHP_MSG_2", "NOHP_MSG_3", "NOHP_MSG_4", "NOHP_MSG_5" } new messageshp[MESSAGESHP][] = { "HP_MSG_1", "HP_MSG_2", "HP_MSG_3", "HP_MSG_4", "HP_MSG_5" } public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar("ultimate_sounds",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY) register_dictionary("ultimate_sounds.txt") register_event("DeathMsg","hs","a","3=1") register_event("DeathMsg","knife_kill","a","4&kni") register_event("ResetHUD", "reset_hud", "b"); register_event("DeathMsg", "death_event", "a"); register_event("DeathMsg","death_msg","a") register_event("SendAudio","roundend_msg","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw") register_event("TextMsg","roundend_msg","a","2&#Game_C","2&#Game_w") lastman_mode = register_cvar("lastman_mode","abc") streak_mode = register_cvar("streak_mode","ab") knife_mode = register_cvar("knife_mode","ab") hs_mode = register_cvar("hs_mode","ab") gmsgHudSync = CreateHudSyncObj() return PLUGIN_CONTINUE } get_streak() { new streak[3] get_pcvar_string(streak_mode,streak,2) return read_flags(streak) } public death_event(id) { new streak = get_streak() if ((streak&1) || (streak&2)) { new killer = read_data(1); new victim = read_data(2); if (0 < killer <= get_maxplayers()) return PLUGIN_CONTINUE; kills[killer] += 1; kills[victim] = 0; deaths[killer] = 0; deaths[victim] += 1; for (new i = 0; i < LEVELS; i++) { if (kills[killer] == levels[i]) { announce(killer, i); return PLUGIN_CONTINUE; } } } return PLUGIN_CONTINUE; } announce(killer, level) { new streak = get_streak() if (streak&1) { new name[32]; get_user_name(killer, name, 32); set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2); ShowSyncHudMsg(0, gmsgHudSync, stkmessages[level], name); } if (streak&2){ for(new i=1;i<=get_maxplayers();i++) if(is_user_connected(i)==1 ) client_cmd(i, "spk %s", stksounds[level]); } } public reset_hud(id) { new streak = get_streak() if (streak&1) { if (kills[id] > levels[0]) { client_print(id, print_chat,"%L", id, "KILL_STREAK", kills[id]); } else if (deaths[id] > 1) { client_print(id, print_chat,"%L", id, "DEATH_STREAK", deaths[id]); } } } public client_connect(id) { new streak = get_streak() if ((streak&1) || (streak&2)) { kills[id] = 0; deaths[id] = 0; } } public knife_kill() { new knifemode[4] get_pcvar_string(knife_mode,knifemode,4) new knifemode_bit = read_flags(knifemode) if (knifemode_bit & 1) { new killer_id = read_data(1) new victim_id = read_data(2) new killer_name[33], victim_name[33] get_user_name(killer_id,killer_name,33) get_user_name(victim_id,victim_name,33) set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1) ShowSyncHudMsg(0, gmsgHudSync, "%L", LANG_PLAYER, knifemessages[ random_num(0,KNIFEMESSAGES-1) ],killer_name,victim_name) } if (knifemode_bit & 2) { for(new i=1;i<=get_maxplayers();i++) if( is_user_connected(i) == 1 ) client_cmd(i,"spk kisounds/0humiliation") } } public roundend_msg(id) alone_ann = 0 public death_msg(id) { new lmmode[8] get_pcvar_string(lastman_mode,lmmode,8) new lmmode_bit = read_flags(lmmode) new players_ct[32], players_t[32], ict, ite, last get_players(players_ct,ict,"ae","CT") get_players(players_t,ite,"ae","TERRORIST") if (ict==1&&ite==1) { new name1[32], name2[32] get_user_name(players_ct[0],name1,32) get_user_name(players_t[0],name2,32) set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1) if (lmmode_bit & 1) { if (lmmode_bit & 2) { ShowSyncHudMsg(0, gmsgHudSync, "%s (%i hp) vs. %s (%i hp)",name1,get_user_health(players_ct[0]),name2,get_user_health(players_t[0])) } else { ShowSyncHudMsg(0, gmsgHudSync, "%s vs. %s",name1,name2) } if (lmmode_bit & 4) { for(new i=1;i<=get_maxplayers();i++) if( is_user_connected(i) == 1 ) client_cmd(i,"spk kisounds/0maytheforce") } } } else { if (ict==1&&ite>1&&alone_ann==0&&(lmmode_bit & 4)) { last=players_ct[0] client_cmd(last,"spk kisounds/0oneandonly") } else if (ite==1&&ict>1&&alone_ann==0&&(lmmode_bit & 4)) { last=players_t[0] client_cmd(last,"spk kisounds/0oneandonly") } else { return PLUGIN_CONTINUE } alone_ann = last new name[32] get_user_name(last,name,32) if (lmmode_bit & 1) { set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1) if (lmmode_bit & 2) { ShowSyncHudMsg(0, gmsgHudSync, "%L", LANG_PLAYER, messageshp[ random_num(0,MESSAGESHP-1) ],ite ,ict ,name,get_user_health(last)) } else { ShowSyncHudMsg(0, gmsgHudSync, "%L", LANG_PLAYER, messagesnohp[ random_num(0,MESSAGESNOHP-1) ],ite ,ict ,name ) } } } return PLUGIN_CONTINUE } public hs() { new hsmode[4] get_pcvar_string(hs_mode,hsmode,4) new hsmode_bit = read_flags(hsmode) if (hsmode_bit & 1) { new killer_id = read_data(1) new victim_id = read_data(2) new victim_name[33] get_user_name(victim_id,victim_name,33) set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 3.0, 3.0, 0.15, 0.15, 1) ShowSyncHudMsg(killer_id, gmsgHudSync, ".:GUATE:.^nTe piteaste a %s !!",victim_name) } } public plugin_precache() { precache_sound("kisounds/supercombo.wav") precache_sound("kisounds/hypercombo.wav") precache_sound("kisounds/brutalcombo.wav") precache_sound("kisounds/mastercombo.wav") precache_sound("kisounds/awesomecombo.wav") precache_sound("kisounds/blastercombo.wav") precache_sound("kisounds/monstercombo.wav") precache_sound("kisounds/kingcombo.wav") precache_sound("kisounds/killercombo.wav") precache_sound("kisounds/ultracombo.wav") precache_sound("kisounds/ultimatecombo.wav") precache_sound("kisounds/zkcombo.wav") precache_sound("kisounds/0humiliation.wav") precache_sound("kisounds/0maytheforce.wav") precache_sound("kisounds/0oneandonly.wav") return PLUGIN_CONTINUE } Przeczytaj cały wpis
  7. I wanted to share a simple csgo web panel that I started developing for someone. I can continue the development on the panel if desired. You can contact me. FeaturesWeb FTP Maps Admins Player List Panel Accounts Server Console CPU & RAM Usage Restart & Start & Stop with web panel. ( For linux but need settings for shell exec. ) Auto fastdl for maps. Settings & Set up:Install the web files in the rar to the server where the server is installed. Edit lines 71 and 77 from the include/ayarlar.php file. Open the include/mysql.php file and set your database settings. Upload the .sql file to the database and make your settings in the panels table. Create a password with online md5 and replace it with the one in the "password" section from paneller. Attached Files htdocs.zip (1.30 MB) Wyświetl pełny artykuł
  8. Hi, after 10 years away from PC due to working. I lost all of my plugins of basebuilder 5.4 with a color menu exported from 6.5 version So, if someone can help me with it. (In 2013, when i did i just edited natives and lines for do work it), but i lost all knowledge x) Please don't say **use 6.5 better** /colors = Colors menu Attached Files Get Plugin or Get Source (basebuilder54.sma - 51.7 KB) Przeczytaj cały wpis
  9. Hi, I have a CS 1.6 server and we are using a rank system based on frags. Is there a way that, for example, a player that reaches 50,000 frags types /cash in the server chat and automatically gets vip access (i.e. "akm" flags in the users.ini file)? I have always kwown that you have to "manually" add new users to the users.ini file, so I'm wondering if such a thing is possible. Thanks! Przeczytaj cały wpis
  10. No other ways have worked, objects.txt, commands, both, etc... There seems to have been a plugin to do this at some point, but I cant find it anywhere on the internet and forum search isn't working. (It also seems to have stopped working) Przeczytaj cały wpis
  11. Ambience Sounds Manager - v0.0.1, published at : 21/04/2023 Description This plugin allows you to have constantly ambience sound playing. All you have to do is add your music into the ini file and add the duration of the music. For a nice soft loop i recommend using a float value, there are websites teaching you how to see the duration of your music with milliseconds Ini File ConfigurationUSE_SAY_COMMANDS 0/1 - 1 uses say /volume and /ambience | 0 uses Nightvision / Jointeam (N / M keys) AUTO_PLAY_AFTER_JOIN 0/1 - If 0 the player has to toggle it himself TIME_FOR_AUTO_PLAY *float* - Time to play the music after client_putinserver sound/directory/musicname.mp3 *float Duration of music* Example of ambience_manager.ini on Harry Potter Mod: Code: ; Some essencial stuff ; Use say commands 1 - If 0 it will use nightvision and team keys (N / M) USE_SAY_COMMANDS 0 ; If 0 player has to toggle the music himself AUTO_PLAY_AFTER_JOIN 1 ; Time it takes to play the music after client_putinsever TIME_FOR_AUTO_PLAY 3.0 ; Directory and duration of the music sound/harry_potter/ambience2.mp3 86.4 Attached Files Get Plugin or Get Source (ambience_manager.sma - 4.0 KB) ambience_manager.ini (355 Bytes) Przeczytaj cały wpis
  12. hey i am new here, can someone help me with this code Przeczytaj cały wpis
  13. [ANY] Chat Command Silencer [ Command Silencer ( ! / . ) + Force Lower Case Commands ] ( 1.0.3 ) .:[ ConVars ]:. Spoiler Code: // Enable Chat Command Silencer Plugin // 1= Yes // 0= No cmd_slint_enable "1" //========================================================================================== // Make Chat Command Silencer For Admins Only // 1= Yes ( Specific Flags cmd_slint_admin_flag ) // 0= No ( Everyone ) cmd_slint_admin "0" // if cmd_slint_admin 1 which flags is it cmd_slint_admin_flag "abcdefghijklmnoz" // Force After Commands ( ! . / ) UPPERCASE To lowercase // 1= Yes // 0= No cmd_slint_caps "0" //========================================================================================== // Silent Command Chat Begin With (!) // 1= Yes // 0= No cmd_slint_exclamation "0" // Silent Command Chat Begin With (.) // 1= Yes // 0= No cmd_slint_dot "0" // Silent Command Chat Begin With (/) // 1= Yes // 0= No cmd_slint_slash "0" .:[ Change Log ]:. Spoiler 1.0.3 - Fix Bug - Added cmd_slint_admin Make Chat Command Silencer For Admins Only - Added cmd_slint_admin_flag custom flags for cmd_slint_admin - Added cmd_slint_caps Force UPPERCASE To lowercase after Commands ( ! . / ) - Fix Always lowercase 1.0.2 - Fix Bug - Added Space Silencer into commands 1.0.1 - Fix Bug - Added Space cmd_slint_space 1.0.0 - Initial Release .:[ Download ]:. GitHub || Download Wyświetl pełny artykuł
  14. Tag / Prefix Manager - v0.0.1, published at : 20/04/2023 Description This is a simple plugin that allows you to make players have a Tag/Prefix as you desire. So you can have OWNER, LEADER, ADMIN, MODERATOR, VIP, etc defined by their flags. Differences between the othersTags are defined by Flag and only by Flag so people can't use other Tags You can define wich flag is stronger in order to set that specific Tag Made in Hogwarts rukia tags_manager.ini File Preview: Code: ; Remember that Force is about enumeration so 1 is stronger than 2 ; In this default file you can see ADMIN 2 and VIP 4 ; So ADMIN will be stronger and the client will get the ADMIN tag ; flag TAG Force l OWNER 1 t VIP 4 a ADMIN 2 d MODERATOR 3 Attached Files Get Plugin or Get Source (tags_manager.sma - 2.8 KB) tags_manager.ini (251 Bytes) Przeczytaj cały wpis
  15. Hi, I would like to ask where I can edit the button for using cod class skill (rocket, dynamite, etc..). I want to change it because Im using parachute on E already. I was not able to find any +use, or IN_USE in code. So.. :shock: Thank you so much. Attached Files Get Plugin or Get Source (QTM_CodMod.sma - 38.9 KB) Przeczytaj cały wpis
  16. Hi, i want you to itroduce my plugin for cases in CSGO. Inspired by Kratoss, but codes was completelly remade. Its paid plugin, because it took so much time and i made it with many features for normal players or for VIP players, im working now ony website where can i show u video how it works, but for now u can conatct me on my discord. For more info u can contact me on my DISCORD: KITSUNE#8109 Attached Thumbnails Wyświetl pełny artykuł
  17. Really simple example of a plugin that removes items at the start of a map Looking for feedback on how to improve the code, ( clock check too often? ) thanks I think the code I edited this from was by Oliveboy Attached Files noRPG3.smx (4.2 KB) Get Plugin or Get Source (removerpg.sp - 2.3 KB) Wyświetl pełny artykuł
  18. Here lies my GunGame setup for hl2dm many have asked me for. Requirements: Dhooks <- https://forums.alliedmods.net/showthread.php?t=180114 (For Custom Guns) https://drive.google.com/file/d/1w38...usp=share_link 172.107.2.27:27030 Server with the plugin. Wyświetl pełny artykuł
  19. As the title suggests, I request a plugin that allows survivors to use Hunter Jump. It will be used on my arms race server, and I believe the original gameplay lacks novelty, so I request this plugin to improve the server's gameplay. If you are willing to help after seeing this request, I would be very grateful! Przeczytaj cały wpis
  20. Hello every one, QuickDroLLL here, so basicly iam loking for /status for my server the plugin has those functions when someone type /status a menu will shown have those functions as well: Top Money it will show motd for the 15 best with the who have the most money in server (using jbe_get_user_money(id) native) Top Kills it will show motd for the 15 best with kills in the server Top Deaths it will show motd for the 15 best who got killed in server xD Top Time Played it will show motd for the 15 best time played in server Przeczytaj cały wpis
  21. Hello i dont know how to code but i wanted to see if chatgpt could create me a csgo plugin that i want in my server I wanted to make a plugin would reward online players 10 points every minute Can someone fix this? #include <sourcemod> public void OnPluginStart() { // Register the command to reward players RegConsoleCmd("reward", Cmd_Reward); // Create a timer to reward players every minute CreateTimer(60.0, Timer_Reward, _, TIMER_REPEAT); } public Action Cmd_Reward(int client, const char[] args) { // Get the client's SteamID new steamid[20]; GetClientAuthId(client, steamid, sizeof(steamid)); // Reward the client with 100 points RewardPlayer(steamid, 100); return Plugin_Handled; } public Action Timer_Reward(Handle timer) { // Loop through all connected clients for (int i = 1; i <= MaxClients; i++) { // Check if the client is connected if (IsClientInGame(i)) { // Get the client's SteamID new steamid[20]; GetClientAuthId(i, steamid, sizeof(steamid)); // Reward the client with 10 points RewardPlayer(steamid, 10); } } return Plugin_Continue; } public void RewardPlayer(const char[] steamid, int points) { // Open a connection to the MySQL database new database = SQL_Connect("localhost", "username", "password", "database"); // Check if the connection was successful if (SQL_IsError(database)) { LogError("Failed to connect to database: %s", SQL_GetLastError()); return; } // Create the query string new query[256]; Format(query, sizeof(query), "INSERT INTO rewards (steamid, points) VALUES ('%s', %d)", steamid, points); // Execute the query new result = SQL_Query(database, query); // Check if the query was successful if (SQL_IsError(result)) { LogError("Failed to execute query: %s", SQL_GetLastError()); } // Free the query result SQL_FreeResult(result); // Close the database connection SQL_Disconnect(database); } i am getting these errors (50) : error 017: undefined symbol "SQL_IsError" (52) : error 017: undefined symbol "SQL_GetLastError" (64) : error 017: undefined symbol "SQL_IsError" (70) : error 017: undefined symbol "SQL_FreeResult" (73) : error 017: undefined symbol "SQL_Disconnect" any help would be useful Attached Files Get Plugin or Get Source (newplugin.sp - 2.0 KB) Przeczytaj cały wpis
  22. I didn't thoroughly test this. The cvars are meant as both defaults for every command, or for specific commands to only affect one team, or only your team. This was created to enable !buy fheal @los to use the Point System feature to heal a survivor, but sometimes you end up being unable to find his name, or gibberish name, so this solves it. This also has the hidden benefit: Whenever a survivor is bugged outside the map, you can stare at him, then !tele @los. This will target that survivor if you stare at him, and because you're staring at a wall, it will teleport him to that wall, inside the map boundaries. This is better than @aim for two reasons: 1. Works through walls ( Maybe @aim also works through walls, not sure ) 2. No need to precisely aim at the target. Attached Files Get Plugin or Get Source (TargetLOS.sp - 2.4 KB) Wyświetl pełny artykuł
  23. So, I'm using this biohazard shop plugin for the biohazard mod, but I want to change the "Infect me" item for this "Invisibility" item. It would be awesome if the CT can buy 15 seconds of invisibility instead of being able to infect himself. I have no problem if you guys think there's a better version of the invisibility plugin or there's a better way to do it. Thanks! PHP Code: #include <amxmodx> #include <fun> #include <cstrike> #include <fakemeta> #include <engine> #include <xs> #include <hamsandwich> #include <dhudmessage> #include <biohazard> #define PLUGIN_NAME "[Biohazard] Shop" #define PLUGIN_AUTHORS "YONTU" #define PLUGIN_VERSION "1.0" #define is_user_player(%1) (1 <= %1 <= max_players) #define DMG_HEGRENADE (1<<24) #define ENG_NULLENT -1 #define EV_INT_WEAPONKEY EV_INT_impulse #define GAK_WEAPONKEY 6871 #define TASK_DELAY 91249 new g_HostName[64], g_Ak47Gold[33], g_Ak47GoldenZoom[33], g_HealthRegen[33], Float:g_RegenDelay[33]; new g_user_xp[33], g_item[4][33], g_msg_ItemPickUp; new g_PowerGlobalDelay = 0, g_PowerDelay[33]; new SpriteTexture, Lightning, PowerSprite, ShockWave; new menu, text_menu[128], text_items[5][128], menu_callback, money; new data[6], name[64], access, CallBack; new max_players, cvar_hostname; new bool:ignorecost = false; enum { COST_GOLDEN_AK47 = 0, COST_REGENERATOR_HUMAN, COST_FROSTNADE, COST_INFECTME } enum { COST_NOFLASH = 0, COST_SPEED, COST_HEALTH, COST_GRAVITY, COST_STRIPW } // Costul itemelor din shop-ul oamenilor new const SHOP_HUMANS[] = { 16000, // COSTUL AK-47 DE AUR 3000, // COSTUL REGENERATORULUI DE VIATA (VIATA MAXIMA = 200) 4000, // COSTUL GRENADEI FROST 15000 // COSTUL AUTO-INFECTIEI } // Costul itemelor din shop-ul zombilor new const SHOP_ZOMBIES[] = { 2, // NO FLASH 4, // SPEED BOOST 6, // EXTRA HEALTH 3, // LOW GRAVITY 8 // STRIP HUMANS WEAPONS } // Poti adauga mai multe ore respectand matricea de mai jos. Intre orele respective, costul itemelor va fi ignorat, adica itemele vor fi gratuite. // NOTA: Dupa ultima linie a matriciei nu se pune virgula (vezi mai jos) new ignore_cost_hours[][] = { {00, 22}, // intre ora 00:00 si 07:00 {16, 17} // intre ora 16:00 si 17:00 } new const GoldenAK[][] = { "models/biohazard/v_ak47_golden.mdl", "models/biohazard/p_ak47_golden.mdl", "models/biohazard/w_ak47_golden.mdl" } new const TAG[] = "[Biohazard]"; new const TargetAimingSound[][] = { "biohazard/target.wav", "biohazard/target2.wav" }; new const PowerSound[] = "biohazard/wizard_skill.wav"; new const SpritePower[] = "sprites/biohazard/wizard.spr"; const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90) const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE) public plugin_init() { register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHORS); is_biomod_active() ? plugin_init2() : pause("ad") } public plugin_init2() { new o, m, s, i; time(o, m, s); for(i = 0; i < sizeof ignore_cost_hours; i++) { if(o >= ignore_cost_hours[i][0] && o < ignore_cost_hours[i][1]) { ignorecost = true; } } register_event("HLTV", "event_NewRound", "a", "1=0", "2=0"); register_event("CurWeapon", "event_CurWeapon", "be", "1=1"); register_event("Damage", "event_Damage", "be"); register_event("DeathMsg", "event_DeathMsg", "a"); RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamagePre"); RegisterHam(Ham_Item_AddToPlayer, "weapon_ak47", "fw_AddToPlayer"); RegisterHam(Ham_TraceAttack, "worldspawn", "fw_TraceAttack", 1); RegisterHam(Ham_TraceAttack, "player", "fw_TraceAttack", 1); register_forward(FM_SetModel, "fw_SetModel"); register_forward(FM_CmdStart, "fw_CmdStart"); register_forward(FM_PlayerPreThink, "fw_PlayerPreThink"); register_message(get_user_msgid("ScreenFade"), "msg_ScreenFade"); register_clcmd("say /shop", "ShowShopMenu"); register_clcmd("say_team /shopS", "ShowShopMenu"); register_clcmd("say shop", "ShowShopMenu"); register_clcmd("say_team shop", "ShowShopMenu"); register_clcmd("drop", "cmd_use_power"); g_msg_ItemPickUp = get_user_msgid("ItemPickup"); cvar_hostname = get_cvar_pointer("hostname"); max_players = get_maxplayers(); } public plugin_precache() { new i; for(i = 0; i < sizeof GoldenAK; i++) precache_model(GoldenAK[i]); for(i = 0; i < sizeof TargetAimingSound; i++) precache_sound(TargetAimingSound[i]); precache_sound(PowerSound); precache_sound("weapons/zoom.wav"); Lightning = precache_model("sprites/lgtning.spr"); ShockWave = precache_model("sprites/shockwave.spr"); PowerSprite = precache_model(SpritePower); SpriteTexture = precache_model("sprites/dot.spr"); } public plugin_cfg() { get_pcvar_string(cvar_hostname, g_HostName, charsmax(g_HostName)); } public client_putinserver(id) { reset_vars(id); } public ShowShopMenu(id) { if(!is_user_alive(id)) { ColorChat(id, "!4%s!1 Trebuie sa fii in viata pentru a deschide shop-ul.", TAG); return PLUGIN_HANDLED; } else if(!game_started()) { ColorChat(id, "!4%s!1 Trebuie sa astepti pana incepe infectia pentru a deschide shop-ul.", TAG); return PLUGIN_HANDLED; } if(!is_user_zombie(id)) HumanShop(id); else ZombieShop(id); return PLUGIN_CONTINUE; } public HumanShop(id) { !ignorecost ? formatex(text_menu, charsmax(text_menu), "\wHumans SHOP_HUMANS | Money:\r %d^n\y%s", cs_get_user_money(id), g_HostName) : formatex(text_menu, charsmax(text_menu), "\wHumans SHOP_HUMANS | FREE ITEMS^n\y%s", g_HostName); menu = menu_create(text_menu, "HumansHandler"); menu_callback = menu_makecallback("CallBackMenuH"); !ignorecost ? formatex(text_items[0], charsmax(text_items[]), "Golden AK-47 -\r %d $", SHOP_HUMANS[COST_GOLDEN_AK47]) : formatex(text_items[0], charsmax(text_items[]), "Golden AK-47"); menu_additem(menu, text_items[0], "1", 0, menu_callback); !ignorecost ? formatex(text_items[1], charsmax(text_items[]), "Health Regenerator (200 HP) -\r %d $", SHOP_HUMANS[COST_REGENERATOR_HUMAN]) : formatex(text_items[1], charsmax(text_items[]), "Health Regenerator (200 HP)"); menu_additem(menu, text_items[1], "2", 0, menu_callback); !ignorecost ? formatex(text_items[2], charsmax(text_items[]), "Frost Nade -\r %d $", SHOP_HUMANS[COST_FROSTNADE]) : formatex(text_items[2], charsmax(text_items[]), "Frost Nade"); menu_additem(menu, text_items[2], "3", 0, menu_callback); formatex(text_items[3], charsmax(text_items[]), "Infect me -\r %d $", SHOP_HUMANS[COST_INFECTME]); menu_additem(menu, text_items[3], "4", 0, menu_callback); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); return PLUGIN_CONTINUE; } public CallBackMenuH(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } money = cs_get_user_money(id); menu_item_getinfo(menu, item, access, data, charsmax(data), name, charsmax(name), CallBack); new key = str_to_num(data); switch(key) { case 1: { if(SHOP_HUMANS[COST_GOLDEN_AK47] > money && !ignorecost || g_Ak47Gold[id] == 1) return ITEM_DISABLED; } case 2: { if(SHOP_HUMANS[COST_REGENERATOR_HUMAN] > money && !ignorecost || g_HealthRegen[id] == 1) return ITEM_DISABLED; } case 3: { if(SHOP_HUMANS[COST_FROSTNADE] > money && !ignorecost || user_has_weapon(id, CSW_SMOKEGRENADE)) return ITEM_DISABLED; } case 4: { if(SHOP_HUMANS[COST_INFECTME] > money || !allow_infection()) return ITEM_DISABLED; } } return ITEM_ENABLED; } public HumansHandler(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } money = cs_get_user_money(id); menu_item_getinfo(menu, item, access, data, charsmax(data), name, charsmax(name), CallBack); new key = str_to_num(data); switch(key) { case 1: { new szWeapons[32], iNum; get_user_weapons(id, szWeapons, iNum); for(new i = 0; i < iNum; i++) { if(PRIMARY_WEAPONS_BIT_SUM & (1<<szWeapons[i])) { new weaponname[32]; get_weaponname(szWeapons[i], weaponname, charsmax(weaponname)); bacon_strip_weapon(id, weaponname); } } g_Ak47Gold[id] = 1; give_item(id, "weapon_ak47"); if(!ignorecost) { new cost_ak47 = SHOP_HUMANS[COST_GOLDEN_AK47]; cs_set_user_money(id, money - cost_ak47); ColorChat(id, "!4%s!1 You bought!3 Golden AK-47!1 with!3 %d!1 money.", TAG, cost_ak47); } } case 2: { g_HealthRegen[id] = 1; ColorChat(id, "!4%s!1 Your health will be regenerated with!3 1 HP!1/!3sec!1 (!3MAX 200 HP!1).", TAG); if(!ignorecost) { new cost_regen = SHOP_HUMANS[COST_REGENERATOR_HUMAN]; cs_set_user_money(id, money - cost_regen); ColorChat(id, "!4%s!1 You bought!3 health regenerator!1 with!3 %d!1 money.", TAG, cost_regen); } } case 3: { if(!ignorecost) { new cost_fn = SHOP_HUMANS[COST_FROSTNADE]; cs_set_user_money(id, money - cost_fn); ColorChat(id, "!4%s!1 You bought a!3 frostnade!1 with!3 %d!1 money.", TAG, cost_fn); } give_item(id, "weapon_smokegrenade"); } case 4: { infect_user(id, 0); new zm_name[32]; get_user_name(id, zm_name, charsmax(zm_name)); ColorChat(0, "!4%s!3 %s!1 become a zombie. He was infected by a strange plague.", TAG, zm_name); } } menu_destroy(menu); return PLUGIN_HANDLED; } public ZombieShop(id) { formatex(text_menu, charsmax(text_menu), "\wXP:\r %d^n\w* Infect more humans and gain experience points.^n*\r ONLY\w first zombie can receive XP.^n*\y 1 infection = 1 XP^n\w* Only item during one round.", g_user_xp[id]); menu = menu_create(text_menu, "ZombiesHandler"); menu_callback = menu_makecallback("CallBackMenuZ"); formatex(text_items[0], charsmax(text_items[]), "NO FLASH -\d Immune to flashbangs\w [\y%d XP\w]", SHOP_ZOMBIES[COST_NOFLASH]); menu_additem(menu, text_items[0], "1", 0, menu_callback); formatex(text_items[1], charsmax(text_items[]), "SPEED BOOST -\d Increase your speed by 20%%\w [\y%d XP\w]", SHOP_ZOMBIES[COST_SPEED]); menu_additem(menu, text_items[1], "2", 0, menu_callback); formatex(text_items[2], charsmax(text_items[]), "EXTRA HEALTH -\d Increase your health by 30%%\w [\y%d XP\w]", SHOP_ZOMBIES[COST_HEALTH]); menu_additem(menu, text_items[2], "3", 0, menu_callback); formatex(text_items[3], charsmax(text_items[]), "LOW GRAVITY -\d Increase your gravity with 50%%\w [\y%d XP\w]", SHOP_ZOMBIES[COST_GRAVITY]); menu_additem(menu, text_items[3], "4", 0, menu_callback); formatex(text_items[4], charsmax(text_items[]), "STRIP HUMANS WEAPONS [\y%d XP\w]", SHOP_ZOMBIES[COST_STRIPW]); menu_additem(menu, text_items[4], "5", 0, menu_callback); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); return PLUGIN_CONTINUE; } public CallBackMenuZ(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], name[64], access, CallBack; menu_item_getinfo(menu, item, access, data, charsmax(data), name, charsmax(name), CallBack); switch(data[0]) { case '1': { if(g_user_xp[id] < 0 || SHOP_ZOMBIES[COST_NOFLASH] > g_user_xp[id] || g_item[0][id] == 1) return ITEM_DISABLED; } case '2': { if(g_user_xp[id] < 0 || SHOP_ZOMBIES[COST_SPEED] > g_user_xp[id] || g_item[1][id] == 1) return ITEM_DISABLED; } case '3': { if(g_user_xp[id] < 0 || SHOP_ZOMBIES[COST_HEALTH] > g_user_xp[id] || get_user_health(id) >= 500) return ITEM_DISABLED; } case '4': { if(g_user_xp[id] < 0 || SHOP_ZOMBIES[COST_GRAVITY] > g_user_xp[id] || g_item[2][id] == 1) return ITEM_DISABLED; } case '5': { if(g_user_xp[id] < 0 || SHOP_ZOMBIES[COST_STRIPW] > g_user_xp[id] || g_item[3][id] == 1) return ITEM_DISABLED; } } return ITEM_ENABLED; } public ZombiesHandler(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], name[64], access, CallBack; menu_item_getinfo(menu, item, access, data, charsmax(data), name, charsmax(name), CallBack); new iKey = str_to_num(data); switch(iKey) { case 1: { new cost_nf = SHOP_ZOMBIES[COST_NOFLASH]; g_item[0][id] = 1; g_user_xp[id] -= cost_nf; ColorChat(id, "!4%s!1 You bought!3 no flash!1 with!3 %d!1 XP.", TAG, cost_nf); } case 2: { new Float:speed = 0.2 * get_user_maxspeed(id); new cost_speed = SHOP_ZOMBIES[COST_SPEED]; set_user_maxspeed(id, get_user_maxspeed(id) + speed); g_item[1][id] = 1; g_user_xp[id] -= cost_speed; ColorChat(id, "!4%s!1 You bought!3 %0.1f!1 speed with!3 %d!1 XP.", TAG, speed, cost_speed); } case 3: { new Float:health; pev(id, pev_health, health); new Float:hp = 0.3 * health; new cost_hp = SHOP_ZOMBIES[COST_HEALTH]; new Float:max_hp = 500.0; message_begin(MSG_ONE, g_msg_ItemPickUp, _, id); write_string("cross"); write_byte(255); write_byte(0); write_byte(0); message_end(); emit_sound(id, CHAN_VOICE, "items/tr_kevlar.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM); set_pev(id, pev_health, floatclamp(health + hp, 0.0, max_hp)); g_user_xp[id] -= cost_hp; ColorChat(id, "!4%s!1 You bought!3 %0.1f!1 health with!3 %d!1 XP.", TAG, (get_user_health(id) >= max_hp) ? max_hp : hp, cost_hp); } case 4: { new Float:gravity = 0.5 * get_user_gravity(id); new cost_gv = SHOP_ZOMBIES[COST_GRAVITY]; set_user_gravity(id, get_user_gravity(id) - gravity); g_item[2][id] = 1; g_user_xp[id] -= cost_gv; ColorChat(id, "!4%s!1 You bought gravity with!3 %d!1 XP. Your gravity:!3 %0.1f!1.", TAG, cost_gv, get_user_gravity(id) * 800.0); } case 5: { new cost_shw = SHOP_ZOMBIES[COST_STRIPW]; g_item[3][id] = 1; PowerGlobalDelay(); g_user_xp[id] -= cost_shw; ColorChat(id, "!4%s!1 Now, you can strip humans weapons. Find a human, aim it, and!3 PRESS G!1.", TAG); ColorChat(id, "!4%s!1 Cooldown:!3 15 sec.", TAG); } } menu_destroy(menu); return PLUGIN_HANDLED; } public event_NewRound() { new Players[32], Num, id, i; get_players(Players, Num); for(i = 0; i < Num; i++) { id = Players[i]; if(!is_user_connected(id)) continue; reset_vars(id); } if(ignorecost) { ColorChat(0, "!1%s!4 TOATE ITEMELE DIN SHOP-UL OAMENILOR SUNT GRATIS.", TAG); } } public event_infect(victim, infector) { if(!is_user_alive(victim) || !is_user_alive(infector)) return PLUGIN_HANDLED; reset_vars(victim); if(victim == infector || !is_user_infected(infector)) return PLUGIN_HANDLED; g_user_xp[infector]++; return PLUGIN_CONTINUE; } public event_CurWeapon(id) { if(!is_user_alive(id) || g_Ak47Gold[id] == 0) return PLUGIN_HANDLED; if(get_user_weapon(id) == CSW_AK47) { set_pev(id, pev_viewmodel2, GoldenAK[0]); set_pev(id, pev_weaponmodel2, GoldenAK[1]); // unlimited clip set_pdata_int(get_pdata_cbase(id, 373), 51, 30, 4); } return PLUGIN_CONTINUE; } public event_Damage(victim) { if(!is_user_alive(victim) || g_HealthRegen[victim] == 0 || is_user_zombie(victim)) return PLUGIN_CONTINUE static Float:gametime; gametime = get_gametime(); g_RegenDelay[victim] = gametime + 1.0; return PLUGIN_CONTINUE; } public event_DeathMsg() { new id = read_data(2); if(is_user_connected(id)) reset_vars(id); } public fw_TakeDamagePre(iVictim, iInflictor, iAttacker, Float:fDamage, iDmgType) { if(iVictim == iAttacker || !is_user_player(iAttacker) || !is_user_alive(iAttacker) || g_Ak47Gold[iAttacker] == 0) return HAM_HANDLED; if(is_user_player(iAttacker) && get_user_weapon(iAttacker) == CSW_AK47 && is_user_zombie(iVictim)) { // bug fix if(iDmgType & DMG_HEGRENADE) return HAM_IGNORED; new Float:Damage = 2.0; fDamage *= Damage; SetHamParamFloat(4, fDamage); return HAM_HANDLED; } return HAM_IGNORED; } public fw_TraceAttack(ent, attacker, Float:damage, Float:dir[3], ptr, iDamageType) { if(is_user_player(attacker) && g_Ak47Gold[attacker] == 1 && is_user_alive(attacker) && get_user_weapon(attacker) == CSW_AK47) { new Float:flEnd[3]; get_tr2(ptr, TR_vecEndPos, flEnd); message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(TE_BEAMENTPOINT); write_short(attacker | 0x1000); engfunc(EngFunc_WriteCoord, flEnd[0]); engfunc(EngFunc_WriteCoord, flEnd[1]); engfunc(EngFunc_WriteCoord, flEnd[2]); write_short(SpriteTexture); write_byte(0); // framerate write_byte(0); // framerate write_byte(1); // life write_byte(5); // width write_byte(0); // noise write_byte(255); // r, g, b write_byte(215); // r, g, b write_byte(0); // r, g, b write_byte(200); // brightness write_byte(10); // speed message_end(); } return HAM_IGNORED; } public fw_AddToPlayer(ent, id) { if(is_valid_ent(ent) && is_user_connected(id) && entity_get_int(ent, EV_INT_WEAPONKEY) == GAK_WEAPONKEY) { g_Ak47Gold[id] = 1; entity_set_int(ent, EV_INT_WEAPONKEY, 0); return HAM_HANDLED; } return HAM_IGNORED; } public fw_SetModel(entity, model[]) { if(!is_valid_ent(entity)) return FMRES_IGNORED; if(!equal(model, "models/w_ak47.mdl")) return FMRES_IGNORED; static szClassName[33]; entity_get_string(entity, EV_SZ_classname, szClassName, charsmax(szClassName)); if(!equal(szClassName, "weaponbox")) return FMRES_IGNORED static iOwner, iStoredAkID iOwner = entity_get_edict(entity, EV_ENT_owner); iStoredAkID = fm_find_ent_by_owner(ENG_NULLENT, "weapon_ak47", entity); if(g_Ak47Gold[iOwner] == 1 && is_valid_ent(iStoredAkID)) { entity_set_int(iStoredAkID, EV_INT_WEAPONKEY, GAK_WEAPONKEY); g_Ak47Gold[iOwner] = 0; entity_set_model(entity, GoldenAK[2]); return FMRES_SUPERCEDE; } return FMRES_IGNORED; } public fw_CmdStart(id, uc_handle, seed) { if(!is_user_alive(id)) return PLUGIN_HANDLED if((get_uc(uc_handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2)) { if(get_user_weapon(id) == CSW_AK47 && g_Ak47Gold[id] == 1) { switch(g_Ak47GoldenZoom[id]) { case 1: { g_Ak47GoldenZoom[id] = 0; cs_set_user_zoom(id, CS_RESET_ZOOM, 0); } case 0: { g_Ak47GoldenZoom[id] = 1 cs_set_user_zoom(id, CS_SET_AUGSG552_ZOOM, 0); emit_sound(id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100); } } } return PLUGIN_CONTINUE; } return PLUGIN_HANDLED; } public fw_PlayerPreThink(id) { if(!is_user_alive(id) || g_HealthRegen[id] == 0 || is_user_zombie(id)) return FMRES_IGNORED; static Float:gametime gametime = get_gametime(); if(get_user_health(id) < 200 && g_RegenDelay[id] < gametime) { set_user_health(id, get_user_health(id) + 1); g_RegenDelay[id] = gametime + 1; } return FMRES_IGNORED; } public msg_ScreenFade(msgid, dest, id) { if(g_item[0][id] == 1 && is_user_zombie(id) && is_user_connected(id)) { static data[4]; data[0] = get_msg_arg_int(4); data[1] = get_msg_arg_int(5); data[2] = get_msg_arg_int(6); data[3] = get_msg_arg_int(7); if(data[0] == 255 && data[1] == 255 && data[2] == 255 && data[3] > 199) return PLUGIN_HANDLED; } return PLUGIN_CONTINUE; } public cmd_use_power(id) { if(is_user_alive(id) && is_user_zombie(id) && g_item[3][id] == 1) { set_dhudmessage(20, 255, 0, -1.0, 0.78, 0, _, 1.0); if(g_PowerGlobalDelay > 0) { show_dhudmessage(id, "Strip ability not ready.^n(%d second%s remaining)", g_PowerGlobalDelay, g_PowerGlobalDelay == 1 ? "" : "s"); } else if(g_PowerDelay[id] > 0) { show_dhudmessage(id, "Strip ability not ready.^n(%d second%s remaining)", g_PowerDelay[id], g_PowerDelay[id] == 1 ? "" : "s"); } else { g_PowerDelay[id] = 15; PowerDelay(id); new target, body; static Float:StartPos[3], Float:EndPos[3]; pev(id, pev_origin, StartPos); fm_get_aim_origin(id, EndPos); StartPos[2] += 16.0; EndPos[2] += 16.0; get_user_aiming(id, target, body, 90000); if(is_user_alive(target) && get_user_team(id) != get_user_team(target)) { message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(TE_EXPLOSION); engfunc(EngFunc_WriteCoord, EndPos[0]); engfunc(EngFunc_WriteCoord, EndPos[1]); engfunc(EngFunc_WriteCoord, EndPos[2]); write_short(PowerSprite); write_byte(10); write_byte(30); write_byte(4); message_end(); emit_sound(id, CHAN_WEAPON, PowerSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM); emit_sound(target, CHAN_AUTO, TargetAimingSound[random_num(0, charsmax(TargetAimingSound))], VOL_NORM, ATTN_NORM, 0, PITCH_NORM); ShakeScreen(target, 3.0); CreateTeBeamCylinder(target); CreateThunder(target); new szWeapons[32], iNum; get_user_weapons(target, szWeapons, iNum); for(new i = 0; i < iNum; i++) { if(PRIMARY_WEAPONS_BIT_SUM|SECONDARY_WEAPONS_BIT_SUM & (1<<szWeapons[i])) { static szWeaponName[32]; get_weaponname(szWeapons[i], szWeaponName, charsmax(szWeaponName)); bacon_strip_weapon(target, szWeaponName); } } ColorChat(target, "!4%s!1 YOU LOST YOUR WEAPONS", TAG); if(!is_user_connected(target)) { ColorChat(id, "!4%s!1 You didn't aim corectly.", TAG); } else { new name[32]; get_user_name(target, name, charsmax(name)); ColorChat(id, "!4%s!1 TARGET:!3 %s!1. He loses his weapons.", TAG, name); } ShakeScreen(id, 2.0); } message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(TE_BEAMENTS); write_short(id); write_short(target); write_short(Lightning); write_byte(0); write_byte(15); write_byte(20); write_byte(80); write_byte(10); write_byte(47); write_byte(217); write_byte(90); write_byte(255); write_byte(0); message_end(); } } return PLUGIN_CONTINUE; } public CreateTeBeamCylinder(id) { new fOrigin[3]; get_user_origin(id, fOrigin, 0); message_begin(MSG_ALL, SVC_TEMPENTITY); write_byte(21); write_coord(fOrigin[0]); write_coord(fOrigin[1]); write_coord(fOrigin[2] + 10); write_coord(fOrigin[0]); write_coord(fOrigin[1]); write_coord(fOrigin[2] + 80); write_short(ShockWave); write_byte(0); write_byte(0); write_byte(4); write_byte(60); write_byte(0); write_byte(100); write_byte(200); write_byte(50); write_byte(255); write_byte(0); message_end(); } public CreateThunder(id) { new fOrigin[3], iStartPos[3]; get_user_origin(id, fOrigin); fOrigin[2] -= 26; iStartPos[0] = fOrigin[0] + 150; iStartPos[1] = fOrigin[1] + 150; iStartPos[2] = fOrigin[2] + 800; message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(TE_BEAMPOINTS); write_coord(iStartPos[0]); write_coord(iStartPos[1]); write_coord(iStartPos[2]); write_coord(fOrigin[0]); write_coord(fOrigin[1]); write_coord(fOrigin[2]); write_short(Lightning); write_byte(1); write_byte(5); write_byte(7); write_byte(20); write_byte(30); write_byte(255); write_byte(251); write_byte(176); write_byte(200); write_byte(200); message_end(); message_begin(MSG_PVS, SVC_TEMPENTITY, fOrigin); write_byte(TE_SPARKS); write_coord(fOrigin[0]); write_coord(fOrigin[1]); write_coord(fOrigin[2]); message_end(); } public ShakeScreen(id, const Float:iSeconds) { static g_msg_SS = 0; if(!g_msg_SS) g_msg_SS = get_user_msgid("ScreenShake"); message_begin(MSG_ONE, g_msg_SS, _, id); write_short(floatround(4096.0 * iSeconds, floatround_round)); write_short(floatround(4096.0 * iSeconds, floatround_round)); write_short(1<<13); message_end(); } stock fm_get_aim_origin(id, Float:fOrigin[3]) { new Float:start[3], Float:view_ofs[3]; pev(id, pev_origin, start); pev(id, pev_view_ofs, view_ofs); xs_vec_add(start, view_ofs, start); new Float:dest[3]; pev(id, pev_v_angle, dest); engfunc(EngFunc_MakeVectors, dest); global_get(glb_v_forward, dest); xs_vec_mul_scalar(dest, 9999.0, dest); xs_vec_add(start, dest, dest); engfunc(EngFunc_TraceLine, start, dest, 0, id, 0); get_tr2(0, TR_vecEndPos, fOrigin); return PLUGIN_HANDLED; } public reset_vars(id) { if(g_item[3][id] == 1) if(task_exists(TASK_DELAY + id)) remove_task(TASK_DELAY + id); new i; for(i = 0; i < 4; i++) g_item[i][id] = 0; if(g_Ak47Gold[id]) { g_Ak47Gold[id] = 0; g_Ak47GoldenZoom[id] = 0; cs_set_user_zoom(id, CS_RESET_ZOOM, 0); } g_HealthRegen[id] = 0; g_RegenDelay[id] = 0.0; } public PowerGlobalDelay() { new Players[32], Num, id; get_players(Players, Num); for(new i = 0; i < Num; i++) { id = Players[i]; if(is_user_zombie(id)) { if(g_PowerGlobalDelay > 1) { g_PowerGlobalDelay--; set_task(1.0, "PowerGlobalDelay") } else if(g_PowerGlobalDelay <= 1) { g_PowerGlobalDelay = 0; if(is_user_alive(id)) { set_dhudmessage(20, 255, 0, -1.0, 0.78, 0, _, 2.0); show_dhudmessage(id, "STRIP ABILITY is ready.^nNow, find a HUMAN and strip his weapons."); } } } } } public PowerDelay(id) { if(id >= TASK_DELAY) id -= TASK_DELAY; if(is_user_alive(id) && is_user_zombie(id)) { if(g_PowerDelay[id] > 1) { g_PowerDelay[id]--; set_task(1.0, "PowerDelay", id+TASK_DELAY); } else if(g_PowerDelay[id] <= 1) { g_PowerDelay[id] = 0; set_dhudmessage(20, 255, 0, -1.0, 0.78, 0, _, 2.0); show_dhudmessage(id, "STRIP ABILITY is ready.^nNow, find a HUMAN and strip his weapons."); } } } stock ColorChat(id, String[], any:...) { static szMesage[192]; vformat(szMesage, charsmax(szMesage), String, 3); replace_all(szMesage, charsmax(szMesage), "!1", "^1"); replace_all(szMesage, charsmax(szMesage), "!3", "^3"); replace_all(szMesage, charsmax(szMesage), "!4", "^4"); static g_msg_SayText = 0; if(!g_msg_SayText) g_msg_SayText = get_user_msgid("SayText"); new Players[32], iNum = 1, i; if(id) Players[0] = id; else get_players(Players, iNum, "ch"); for(--iNum; iNum >= 0; iNum--) { i = Players[iNum]; message_begin(MSG_ONE_UNRELIABLE, g_msg_SayText, _, i); write_byte(i); write_string(szMesage); message_end(); } } stock fm_find_ent_by_owner(id, const szClassName[], iOwner, jghgtype = 0) { new str_type[11] = "classname", iEnt = id; switch(jghgtype) { case 1: str_type = "target"; case 2: str_type = "targetname"; } while((iEnt = engfunc(EngFunc_FindEntityByString, iEnt, str_type, szClassName)) && pev(iEnt, pev_owner) != iOwner) { } return iEnt; } stock bacon_strip_weapon(index, weapon[]) { if(!equal(weapon, "weapon_", 7)) return PLUGIN_CONTINUE; static weaponid; weaponid = get_weaponid(weapon) if(!weaponid) return PLUGIN_CONTINUE; static weaponent; weaponent = fm_find_ent_by_owner(-1, weapon, index); if(!weaponent) return PLUGIN_CONTINUE; if(get_user_weapon(index) == weaponid) ExecuteHamB(Ham_Weapon_RetireWeapon, weaponent); if(!ExecuteHamB(Ham_RemovePlayerItem, index, weaponent)) return PLUGIN_CONTINUE; ExecuteHamB(Ham_Item_Kill, weaponent); set_pev(index, pev_weapons, pev(index, pev_weapons) & ~(1<<weaponid)); return PLUGIN_HANDLED; } // from biohazard by cheap_suit stock bool:allow_infection() { static count[2]; count[0] = 0; count[1] = 0; static index; for(index = 1; index <= max_players; index++) { if(is_user_connected(index) && is_user_zombie(index)) count[0]++; else if(is_user_alive(index)) count[1]++; } return (count[0] < 31 && count[1] > 1) ? true : false; } Attachment 200272 Attached Files Get Plugin or Get Source (item_invisibilidad.sma - 1.6 KB) Przeczytaj cały wpis
  24. Hi! I have a biohazard server, I'm using this mod: HTML Code: https://forums.alliedmods.net/showthread.php?t=68523The problem is that when a user gets infected they can respawn as humans if they type retry in the console or they rejoin the server. Is there a way to block this, or use amx_infect on those who rejoined the server if they were already infected during the round? Some trolls are just killing the mod by rejoining time and time again. Thanks! Przeczytaj cały wpis
×
×
  • Dodaj nową pozycję...