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. Hello, please need for server cs 1.6 plugin for revive team player after die. When a player dies and you are alive when you go to him so that you can release the life from the press E for revive team player It is like defuse the bomb. Przeczytaj cały wpis
  2. Introduction: A simple plugin make survivor can dog jump like Cs1.6 No need for mouse wheel, just put down ctrl when you are jumping and now you can dog jump. No cvar, no setting cfg, just put the plugin in your server plugin folder and it will work. Maybe work for other source game, i just test it in l4d2. Attached Files Get Plugin or Get Source (dogjump.sp - 2.1 KB) Wyświetl pełny artykuł
  3. Hello, I'm new among you. I would like help on an issue that I could not find information on as far as I searched on the internet. The game we know has Spray Pattern. However, in Counter-Strike, the bullet mechanics of the players in the spectator mode are completely changed. A different situation arises. I want to reflect that in the real game. How can I do that? Przeczytaj cały wpis
  4. I wanted some help with the simple glow menu plugin, because on my server it looks like this in the players! like the picture below and i would like it to stay that way, like a CSDM respawn, that protection of seconds, currently the plugin makes the brightness with the very big border and not in the model player Code: #include <amxmodx> #include <amxmisc> #include <cromchat> #include <formatin> #include <fun> #if AMXX_VERSION_NUM < 183 #include <dhudmessage> #endif #define PLUGIN_VERSION "2.0" enum _:Settings { GLOW_TEAM, GLOW_FLAG, GLOW_TITLE[128], GLOW_TITLE_PAGE[64], GLOW_BACK_NAME[32], GLOW_NEXT_NAME[32], GLOW_EXIT_NAME[32], GLOW_PER_PAGE, GLOW_MESSAGE_TYPE, Float:GLOW_HUD_X, Float:GLOW_HUD_Y, GLOW_HUD_EFFECTS, Float:GLOW_HUD_EFFTIME, Float:GLOW_HUD_HOLDTIME } enum _:Glows { NAME[32], COLOR[3] } enum { SECTION_SETTINGS, SECTION_GLOWS } new Array:g_aGlows new g_eSettings[Settings] new g_iGlow[33] public plugin_init() { register_plugin("Simple Glow Menu", PLUGIN_VERSION, "Unbr3akable") register_cvar("SimpleGlowMenu", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED) register_dictionary("SimpleGlowMenu.txt") } public plugin_cfg() { g_aGlows = ArrayCreate(Glows) ReadFile() } public plugin_end() { ArrayDestroy(g_aGlows) } ReadFile() { new szConfigsDir[64] get_configsdir(szConfigsDir, charsmax(szConfigsDir)) add(szConfigsDir, charsmax(szConfigsDir), "/SimpleGlowMenu.ini") new iFilePointer = fopen(szConfigsDir, "rt") if (iFilePointer) { new szData[160], szKey[32], szValue[128], eGlows[Glows], iSection, i ArrayPushString(g_aGlows, "\rNone") while (!feof(iFilePointer)) { fgets(iFilePointer, szData, charsmax(szData)) trim(szData) switch (szData[0]) { case EOS, ';': continue case '[': { if (szData[strlen(szData) -1] == ']') { if (containi(szData, "settings") != -1) { iSection = SECTION_SETTINGS } else if (containi(szData, "glows") != -1) { iSection = SECTION_GLOWS } } else continue } default: { switch (iSection) { case SECTION_SETTINGS: { strtok(szData, szKey, charsmax(szKey), szValue, charsmax(szValue), '=') trim(szKey) trim(szValue) if (equal(szKey, "GLOW_COMMANDS")) { while (szValue[0] != 0 && strtok(szValue, szKey, charsmax(szKey), szValue, charsmax(szValue), ',')) { trim(szKey) trim(szValue) register_clcmd(szKey, "cmdGlowMenu") } } else if (equal(szKey, "GLOW_PREFIX")) { CC_SetPrefix(szValue) } else if (equal(szKey, "GLOW_TEAM")) { g_eSettings[GLOW_TEAM] = clamp(str_to_num(szValue), 1, 3) } else if (equal(szKey, "GLOW_FLAG")) { g_eSettings[GLOW_FLAG] = szValue[0] == EOS ? ADMIN_ALL : read_flags(szValue) } else if (equal(szKey, "GLOW_TITLE")) { copy(g_eSettings[GLOW_TITLE], charsmax(g_eSettings[GLOW_TITLE]), szValue) } else if (equal(szKey, "GLOW_TITLE_PAGE")) { copy(g_eSettings[GLOW_TITLE_PAGE], charsmax(g_eSettings[GLOW_TITLE_PAGE]), szValue) } else if (equal(szKey, "GLOW_BACK_NAME")) { copy(g_eSettings[GLOW_BACK_NAME], charsmax(g_eSettings[GLOW_BACK_NAME]), szValue) } else if (equal(szKey, "GLOW_NEXT_NAME")) { copy(g_eSettings[GLOW_NEXT_NAME], charsmax(g_eSettings[GLOW_NEXT_NAME]), szValue) } else if (equal(szKey, "GLOW_EXIT_NAME")) { copy(g_eSettings[GLOW_EXIT_NAME], charsmax(g_eSettings[GLOW_EXIT_NAME]), szValue) } else if (equal(szKey, "GLOW_PER_PAGE")) { g_eSettings[GLOW_PER_PAGE] = clamp(str_to_num(szValue), 0, 7) } else if (equal(szKey, "GLOW_MESSAGE_TYPE")) { g_eSettings[GLOW_MESSAGE_TYPE] = clamp(str_to_num(szValue), 0, 2) } else if (equal(szKey, "GLOW_HUD_X")) { g_eSettings[GLOW_HUD_X] = _:floatclamp(str_to_float(szValue), -1.0, 1.0) } else if (equal(szKey, "GLOW_HUD_Y")) { g_eSettings[GLOW_HUD_Y] = _:floatclamp(str_to_float(szValue), -1.0, 1.0) } else if (equal(szKey, "GLOW_HUD_EFFECTS")) { g_eSettings[GLOW_HUD_EFFECTS] = clamp(str_to_num(szValue), 0, 2) } else if (equal(szKey, "GLOW_HUD_EFFTIME")) { g_eSettings[GLOW_HUD_EFFTIME] = _:str_to_float(szValue) } else if (equal(szKey, "GLOW_HUD_HOLDTIME")) { g_eSettings[GLOW_HUD_HOLDTIME] = _:str_to_float(szValue) } } case SECTION_GLOWS: { strtok(szData, eGlows[NAME], charsmax(eGlows[NAME]), szValue, charsmax(szValue), '=') trim(eGlows[NAME]) trim(szValue) static szColor[3][4] parse(szValue, szColor[0], charsmax(szColor[]), szColor[1], charsmax(szColor[]), szColor[2], charsmax(szColor[])) for (i = 0; i < 3; i++) { eGlows[COLOR][i] = clamp(str_to_num(szColor[i]), 0, 255) } ArrayPushArray(g_aGlows, eGlows) } } } } } fclose(iFilePointer) } } public client_putinserver(id) { g_iGlow[id] = 0 } public cmdGlowMenu(id) { if (~get_user_flags(id) & g_eSettings[GLOW_FLAG]) { CC_SendMessage(id, "%L", id, "GLOW_NOACCESS") return PLUGIN_HANDLED } if (get_user_team(id) != g_eSettings[GLOW_TEAM] && g_eSettings[GLOW_TEAM] != EOS) { CC_SendMessage(id, "%L", id, "GLOW_NOTEAM") return PLUGIN_HANDLED } static szTitle[128], iMenu, i, eGlows[Glows] ArrayGetArray(g_aGlows, g_iGlow[id], eGlows) formatex(szTitle, charsmax(szTitle), g_eSettings[GLOW_TITLE], eGlows[NAME]) replace_all(szTitle, charsmax(szTitle), "\n", "^n") replace_all(g_eSettings[GLOW_TITLE_PAGE], charsmax(g_eSettings[GLOW_TITLE_PAGE]), "\n", "^n") iMenu = menu_create(szTitle, "handlerGlowMenu") for (i = 0; i < ArraySize(g_aGlows); i++) { ArrayGetArray(g_aGlows, i, eGlows) menu_additem(iMenu, formatin("%s %s", eGlows[NAME], g_iGlow[id] == i ? formatin("%L", id, "GLOW_SELECTED") : formatin(""))) } if (menu_pages(iMenu) > 1) { menu_setprop(iMenu, MPROP_TITLE, formatin("%s%s", szTitle, g_eSettings[GLOW_TITLE_PAGE])) } menu_setprop(iMenu, MPROP_BACKNAME, g_eSettings[GLOW_BACK_NAME]) menu_setprop(iMenu, MPROP_NEXTNAME, g_eSettings[GLOW_NEXT_NAME]) menu_setprop(iMenu, MPROP_EXITNAME, g_eSettings[GLOW_EXIT_NAME]) menu_setprop(iMenu, MPROP_PERPAGE, g_eSettings[GLOW_PER_PAGE]) menu_display(id, iMenu, 0) return PLUGIN_HANDLED } public handlerGlowMenu(id, iMenu, iItem) { if (iItem != MENU_EXIT) { static eGlows[Glows], szHudText[128] ArrayGetArray(g_aGlows, iItem, eGlows) formatex(szHudText, charsmax(szHudText), "%L", id, "GLOW_ONSELECT_HUD", eGlows[NAME]) if (iItem == 0) { g_iGlow[id] = 0 set_user_rendering(id) CC_SendMessage(id, "%L", id, "GLOW_REMOVE") return PLUGIN_HANDLED } if (g_iGlow[id] == iItem) { CC_SendMessage(id, "%L", id, "GLOW_ALREADY") } else { g_iGlow[id] = iItem set_user_rendering(id, kRenderFxGlowShell, eGlows[COLOR][0], eGlows[COLOR][1], eGlows[COLOR][2]) switch (g_eSettings[GLOW_MESSAGE_TYPE]) { case 0: CC_SendMessage(id, "%L", id, "GLOW_ONSELECT_CHAT", eGlows[NAME]) case 1: { set_hudmessage(eGlows[COLOR][0], eGlows[COLOR][1], eGlows[COLOR][2], g_eSettings[GLOW_HUD_X], g_eSettings[GLOW_HUD_Y], g_eSettings[GLOW_HUD_EFFECTS], g_eSettings[GLOW_HUD_EFFTIME], g_eSettings[GLOW_HUD_HOLDTIME]) show_hudmessage(id, szHudText) } case 2: { set_dhudmessage(eGlows[COLOR][0], eGlows[COLOR][1], eGlows[COLOR][2], g_eSettings[GLOW_HUD_X], g_eSettings[GLOW_HUD_Y], g_eSettings[GLOW_HUD_EFFECTS], g_eSettings[GLOW_HUD_EFFTIME], g_eSettings[GLOW_HUD_HOLDTIME]) show_dhudmessage(id, szHudText) } } } } menu_destroy(iMenu) return PLUGIN_HANDLED } Przeczytaj cały wpis
  5. Hello, community, I'm searching for a plugin or a sprite to modify to make the smoke don't bee so transparent, because it makes the gameplay so bad that people can see through it at Mix 5vs5. Thanks. Przeczytaj cały wpis
  6. MYGO.pl

    RSSHelmet

    terrorist team red helmet ct team green helmet attachment as in the picture is there an addon Attached Thumbnails Przeczytaj cały wpis
  7. How i replace New Zp extra item in Privilege Menu Attached Thumbnails Przeczytaj cały wpis
  8. MYGO.pl

    RSSno scope

    I want this plugin to pass information as hud, like csay for example, and I would like the text to be in green color Attached Files Get Plugin or Get Source (nsq_detector.sma - 2.7 KB) Przeczytaj cały wpis
  9. Description You can shoot common infected legs to stumble them. YouTube link ConVars sm_common_stumble_chance - chance of stumble (default 100) sm_common_stumble_speed_min - minimum infected speed to stumble (default 200) sm_common_stumble_weapons - what weapons can stumble infected, this is combination of weapon ids (default "6;10") RequiredActions 3.0 Left 4 DHooks Weapons IDS PHP Code: enum L4D2WeaponId { L4D2WeaponId_None, // 0 L4D2WeaponId_Pistol, // 1 L4D2WeaponId_Smg, // 2 L4D2WeaponId_Pumpshotgun, // 3 L4D2WeaponId_Autoshotgun, // 4 L4D2WeaponId_Rifle, // 5 L4D2WeaponId_HuntingRifle, // 6 L4D2WeaponId_SmgSilenced, // 7 L4D2WeaponId_ShotgunChrome, // 8 L4D2WeaponId_RifleDesert, // 9 L4D2WeaponId_SniperMilitary, // 10 L4D2WeaponId_ShotgunSpas, // 11 L4D2WeaponId_FirstAidKit, // 12 L4D2WeaponId_Molotov, // 13 L4D2WeaponId_PipeBomb, // 14 L4D2WeaponId_PainPills, // 15 L4D2WeaponId_Gascan, // 16 L4D2WeaponId_PropaneTank, // 17 L4D2WeaponId_OxygenTank, // 18 L4D2WeaponId_Melee, // 19 L4D2WeaponId_Chainsaw, // 20 L4D2WeaponId_GrenadeLauncher, // 21 L4D2WeaponId_AmmoPack, // 22 L4D2WeaponId_Adrenaline, // 23 L4D2WeaponId_Defibrillator, // 24 L4D2WeaponId_Vomitjar, // 25 L4D2WeaponId_RifleAK47, // 26 L4D2WeaponId_GnomeChompski, // 27 L4D2WeaponId_ColaBottles, // 28 L4D2WeaponId_FireworksBox, // 29 L4D2WeaponId_IncendiaryAmmo, // 30 L4D2WeaponId_FragAmmo, // 31 L4D2WeaponId_PistolMagnum, // 32 L4D2WeaponId_SmgMP5, // 33 L4D2WeaponId_RifleSG552, // 34 L4D2WeaponId_SniperAWP, // 35 L4D2WeaponId_SniperScout, // 36 L4D2WeaponId_RifleM60, // 37 L4D2WeaponId_TankClaw, // 38 L4D2WeaponId_HunterClaw, // 39 L4D2WeaponId_ChargerClaw, // 40 L4D2WeaponId_BoomerClaw, // 41 L4D2WeaponId_SmokerClaw, // 42 L4D2WeaponId_SpitterClaw, // 43 L4D2WeaponId_JockeyClaw, // 44 L4D2WeaponId_Machinegun, // 45 L4D2WeaponId_FatalVomit, // 46 L4D2WeaponId_ExplodingSplat, // 47 L4D2WeaponId_LungePounce, // 48 L4D2WeaponId_Lounge, // 49 L4D2WeaponId_FullPull, // 50 L4D2WeaponId_Choke, // 51 L4D2WeaponId_ThrowingRock, // 52 L4D2WeaponId_TurboPhysics, // 53 L4D2WeaponId_Ammo, // 54 L4D2WeaponId_UpgradeItem, // 55 L4D2WeaponId_MAX }; Attached Files l4d2_infected_stumble.txt (1.0 KB) Get Plugin or Get Source (l4d2_infected_stumble.sp - 9.6 KB) l4d2_infected_stumble.smx (12.4 KB) Wyświetl pełny artykuł
  10. This is a soccer jam plugin. I keep getting this error after a player scores a goal. [AMXX] Displaying debug trace (plugin "Sj-Pro.amxx", version "6.0b") [AMXX] Run time error 4: index out of bounds [AMXX] [0] Sj-Pro.sma::touchNet (line 1891) 1886 PHP Code: public touchNet(ball, goalpost) 1887 { 1888 remove_task(55555) 1889 1890 new team = get_user_team(ballowner) 1891 new golent = GoalEnt[team] What should I modify? Przeczytaj cały wpis
  11. This mute plugin is always giving me errors along these lines: Player 14 is not in game. [AMXX] Displaying debug trace (plugin "Mute.amxx", version "1.0") [AMXX] Run time error 10: native error (native "menu_display") [AMXX] [0] Mute.sma::clcmd_mute (line 73) [AMXX] [1] Mute.sma::handled_show_players (line 173) PHP Code: 62 public clcmd_mute(id) 63 { 64 static menu; 65 menu = menu_create("\r[MUTE] \yMute menu", "handled_clcmd_mute"); 66 67 menu_additem(menu, "Mute microphone", "1", 0); 68 menu_additem(menu, "Mute chat", "2", 0); 69 70 if (get_user_flags(id) & ADMIN_MENU) 71 menu_additem(menu, "Gag menu", "3", 0); 72 73 menu_display(id, menu); 74 return PLUGIN_HANDLED; 75 } 169 public handled_show_players(id, menu, item) 170 { 171 if (item == MENU_EXIT) 172 { 173 clcmd_mute(id); 174 return; 175 } Any ideas of what I need to add or take? Let me know if you guys need the whole code! Thanks. Przeczytaj cały wpis
  12. NOTE: Although this plugin would work on any mod, there's currently only gamedata for TF2. Pull requests welcome! This plugin allows for customization of the server info text that's sent to clients each time they connect. Format:Values are inserted with printf format specifiers. Since this plugin does not modify the internal snprintf call at all, you have the following values at your disposal (in this order): [ Game description (%s), Map name (%s), Current players (%d), Max players (%d), Build number (%d), Server number (%d) ] Using less values than those available is okay (e.g. omitting the last specifier for server number). String values can be skipped using "%.s". CVars:serverinfotext_version - plugin version Dependencies:Source Scramble Installation:Make sure you have Source Scramble installed. Place the plugin in sourcemod/plugins and the gamedata file in sourcemod/gamedata. Create a file named infotext.txt in sourcemod/configs with your custom text. An example config is provided below. Load the plugin as normal. Plugin must be reloaded for config changes to take effect. Thanks to Zabaniya / Suza for teaching me how to use Source Scramble properly. Download plugin (serverinfotext.smx) Download gamedata (serverinfotext.txt) Download example config (infotext.txt) View source (serverinfotext.sp) Wyświetl pełny artykuł
  13. Forum: Unapproved Plugins Posted By: kxifshk Post Time: 05-06-2023 at 15:22Wyświetl pełny artykuł
  14. Hi, everyone. In my server some admins are "anonymous", so is it possible to make that the "show_activity_key" feature work only for admins with the "ADMIN_KICK" flag? My amx_show_activity is set to 2. I want everyone to see everything but if the admin is lacking the ADMIN_KICK flag then I want no one to see anything. Thanks! PHP Code: // vim: set ts=4 sw=4 tw=99 noet: // // AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). // Copyright (C) The AMX Mod X Development Team. // // This software is licensed under the GNU General Public License, version 3 or higher. // Additional exceptions apply. For full license details, see LICENSE.txt or visit: // https://alliedmods.net/amxmodx-license // // Admin Commands Plugin // #include <amxmodx> #include <amxmisc> // This is not a dynamic array because it would be bad for 24/7 map servers. #define OLD_CONNECTION_QUEUE 10 new g_pauseCon new Float:g_pausAble new bool:g_Paused new bool:g_PauseAllowed = false new pausable; new rcon_password; new timelimit; new p_amx_tempban_maxtime; // Old connection queue new g_Names[OLD_CONNECTION_QUEUE][MAX_NAME_LENGTH]; new g_SteamIDs[OLD_CONNECTION_QUEUE][32]; new g_IPs[OLD_CONNECTION_QUEUE][32]; new g_Access[OLD_CONNECTION_QUEUE]; new g_Tracker; new g_Size; public Trie:g_tempBans new Trie:g_tXvarsFlags; stock InsertInfo(id) { // Scan to see if this entry is the last entry in the list // If it is, then update the name and access // If it is not, then insert it again. if (g_Size > 0) { new ip[32] new auth[32]; get_user_authid(id, auth, charsmax(auth)); get_user_ip(id, ip, charsmax(ip), 1/*no port*/); new last = 0; if (g_Size < sizeof(g_SteamIDs)) { last = g_Size - 1; } else { last = g_Tracker - 1; if (last < 0) { last = g_Size - 1; } } if (equal(auth, g_SteamIDs[last]) && equal(ip, g_IPs[last])) // need to check ip too, or all the nosteams will while it doesn't work with their illegitimate server { get_user_name(id, g_Names[last], charsmax(g_Names[])); g_Access[last] = get_user_flags(id); return; } } // Need to insert the entry new target = 0; // the slot to save the info at // Queue is not yet full if (g_Size < sizeof(g_SteamIDs)) { target = g_Size; ++g_Size; } else { target = g_Tracker; ++g_Tracker; // If we reached the end of the array, then move to the front if (g_Tracker == sizeof(g_SteamIDs)) { g_Tracker = 0; } } get_user_authid(id, g_SteamIDs[target], charsmax(g_SteamIDs[])); get_user_name(id, g_Names[target], charsmax(g_Names[])); get_user_ip(id, g_IPs[target], charsmax(g_IPs[]), 1/*no port*/); g_Access[target] = get_user_flags(id); } stock GetInfo(i, name[], namesize, auth[], authsize, ip[], ipsize, &access) { if (i >= g_Size) { abort(AMX_ERR_NATIVE, "GetInfo: Out of bounds (%d:%d)", i, g_Size); } new target = (g_Tracker + i) % sizeof(g_SteamIDs); copy(name, namesize, g_Names[target]); copy(auth, authsize, g_SteamIDs[target]); copy(ip, ipsize, g_IPs[target]); access = g_Access[target]; } public client_disconnected(id) { if (!is_user_bot(id)) { InsertInfo(id); } } public plugin_init() { register_plugin("Admin Commands", AMXX_VERSION_STR, "AMXX Dev Team") register_dictionary("admincmd.txt") register_dictionary("common.txt") register_dictionary("adminhelp.txt") register_concmd("amx_kick", "cmdKick", ADMIN_KICK, "<name or #userid> [reason]") register_concmd("amx_ban", "cmdBan", ADMIN_BAN|ADMIN_BAN_TEMP, "<name or #userid> <minutes> [reason]") register_concmd("amx_banip", "cmdBanIP", ADMIN_BAN|ADMIN_BAN_TEMP, "<name or #userid> <minutes> [reason]") register_concmd("amx_addban", "cmdAddBan", ADMIN_BAN, "<^"authid^" or ip> <minutes> [reason]") register_concmd("amx_unban", "cmdUnban", ADMIN_BAN|ADMIN_BAN_TEMP, "<^"authid^" or ip>") register_concmd("amx_slay", "cmdSlay", ADMIN_SLAY, "<name or #userid>") register_concmd("amx_slap", "cmdSlap", ADMIN_SLAY, "<name or #userid> [power]") register_concmd("amx_leave", "cmdLeave", ADMIN_KICK, "<tag> [tag] [tag] [tag]") register_concmd("amx_pause", "cmdPause", ADMIN_CVAR, "- pause or unpause the game") register_concmd("amx_who", "cmdWho", ADMIN_ADMIN, "- displays who is on server") register_concmd("amx_cvar", "cmdCvar", ADMIN_CVAR, "<cvar> [value]") register_concmd("amx_xvar_float", "cmdXvar", ADMIN_CVAR, "<xvar> [value]") register_concmd("amx_xvar_int", "cmdXvar", ADMIN_CVAR, "<xvar> [value]") register_concmd("amx_plugins", "cmdPlugins", ADMIN_ADMIN) register_concmd("amx_modules", "cmdModules", ADMIN_ADMIN) register_concmd("amx_map", "cmdMap", ADMIN_MAP, "<mapname>") register_concmd("amx_extendmap", "cmdExtendMap", ADMIN_MAP, "<number of minutes> - extend map") register_concmd("amx_cfg", "cmdCfg", ADMIN_CFG, "<filename>") register_concmd("amx_nick", "cmdNick", ADMIN_SLAY, "<name or #userid> <new nick>") register_concmd("amx_last", "cmdLast", ADMIN_BAN, "- list the last few disconnected clients info"); register_clcmd("amx_rcon", "cmdRcon", ADMIN_RCON, "<command line>") register_clcmd("amx_showrcon", "cmdShowRcon", ADMIN_RCON, "<command line>") register_clcmd("pauseAck", "cmdLBack") rcon_password=get_cvar_pointer("rcon_password"); pausable=get_cvar_pointer("pausable"); timelimit=get_cvar_pointer( "mp_timelimit" ); p_amx_tempban_maxtime = register_cvar("amx_tempban_maxtime", "4320", FCVAR_PROTECTED); g_tempBans = TrieCreate(); new flags = get_pcvar_flags(rcon_password); if (!(flags & FCVAR_PROTECTED)) { set_pcvar_flags(rcon_password, flags | FCVAR_PROTECTED); } } public cmdKick(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32] read_argv(1, arg, charsmax(arg)) new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF) if (!player) return PLUGIN_HANDLED new authid[32], authid2[32], name2[MAX_NAME_LENGTH], name[MAX_NAME_LENGTH], userid2, reason[32] get_user_authid(id, authid, charsmax(authid)) get_user_authid(player, authid2, charsmax(authid2)) get_user_name(player, name2, charsmax(name2)) get_user_name(id, name, charsmax(name)) userid2 = get_user_userid(player) read_argv(2, reason, charsmax(reason)) remove_quotes(reason) log_amx("Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^" (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, reason) show_activity_key("ADMIN_KICK_1", "ADMIN_KICK_2", name, name2); if (is_user_bot(player)) server_cmd("kick #%d", userid2) else { if (reason[0]) server_cmd("kick #%d ^"%s^"", userid2, reason) else server_cmd("kick #%d", userid2) } console_print(id, "[AMXX] Client ^"%s^" kicked", name2) return PLUGIN_HANDLED } /** * ';' and '^n' are command delimiters. If a command arg contains these 2 * it is not safe to be passed to server_cmd() as it may be trying to execute * a command. */ isCommandArgSafe(const arg[]) { return contain(arg, ";") == -1 && contain(arg, "^n") == -1; } public cmdUnban(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32], authid[32], name[MAX_NAME_LENGTH] read_argv(1, arg, charsmax(arg)) get_user_authid(id, authid, charsmax(authid)) if( !(get_user_flags(id) & ( ADMIN_BAN | ADMIN_RCON )) ) { new storedAdminAuth[32] if( !TrieGetString(g_tempBans, arg, storedAdminAuth, charsmax(storedAdminAuth)) || !equal(storedAdminAuth, authid) ) { console_print(id, "%L", id, "ADMIN_MUST_TEMPUNBAN"); return PLUGIN_HANDLED; } } if (contain(arg, ".") != -1) { server_cmd("removeip ^"%s^";writeip", arg) console_print(id, "[AMXX] %L", id, "IP_REMOVED", arg) } else { if(!isCommandArgSafe(arg)) { console_print(id, "%l", "CL_NOT_FOUND"); return PLUGIN_HANDLED; } server_cmd("removeid %s;writeid", arg) console_print(id, "[AMXX] %L", id, "AUTHID_REMOVED", arg) } get_user_name(id, name, charsmax(name)) show_activity_key("ADMIN_UNBAN_1", "ADMIN_UNBAN_2", name, arg); log_amx("Cmd: ^"%s<%d><%s><>^" unban ^"%s^"", name, get_user_userid(id), authid, arg) return PLUGIN_HANDLED } /* amx_addban is a special command now. * If a user with rcon uses it, it bans the user. No questions asked. * If a user without rcon but with ADMIN_BAN uses it, it will scan the old * connection queue, and if it finds the info for a player in it, it will * check their old access. If they have immunity, it will not ban. * If they do not have immunity, it will ban. If the user is not found, * it will refuse to ban the target. */ public cmdAddBan(id, level, cid) { if (!cmd_access(id, level, cid, 3, true)) // check for ADMIN_BAN access { if (get_user_flags(id) & level) // Getting here means they didn't input enough args { return PLUGIN_HANDLED; } if (!cmd_access(id, ADMIN_RCON, cid, 3)) // If somehow they have ADMIN_RCON without ADMIN_BAN, continue { return PLUGIN_HANDLED; } } new arg[32], authid[32], name[MAX_NAME_LENGTH], minutes[32], reason[32] read_argv(1, arg, charsmax(arg)) read_argv(2, minutes, charsmax(minutes)) read_argv(3, reason, charsmax(reason)) trim(arg); if (!(get_user_flags(id) & ADMIN_RCON)) { new bool:canban = false; new bool:isip = false; // Limited access to this command if (equali(arg, "STEAM_ID_PENDING") || equali(arg, "STEAM_ID_LAN") || equali(arg, "HLTV") || equali(arg, "4294967295") || equali(arg, "VALVE_ID_LAN") || equali(arg, "VALVE_ID_PENDING")) { // Hopefully we never get here, so ML shouldn't be needed console_print(id, "Cannot ban %s", arg); return PLUGIN_HANDLED; } if (contain(arg, ".") != -1) { isip = true; } // Scan the disconnection queue if (isip) { new IP[32]; new Name[MAX_NAME_LENGTH]; new dummy[1]; new Access; for (new i = 0; i < g_Size; i++) { GetInfo(i, Name, charsmax(Name), dummy, 0, IP, charsmax(IP), Access); if (equal(IP, arg)) { if (Access & ADMIN_IMMUNITY) { console_print(id, "[AMXX] %s : %L", IP, id, "CLIENT_IMM", Name); return PLUGIN_HANDLED; } // User did not have immunity canban = true; } } } else { new Auth[32]; new Name[MAX_NAME_LENGTH]; new dummy[1]; new Access; for (new i = 0; i < g_Size; i++) { GetInfo(i, Name, charsmax(Name), Auth, charsmax(Auth), dummy, 0, Access); if (equal(Auth, arg)) { if (Access & ADMIN_IMMUNITY) { console_print(id, "[AMXX] %s : %L", Auth, id, "CLIENT_IMM", Name); return PLUGIN_HANDLED; } // User did not have immunity canban = true; } } } if (!canban) { console_print(id, "[AMXX] You may only ban recently disconnected clients. Use ^"amx_last^" to view."); return PLUGIN_HANDLED; } } // User has access to ban their target if (contain(arg, ".") != -1) { server_cmd("addip ^"%s^" ^"%s^";wait;writeip", minutes, arg) console_print(id, "[AMXX] Ip ^"%s^" added to ban list", arg) } else { if(!isCommandArgSafe(arg)) { console_print(id, "%l", "CL_NOT_FOUND"); return PLUGIN_HANDLED; } server_cmd("banid ^"%s^" %s;wait;writeid", minutes, arg) console_print(id, "[AMXX] Authid ^"%s^" added to ban list", arg) } get_user_name(id, name, charsmax(name)) show_activity_key("ADMIN_ADDBAN_1", "ADMIN_ADDBAN_2", name, arg); get_user_authid(id, authid, charsmax(authid)) TrieSetString(g_tempBans, arg, authid) log_amx("Cmd: ^"%s<%d><%s><>^" ban ^"%s^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, arg, minutes, reason) return PLUGIN_HANDLED } public cmdBan(id, level, cid) { if (!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED new target[32], minutes[8], reason[64] read_argv(1, target, charsmax(target)) read_argv(2, minutes, charsmax(minutes)) read_argv(3, reason, charsmax(reason)) new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF) if (!player) return PLUGIN_HANDLED new nNum = str_to_num(minutes) new const tempBanMaxTime = get_pcvar_num(p_amx_tempban_maxtime); if( nNum < 0 ) // since negative values result in permanent bans { nNum = 0; minutes = "0"; } if( !(get_user_flags(id) & ( ADMIN_BAN | ADMIN_RCON )) && (nNum <= 0 || nNum > tempBanMaxTime) ) { console_print(id, "%L", id, "ADMIN_MUST_TEMPBAN", tempBanMaxTime); return PLUGIN_HANDLED } new authid[32], name2[MAX_NAME_LENGTH], authid2[32], name[MAX_NAME_LENGTH] new userid2 = get_user_userid(player) get_user_authid(player, authid2, charsmax(authid2)) get_user_authid(id, authid, charsmax(authid)) get_user_name(player, name2, charsmax(name2)) get_user_name(id, name, charsmax(name)) log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, minutes, reason) TrieSetString(g_tempBans, authid2, authid); // store all bans in case a permanent ban would override a temporary one. new temp[64], banned[16] if (nNum) formatex(temp, charsmax(temp), "%L", player, "FOR_MIN", minutes) else formatex(temp, charsmax(temp), "%L", player, "PERM") formatex(banned, charsmax(banned), "%L", player, "BANNED") if (reason[0]) server_cmd("kick #%d ^"%s (%s %s)^";wait;banid %s %s;wait;writeid", userid2, reason, banned, temp, minutes, authid2) else server_cmd("kick #%d ^"%s %s^";wait;banid %s %s;wait;writeid", userid2, banned, temp, minutes, authid2) // Display the message to all clients new msg[256]; new len; new players[MAX_PLAYERS], pnum, plr get_players(players, pnum, "ch") for (new i; i<pnum; i++) { plr = players[i] len = formatex(msg, charsmax(msg), "%L", plr, "BAN"); len += formatex(msg[len], charsmax(msg) - len, " %s ", name2); if (nNum) { len += formatex(msg[len], charsmax(msg) - len, "%L", plr, "FOR_MIN", minutes); } else { len += formatex(msg[len], charsmax(msg) - len, "%L", plr, "PERM"); } if (strlen(reason) > 0) { formatex(msg[len], charsmax(msg) - len, " (%L: %s)", plr, "REASON", reason); } show_activity_id(plr, id, name, msg); } console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2) return PLUGIN_HANDLED } public cmdBanIP(id, level, cid) { if (!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED new target[32], minutes[8], reason[64] read_argv(1, target, charsmax(target)) read_argv(2, minutes, charsmax(minutes)) read_argv(3, reason, charsmax(reason)) new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF) if (!player) return PLUGIN_HANDLED new nNum = str_to_num(minutes) new const tempBanMaxTime = get_pcvar_num(p_amx_tempban_maxtime); if( nNum < 0 ) // since negative values result in permanent bans { nNum = 0; minutes = "0"; } if( !(get_user_flags(id) & ( ADMIN_BAN | ADMIN_RCON )) && (nNum <= 0 || nNum > tempBanMaxTime) ) { console_print(id, "%L", id, "ADMIN_MUST_TEMPBAN", tempBanMaxTime); return PLUGIN_HANDLED } new authid[32], name2[MAX_NAME_LENGTH], authid2[32], name[MAX_NAME_LENGTH] new userid2 = get_user_userid(player) get_user_authid(player, authid2, charsmax(authid2)) get_user_authid(id, authid, charsmax(authid)) get_user_name(player, name2, charsmax(name2)) get_user_name(id, name, charsmax(name)) log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, minutes, reason) TrieSetString(g_tempBans, authid2, authid); new temp[64], banned[16] if (nNum) formatex(temp, charsmax(temp), "%L", player, "FOR_MIN", minutes) else formatex(temp, charsmax(temp), "%L", player, "PERM") format(banned, 15, "%L", player, "BANNED") new address[32] get_user_ip(player, address, charsmax(address), 1) if (reason[0]) server_cmd("kick #%d ^"%s (%s %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip", userid2, reason, banned, temp, minutes, address) else server_cmd("kick #%d ^"%s %s^";wait;addip ^"%s^" ^"%s^";wait;writeip", userid2, banned, temp, minutes, address) // Display the message to all clients new msg[256]; new len; new players[MAX_PLAYERS], pnum, plr get_players(players, pnum, "ch") for (new i; i<pnum; i++) { plr = players[i] len = formatex(msg, charsmax(msg), "%L", plr, "BAN"); len += formatex(msg[len], charsmax(msg) - len, " %s ", name2); if (nNum) { formatex(msg[len], charsmax(msg) - len, "%L", plr, "FOR_MIN", minutes); } else { formatex(msg[len], charsmax(msg) - len, "%L", plr, "PERM"); } if (strlen(reason) > 0) { formatex(msg[len], charsmax(msg) - len, " (%L: %s)", plr, "REASON", reason); } show_activity_id(plr, id, name, msg); } console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2) return PLUGIN_HANDLED } public cmdSlay(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32] read_argv(1, arg, charsmax(arg)) new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE) if (!player) return PLUGIN_HANDLED user_kill(player) new authid[32], name2[MAX_NAME_LENGTH], authid2[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) get_user_authid(player, authid2, charsmax(authid2)) get_user_name(player, name2, charsmax(name2)) log_amx("Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, name2, get_user_userid(player), authid2) show_activity_key("ADMIN_SLAY_1", "ADMIN_SLAY_2", name, name2); console_print(id, "[AMXX] %L", id, "CLIENT_SLAYED", name2) return PLUGIN_HANDLED } public cmdSlap(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32] read_argv(1, arg, charsmax(arg)) new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE) if (!player) return PLUGIN_HANDLED new spower[32], authid[32], name2[MAX_NAME_LENGTH], authid2[32], name[MAX_NAME_LENGTH] read_argv(2, spower, charsmax(spower)) new damage = clamp( str_to_num(spower), 0) user_slap(player, damage) get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) get_user_authid(player, authid2, charsmax(authid2)) get_user_name(player, name2, charsmax(name2)) log_amx("Cmd: ^"%s<%d><%s><>^" slap with %d damage ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, damage, name2, get_user_userid(player), authid2) show_activity_key("ADMIN_SLAP_1", "ADMIN_SLAP_2", name, name2, damage); console_print(id, "[AMXX] %L", id, "CLIENT_SLAPED", name2, damage) return PLUGIN_HANDLED } public chMap(map[]) { engine_changelevel(map); } public cmdMap(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32] new arglen = read_argv(1, arg, charsmax(arg)) if (!is_map_valid(arg) || contain(arg, "..") != -1) { console_print(id, "[AMXX] %L", id, "MAP_NOT_FOUND") return PLUGIN_HANDLED } new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) show_activity_key("ADMIN_MAP_1", "ADMIN_MAP_2", name, arg); log_amx("Cmd: ^"%s<%d><%s><>^" changelevel ^"%s^"", name, get_user_userid(id), authid, arg) new _modName[10] get_modname(_modName, charsmax(_modName)) if (!equal(_modName, "zp")) { message_begin(MSG_ALL, SVC_INTERMISSION) message_end() } set_task(2.0, "chMap", 0, arg, arglen + 1) return PLUGIN_HANDLED } public cmdExtendMap(id, level, cid) { if(!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32] read_argv(1, arg, charsmax(arg)) new mns = str_to_num(arg) if(mns <= 0) return PLUGIN_HANDLED new mapname[32] get_mapname(mapname, charsmax(mapname)) set_pcvar_num( timelimit , get_pcvar_num( timelimit ) + mns) new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) show_activity_key("ADMIN_EXTEND_1", "ADMIN_EXTEND_2", name, mns) log_amx("ExtendMap: ^"%s<%d><%s><>^" extended map ^"%s^" for %d minutes.", name, get_user_userid(id), authid, mapname, mns) console_print(id, "%L", id, "MAP_EXTENDED", mapname, mns) return PLUGIN_HANDLED } stock bool:onlyRcon(const name[]) { new ptr=get_cvar_pointer(name); if (ptr && get_pcvar_flags(ptr) & FCVAR_PROTECTED) { return true; } return false; } public cmdCvar(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[32], arg2[64] read_argv(1, arg, charsmax(arg)) read_argv(2, arg2, charsmax(arg2)) new pointer; if (equal(arg, "add") && (get_user_flags(id) & ADMIN_RCON)) { if ((pointer=get_cvar_pointer(arg2))!=0) { new flags=get_pcvar_flags(pointer); if (!(flags & FCVAR_PROTECTED)) { set_pcvar_flags(pointer,flags | FCVAR_PROTECTED); } } return PLUGIN_HANDLED } trim(arg); if ((pointer=get_cvar_pointer(arg))==0) { console_print(id, "[AMXX] %L", id, "UNKNOWN_CVAR", arg) return PLUGIN_HANDLED } if (onlyRcon(arg) && !(get_user_flags(id) & ADMIN_RCON)) { // Exception for the new onlyRcon rules: // sv_password is allowed to be modified by ADMIN_PASSWORD if (!(equali(arg,"sv_password") && (get_user_flags(id) & ADMIN_PASSWORD))) { console_print(id, "[AMXX] %L", id, "CVAR_NO_ACC") return PLUGIN_HANDLED } } if (read_argc() < 3) { get_pcvar_string(pointer, arg2, charsmax(arg2)) console_print(id, "[AMXX] %L", id, "CVAR_IS", arg, arg2) return PLUGIN_HANDLED } if (equali(arg, "servercfgfile") || equali(arg, "lservercfgfile") || equali(arg, "mapchangecfgfile")) { new pos = contain(arg2, ";") if (pos != -1) { arg2[pos] = '^0' } else if ((pos = contain(arg2, "^n")) != -1) { arg2[pos] = '^0' } } new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) log_amx("Cmd: ^"%s<%d><%s><>^" set cvar (name ^"%s^") (value ^"%s^")", name, get_user_userid(id), authid, arg, arg2) set_pcvar_string(pointer, arg2) // Display the message to all clients new cvar_val[64]; new players[MAX_PLAYERS], pnum, plr get_players(players, pnum, "ch") for (new i; i<pnum; i++) { plr = players[i] if (get_pcvar_flags(pointer) & FCVAR_PROTECTED || equali(arg, "rcon_password")) { formatex(cvar_val, charsmax(cvar_val), "*** %L ***", plr, "PROTECTED"); } else { copy(cvar_val, charsmax(cvar_val), arg2); } show_activity_id(plr, id, name, "%L", plr, "SET_CVAR_TO", "", arg, cvar_val); } console_print(id, "[AMXX] %L", id, "CVAR_CHANGED", arg, arg2) return PLUGIN_HANDLED } public cmdXvar(id, level, cid) { if( !cmd_access(id, level, cid, 2) ) { return PLUGIN_HANDLED; } new cmd[15], arg1[32], arg2[32]; read_argv(0, cmd, charsmax(cmd)); read_argv(1, arg1, charsmax(arg1)); trim(arg1); if( read_argc() > 2 ) { read_argv(2, arg2, charsmax(arg2)); trim(arg2); if( equali(arg1, "add") ) { if( get_user_flags(id) & ADMIN_RCON && xvar_exists(arg2) ) { if( !g_tXvarsFlags ) { g_tXvarsFlags = TrieCreate(); } TrieSetCell(g_tXvarsFlags, arg2, 1); } return PLUGIN_HANDLED; } } new bFloat = equali(cmd, "amx_xvar_float"); new xvar = get_xvar_id( arg1 ); if( xvar == -1 ) { console_print(id, "[AMXX] %L", id, "UNKNOWN_XVAR", arg1) return PLUGIN_HANDLED } new any:value; if( !arg2[0] ) // get value { value = get_xvar_num(xvar); if( bFloat ) { float_to_str(value, arg2, charsmax(arg2)); } else { num_to_str(value, arg2, charsmax(arg2)); } console_print(id, "[AMXX] %L", id, "XVAR_IS", arg1, arg2); return PLUGIN_HANDLED; } // set value if( g_tXvarsFlags && TrieKeyExists(g_tXvarsFlags, arg1) && ~get_user_flags(id) & ADMIN_RCON ) { console_print(id, "[AMXX] %L", id, "XVAR_NO_ACC"); return PLUGIN_HANDLED; } new endPos; if( bFloat ) { value = strtof(arg2, endPos); if( !endPos ) { return PLUGIN_HANDLED; } } else { value = strtol(arg2, endPos); if( !endPos ) { return PLUGIN_HANDLED; } } set_xvar_num(xvar, value); // convert back value to string so admin can know value has been set correctly if( bFloat ) { float_to_str(value, arg2, charsmax(arg2)); } else { num_to_str(value, arg2, charsmax(arg2)); } new authid[32], name[MAX_NAME_LENGTH]; get_user_authid(id, authid, charsmax(authid)); get_user_name(id, name, charsmax(name)); log_amx("Cmd: ^"%s<%d><%s><>^" set xvar (name ^"%s^") (value ^"%s^")", name, get_user_userid(id), authid, arg1, arg2); // Display the message to all clients new players[MAX_PLAYERS], pnum, plr; get_players(players, pnum, "ch"); for (new i; i<pnum; i++) { plr = players[i]; show_activity_id(plr, id, name, "%L", plr, "SET_XVAR_TO", "", arg1, arg2); } console_print(id, "[AMXX] %L", id, "XVAR_CHANGED", arg1, arg2); return PLUGIN_HANDLED; } public cmdPlugins(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED if (id==0) // If server executes redirect this to "amxx plugins" for more in depth output { server_cmd("amxx plugins"); server_exec(); return PLUGIN_HANDLED; } new name[MAX_NAME_LENGTH], version[32], author[32], filename[32], status[32] new lName[32], lVersion[32], lAuthor[32], lFile[32], lStatus[32] format(lName, charsmax(lName), "%L", id, "NAME") format(lVersion, charsmax(lVersion), "%L", id, "VERSION") format(lAuthor, charsmax(lAuthor), "%L", id, "AUTHOR") format(lFile, charsmax(lFile), "%L", id, "FILE") format(lStatus, charsmax(lStatus), "%L", id, "STATUS") new StartPLID=0; new EndPLID; new Temp[96] new num = get_pluginsnum() if (read_argc() > 1) { read_argv(1,Temp,charsmax(Temp)); StartPLID=str_to_num(Temp)-1; // zero-based } EndPLID=min(StartPLID + 10, num); new running = 0 console_print(id, "----- %L -----", id, "LOADED_PLUGINS") console_print(id, "%-18.17s %-11.10s %-17.16s %-16.15s %-9.8s", lName, lVersion, lAuthor, lFile, lStatus) new i=StartPLID; while (i <EndPLID) { get_plugin(i++, filename, charsmax(filename), name, charsmax(name), version, charsmax(version), author, charsmax(author), status, charsmax(status)) console_print(id, "%-18.17s %-11.10s %-17.16s %-16.15s %-9.8s", name, version, author, filename, status) if (status[0]=='d' || status[0]=='r') // "debug" or "running" running++ } console_print(id, "%L", id, "PLUGINS_RUN", EndPLID-StartPLID, running) console_print(id, "----- %L -----",id,"HELP_ENTRIES",StartPLID + 1,EndPLID,num); if (EndPLID < num) { formatex(Temp,charsmax(Temp),"----- %L -----",id,"HELP_USE_MORE", "amx_help", EndPLID + 1); replace_all(Temp,charsmax(Temp),"amx_help","amx_plugins"); console_print(id,"%s",Temp); } else { formatex(Temp,charsmax(Temp),"----- %L -----",id,"HELP_USE_BEGIN", "amx_help"); replace_all(Temp,charsmax(Temp),"amx_help","amx_plugins"); console_print(id,"%s",Temp); } return PLUGIN_HANDLED } public cmdModules(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED new name[32], version[32], author[32], status, sStatus[16] new lName[32], lVersion[32], lAuthor[32], lStatus[32]; format(lName, charsmax(lName), "%L", id, "NAME") format(lVersion, charsmax(lVersion), "%L", id, "VERSION") format(lAuthor, charsmax(lAuthor), "%L", id, "AUTHOR") format(lStatus, charsmax(lStatus), "%L", id, "STATUS") new num = get_modulesnum() console_print(id, "%L:", id, "LOADED_MODULES") console_print(id, "%-23.22s %-11.10s %-20.19s %-11.10s", lName, lVersion, lAuthor, lStatus) for (new i = 0; i < num; i++) { get_module(i, name, charsmax(name), author, charsmax(author), version, charsmax(version), status) switch (status) { case module_loaded: copy(sStatus, charsmax(sStatus), "running") default: { copy(sStatus, charsmax(sStatus), "bad load"); copy(name, charsmax(name), "unknown"); copy(author, charsmax(author), "unknown"); copy(version, charsmax(version), "unknown"); } } console_print(id, "%-23.22s %-11.10s %-20.19s %-11.10s", name, version, author, sStatus) } console_print(id, "%L", id, "NUM_MODULES", num) return PLUGIN_HANDLED } public cmdCfg(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[128] read_argv(1, arg, charsmax(arg)) if (!file_exists(arg)) { console_print(id, "[AMXX] %L", id, "FILE_NOT_FOUND", arg) return PLUGIN_HANDLED } new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) log_amx("Cmd: ^"%s<%d><%s><>^" execute cfg (file ^"%s^")", name, get_user_userid(id), authid, arg) console_print(id, "[AMXX] Executing file ^"%s^"", arg) server_cmd("exec ^"%s^"", arg) show_activity_key("ADMIN_CONF_1", "ADMIN_CONF_2", name, arg); return PLUGIN_HANDLED } public cmdLBack() { if (!g_PauseAllowed) return PLUGIN_CONTINUE new paused[25] format(paused, 24, "%L", g_pauseCon, g_Paused ? "UNPAUSED" : "PAUSED") set_pcvar_float(pausable, g_pausAble) console_print(g_pauseCon, "[AMXX] Server %s", paused) g_PauseAllowed = false if (g_Paused) g_Paused = false else g_Paused = true return PLUGIN_HANDLED } public cmdPause(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED new authid[32], name[MAX_NAME_LENGTH], slayer = id get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) if (pausable!=0) { g_pausAble = get_pcvar_float(pausable) } if (!slayer) slayer = find_player("h") if (!slayer) { console_print(id, "[AMXX] %L", id, "UNABLE_PAUSE") return PLUGIN_HANDLED } set_pcvar_float(pausable, 1.0) g_PauseAllowed = true client_cmd(slayer, "pause;pauseAck") log_amx("Cmd: ^"%s<%d><%s><>^" %s server", name, get_user_userid(id), authid, g_Paused ? "unpause" : "pause") console_print(id, "[AMXX] %L", id, g_Paused ? "UNPAUSING" : "PAUSING") // Display the message to all clients new players[MAX_PLAYERS], pnum get_players(players, pnum, "ch") for (new i; i<pnum; i++) { show_activity_id(players[i], id, name, "%L server", i, g_Paused ? "UNPAUSE" : "PAUSE"); } g_pauseCon = id return PLUGIN_HANDLED } public cmdShowRcon(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new password[64] get_pcvar_string(rcon_password, password, charsmax(password)) if (!password[0]) { cmdRcon(id, level, cid) } else { new args[128] read_args(args, charsmax(args)) client_cmd(id, "rcon_password %s", password) client_cmd(id, "rcon %s", args) } return PLUGIN_HANDLED } public cmdRcon(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new arg[128], authid[32], name[MAX_NAME_LENGTH] read_args(arg, charsmax(arg)) get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) log_amx("Cmd: ^"%s<%d><%s><>^" server console (cmdline ^"%s^")", name, get_user_userid(id), authid, arg) console_print(id, "[AMXX] %L", id, "COM_SENT_SERVER", arg) server_cmd("%s", arg) return PLUGIN_HANDLED } public cmdWho(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED new players[MAX_PLAYERS], inum, cl_on_server[64], authid[32], name[MAX_NAME_LENGTH], flags, sflags[32], plr new lImm[16], lRes[16], lAccess[16], lYes[16], lNo[16] formatex(lImm, charsmax(lImm), "%L", id, "IMMU") formatex(lRes, charsmax(lRes), "%L", id, "RESERV") formatex(lAccess, charsmax(lAccess), "%L", id, "ACCESS") formatex(lYes, charsmax(lYes), "%L", id, "YES") formatex(lNo, charsmax(lNo), "%L", id, "NO") get_players(players, inum) format(cl_on_server, charsmax(cl_on_server), "%L", id, "CLIENTS_ON_SERVER") console_print(id, "^n%s:^n # %-16.15s %-20s %-8s %-4.3s %-4.3s %s", cl_on_server, "nick", "authid", "userid", lImm, lRes, lAccess) for (new a = 0; a < inum; ++a) { plr = players[a] get_user_authid(plr, authid, charsmax(authid)) get_user_name(plr, name, charsmax(name)) flags = get_user_flags(plr) get_flags(flags, sflags, charsmax(sflags)) console_print(id, "%2d %-16.15s %-20s %-8d %-6.5s %-6.5s %s", plr, name, authid, get_user_userid(plr), (flags&ADMIN_IMMUNITY) ? lYes : lNo, (flags&ADMIN_RESERVATION) ? lYes : lNo, sflags) } console_print(id, "%L", id, "TOTAL_NUM", inum) get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) log_amx("Cmd: ^"%s<%d><%s><>^" ask for players list", name, get_user_userid(id), authid) return PLUGIN_HANDLED } hasTag(name[], tags[4][32], tagsNum) { for (new a = 0; a < tagsNum; ++a) if (contain(name, tags[a]) != -1) return a return -1 } public cmdLeave(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new argnum = read_argc() new ltags[4][32] new ltagsnum = 0 for (new a = 1; a < 5; ++a) { if (a < argnum) read_argv(a, ltags[ltagsnum++], charsmax(ltags[])) else ltags[ltagsnum++][0] = 0 } new nick[MAX_NAME_LENGTH], ires, pnum = MaxClients, count = 0, lReason[128] for (new b = 1; b <= pnum; ++b) { if (!is_user_connected(b) && !is_user_connecting(b)) continue get_user_name(b, nick, charsmax(nick)) ires = hasTag(nick, ltags, ltagsnum) if (ires != -1) { console_print(id, "[AMXX] %L", id, "SKIP_MATCH", nick, ltags[ires]) continue } if (get_user_flags(b) & ADMIN_IMMUNITY) { console_print(id, "[AMXX] %L", id, "SKIP_IMM", nick) continue } console_print(id, "[AMXX] %L", id, "KICK_PL", nick) if (is_user_bot(b)) server_cmd("kick #%d", get_user_userid(b)) else { formatex(lReason, charsmax(lReason), "%L", b, "YOU_DROPPED") server_cmd("kick #%d ^"%s^"", get_user_userid(b), lReason) } count++ } console_print(id, "[AMXX] %L", id, "KICKED_CLIENTS", count) new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) log_amx("Kick: ^"%s<%d><%s><>^" leave some group (tag1 ^"%s^") (tag2 ^"%s^") (tag3 ^"%s^") (tag4 ^"%s^")", name, get_user_userid(id), authid, ltags[0], ltags[1], ltags[2], ltags[3]) show_activity_key("ADMIN_LEAVE_1", "ADMIN_LEAVE_2", name, ltags[0], ltags[1], ltags[2], ltags[3]); return PLUGIN_HANDLED } public cmdNick(id, level, cid) { if (!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED new arg1[32], arg2[32], authid[32], name[32], authid2[32], name2[32] read_argv(1, arg1, charsmax(arg1)) read_argv(2, arg2, charsmax(arg2)) new player = cmd_target(id, arg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF) if (!player) return PLUGIN_HANDLED get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) get_user_authid(player, authid2, charsmax(authid2)) get_user_name(player, name2, charsmax(name2)) set_user_info(player, "name", arg2) log_amx("Cmd: ^"%s<%d><%s><>^" change nick to ^"%s^" ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, arg2, name2, get_user_userid(player), authid2) show_activity_key("ADMIN_NICK_1", "ADMIN_NICK_2", name, name2, arg2); console_print(id, "[AMXX] %L", id, "CHANGED_NICK", name2, arg2) return PLUGIN_HANDLED } public cmdLast(id, level, cid) { if (!cmd_access(id, level, cid, 1)) { return PLUGIN_HANDLED; } new name[MAX_NAME_LENGTH]; new authid[32]; new ip[32]; new flags[32]; new access; // This alignment is a bit weird (it should grow if the name is larger) // but otherwise for the more common shorter name, it'll wrap in server console // Steam client display is all skewed anyway because of the non fixed font. console_print(id, "%19s %20s %15s %s", "name", "authid", "ip", "access"); for (new i = 0; i < g_Size; i++) { GetInfo(i, name, charsmax(name), authid, charsmax(authid), ip, charsmax(ip), access); get_flags(access, flags, charsmax(flags)); console_print(id, "%19s %20s %15s %s", name, authid, ip, flags); } console_print(id, "%d old connections saved.", g_Size); return PLUGIN_HANDLED; } public plugin_end() { TrieDestroy(g_tempBans); TrieDestroy(g_tXvarsFlags); } Przeczytaj cały wpis
  15. Hello I want the xp plugin set as hud above in this plugin to be on top of the remaining time on the map as hud, can anyone do it? Attached Files Get Plugin or Get Source (crx_ranksystem.sma - 49.7 KB) Przeczytaj cały wpis
  16. Hello friends, I want to prevent players from dropping their weapons. Please can anyone help me? Przeczytaj cały wpis
  17. MYGO.pl

    RSSchat sql

    Is there a good plugin for save chat with sq ? I found this plugin, but it is a bit old, and I always get an error in the query Can someone update it or give me an other script Code: /* Chat Logger SQL Version 0.5 AUTHOR: aake ([email protected]) Website : http://naputtaja.no-ip.org This plugin save chat message to MySQL Database Installing the plugin: 1. Copy chat_logger_sql.amxx file to plugins folder 2. Add line chat_logger_sql.amxx to plugins.ini file */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <sqlx> #define PLUGINNAME "Chat Logger SQL" #define VERSION "0.8b" #define AUTHOR "naputtaja" #define table "amx_chat_log" #define MAXLEN 1011 #define MAX_WORDS 500 // SQL Settings new Handle:g_SqlX new Handle:g_SqlConnection new g_error[512] new g_No_Save_Words[MAX_WORDS][20] new g_No_Save_Num new const TEAMNAME[_:CsTeams][] = {"*DEAD*", "(FUREIN)", "(ANTI-FUREIN)", "*SPEC*"} public check_sql() { new host[64], user[64], pass[64], db[64],errorcode get_cvar_string("amx_sql_host", host, 63) get_cvar_string("amx_sql_user", user, 63) get_cvar_string("amx_sql_pass", pass, 63) get_cvar_string("amx_sql_db", db, 63) g_SqlX = SQL_MakeDbTuple(host, user, pass, db) g_SqlConnection = SQL_Connect(g_SqlX,errorcode,g_error,511); if (!g_SqlConnection) { console_print(0,"Chat log SQL: Could not connect to SQL database.!") return log_amx("Chat log SQL: Could not connect to SQL database.") } new query_create[3000] format(query_create,3000,"CREATE TABLE IF NOT EXISTS `%s` (`id` int(11) NOT NULL auto_increment,`name` varchar(100) NOT NULL default '',`authid` varchar(100) NOT NULL default '',`ip` varchar(100) NOT NULL default '',`alive` int(11) NOT NULL default '0', `team` varchar(100) NOT NULL default '',`date` date NOT NULL default '0000-00-00',`time` time NOT NULL default '00:00:00',`cmd` varchar(100) NOT NULL default '',`message` text NOT NULL,PRIMARY KEY (`id`));",table) SQL_ThreadQuery(g_SqlX,"QueryHandle",query_create) return PLUGIN_CONTINUE } public chat_log_sql(id) { if(is_user_bot(id)) return static datestr[11] new authid[32],name[32],ip[16],timestr[9] new cmd[9] if(!is_user_connected(id)) return read_argv(0,cmd,8) new message[192] read_args(message,191) remove_quotes(message) new i = 0 while ( i < g_No_Save_Num ) { if ( containi ( message, g_No_Save_Words[i++] ) != -1 || !message[0] )return } new CsTeams:team = cs_get_user_team(id) get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) get_user_ip(id, ip, charsmax(ip), 1) get_time("%Y.%m.%d", datestr, 10) get_time("%H:%M:%S", timestr, 8) new query[3000] format(query,3000,"INSERT into %s (name,authid,ip,alive,team,date,time,message,cmd) values ('%s','%s','%s','%d','%s','%s','%s','%s','%s')",table,name,authid,ip,is_user_alive(id),TEAMNAME[_:team],datestr,timestr,message,cmd) SQL_ThreadQuery(g_SqlX,"QueryHandle",query) } public QueryHandle(FailState,Handle:Query,Error[],Errcode,Data[],DataSize) { if(FailState == TQUERY_CONNECT_FAILED) return log_amx("Chat log SQL: Could not connect to SQL database.") else if(FailState == TQUERY_QUERY_FAILED) return log_amx("Chat log SQL: Query failed") if(Errcode) return log_amx("Chat log SQL: Error on query: %s",Error) new DataNum while(SQL_MoreResults(Query)) { DataNum = SQL_ReadResult(Query,0) server_print("zomg, some data: %s",DataNum) SQL_NextRow(Query) } return PLUGIN_CONTINUE } readList() { new Configsdir[64] new NoSaveWords_file[64] get_configsdir( Configsdir, 63 ) format(NoSaveWords_file, 63, "%s/ChatLoggerSQL_NoSaveWords.ini", Configsdir ) if ( !file_exists(NoSaveWords_file) ) { return log_amx("Chat log SQL: ChatLoggerSQL_NoSaveWords.ini File not found") server_print ( "====================================================================" ) server_print ( "[Chat Logger Sql] loaded ChatLoggerSQL_NoSaveWords.ini File not found", g_No_Save_Num ) server_print ( "====================================================================" ) } new len, i=0 while( i < MAX_WORDS && read_file( NoSaveWords_file, i , g_No_Save_Words[g_No_Save_Num], 19, len ) ) { i++ if( g_No_Save_Words[g_No_Save_Num][0] == ';' || len == 0 ) continue g_No_Save_Num++ } i=0 server_print ( "======================================================" ) server_print ( "[Chat Logger Sql] loaded %d No Save words", g_No_Save_Num ) server_print ( "======================================================" ) return PLUGIN_CONTINUE } public plugin_end() { SQL_FreeHandle(g_SqlConnection) return } public plugin_init() { register_plugin(PLUGINNAME, VERSION, AUTHOR) register_cvar("amx_chat_logger",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY) register_clcmd("say", "chat_log_sql") register_clcmd("say_team", "chat_log_sql") readList() set_task(0.1, "check_sql") return PLUGIN_CONTINUE } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1035\\ f0\\ fs16 \n\\ par } */ Przeczytaj cały wpis
  18. Descriptionaddon of Automatic Healing, allow interrupt healing on attack. Cvars PHP Code: // which type of attack will interrupt healing? 1 = primary attack, 2 = shove. add numbers together // - // Default: "3" // Minimum: "0.000000" // Maximum: "3.000000" automatic_healing_addon_attack_enable "3" Change log Spoiler Code: 1.0 (2023-05-15: init public release. Attached Files Get Plugin or Get Source (automatic_healing_addon_attack.sp - 6.0 KB) automatic_healing_addon_attack.smx (6.1 KB) Wyświetl pełny artykuł
  19. Descriptionafter use medicine, if sum of health lower than the custom value, add health buffer to it. Cvars PHP Code: // 0 = disable, 1 = enable pain pills, 2 = enable adrenaline, 4 = enable first aid kit. add numbers together // - // Default: "3" medicine_health_buffer_enable "3" // if adrenaline used health lower than this value, add health buffer to it // - // Default: "65.2" // Minimum: "1.000000" medicine_health_buffer_max_health_adrenaline "65.2" // if first aid kit used health lower than this value, add health buffer to it // - // Default: "100.2" // Minimum: "1.000000" medicine_health_buffer_max_health_medkit "100.2" // if pain pills used health lower than this value, add health buffer to it // - // Default: "80.2" // Minimum: "1.000000" medicine_health_buffer_max_health_pills "80.2" Change log Spoiler Code: 1.0 (2023-05-15: init public release. Attached Files Get Plugin or Get Source (medicine_health_buffer.sp - 4.4 KB) Wyświetl pełny artykuł
  20. This plugin will respawn all dead players when a team captures a control point. This plugin also included a convar for setting which teams get respawned when a point gets captured, sm_capturerespawn_mode. 0 means no teams are respawned, effectively disabling the plugin. 1 makes the team that captured the point respawn, 2 respawns the team opposing the one which captured, and 3 respawns both teams. The default value is 3. Attached Files Get Plugin or Get Source (respawnoncap.sp - 1.9 KB) Wyświetl pełny artykuł
  21. This plugin allows for admins to give/remove conditions on players in TF2, using the console commands sm_addcond and sm_removecond. sm_addcond takes a condition ID, and optionally a duration in seconds, as well as a target identifier. The command gives an infinite condition to the executing player by default. (To give an infinite duration condition to another player, enter -1 as the duration) sm_removecond takes a condition ID, and optionally a target identifier. The command targets the executing player by default. Both commands require admins to have the "cheats" flag enabled. Example commands: sm_addcond 5 -1 @red: Applies permanent Medigun Übercharge on all players on RED. sm_addcond 34 60: Applies Canteen crit boost to yourself for one minute. sm_removecond 7 @all: Immediately cancels any player's taunt, if they are performing one. Attached Files Get Plugin or Get Source (addcond.sp - 1.7 KB) addcond.smx (5.6 KB) Wyświetl pełny artykuł
  22. Hi i nead plugin/code that gives a player 5 hp after 5 sec and i nead to add it to my vip plugin Przeczytaj cały wpis
  23. Hello:), I'm looking for a complement which the spectator cannot change sides as long as they are playing mix 5 vs 5, that is, when there are 10 people playing, no spectator can change sides, thanks. :bee: Przeczytaj cały wpis
  24. How can I print a death message that an entity has died? A working instance, 3 specbots have been added and all 3 are triggered when a separate entity dies. How can I do that ? Przeczytaj cały wpis
  25. Hello, i just made a simple server for me and my friends where we can just be afk and do things. I'm searching for a plugin that can do !gen like streamers have on their server. Is there a free one? I know that this was against the rules of valve or something but idc. It can also be like !i [inspect link]. Przeczytaj cały wpis
×
×
  • Dodaj nową pozycję...