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

Cała aktywność

Kanał aktualizowany automatycznie

  1. Z ostatniej godziny
  2. Dzisiaj
  3. Advanced DevZones AntiCamp (v0.2 - 08.05.24) DESCRIPTION This plugin is the advanced version of already published Dev Zones Anticamp plugin. Players are killed if they do not leave an area that their team must leave within a set number of seconds. You need DevZones to use this plugin ! https://forums.alliedmods.net/showthread.php?t=224839 BUGS None. yet USAGE Put anticamp in front of the zone name so plugin recognizes the zone. If you want the zone to affect only the CT team, add :ct to the end of the zone name. If you want the zone to affect only the T team, add :t to the end of the zone name. If you want the zone to affect all teams, either add :all to the end of the zone name or leave it blank. https://youtu.be/C-bY5ZdGFuk?si=Y3FTzju3Wl_pOgME CHANGELOG Code: . CVARS Code: // 1->Plugin enabled, 0->Plugin disabled // - // Default: "1" // Minimum: "0.000000" // Maximum: "1.000000" sm_vxanticamp_enable "1" // Time before camp time gets reset after leaving a zone // - // Default: "15" sm_vxanticamp_lefttime "15" // Allowed camp time // - // Default: "30" // Minimum: "10.000000" sm_vxanticamp_time "30" PHRASES Code: "Phrases" { "inAntiCampZone" { "#format" "{1:d}" "en" "!!!You Are Within AntiCamp Zone!!!\nYou have {1} seconds to leave the zone" "tr" "!!!AntiCamp Alanındasın!!!\nAlanı terketmek için kalan süren: {1}" } "Smote" { "en" "You got smote for not leaving the AntiCamp zone!" "tr" "AntiCamp alanını terk etmediğin için çarpıldın!" } "Smotetext" { "#format" "{1:s}" "tr" "{green}{1} {default}anticamp alanından ayrılmadı için çarpıldı!" "en" "{green}{1} {default}got smote for not leaving the AntiCamp zone!" } "LeftZone" { "#format" "{1:0.0f}" "tr" "AntiCamp Alanından Ayrıldın\nCamp Süresinin sıfırlanması için {1} saniye beklemelisin." "en" "You Left The Zone\nYou have to wait {1} seconds before your Camp time gets reset." } } Attached Files Get Plugin or Get Source (vx_anticamp.sp - 7.6 KB) vx_anticamp.smx (17.7 KB) vx_anticamp.phrases.txt (812 Bytes) Wyświetl pełny artykuł
  4. Can it be fixed when I use the admin command "amx_givexp" to give someone EXP and the server crashes? admin.inl PHP Code: /* * Admin Functions */ // Advanced Swear Filter and Punishment plugin uses this function public ADMIN_ServerHandler() { // Make sure WC3 is loaded if ( !WC3_Check() ) { return PLUGIN_HANDLED; } new szCmd[32], szArg1[32], szArg2[32]; read_argv( 0, szCmd, 31 ); read_argv( 1, szArg1, 31 ); read_argv( 2, szArg2, 31 ); new id = str_to_num( szArg1 ); new iXP = str_to_num( szArg2 ); if ( equal( szCmd, "amx_takexp" ) ) { iXP *= -1; iXP += p_data[id][P_XP]; } else if ( equal( szCmd, "changexp" ) ) { iXP += p_data[id][P_XP]; } ADMIN_SetXP( id, iXP ); return PLUGIN_HANDLED; } // This will handle every admin client command public ADMIN_Handler( id ) { new szCmd[32]; read_argv(0, szCmd, 31); // Make sure WC3 is loaded if (!WC3_Check() && !equal(szCmd, "wc3_disable") && !equal(szCmd, "wc3_enable")) { ADMIN_Print(id, "%s WC3 has been disabled by an admin of this server", g_MODclient); return PLUGIN_HANDLED; } // Make sure the user is an admin if (!(get_user_flags(id) & XP_GetAdminFlag())) { client_print(id, print_console, "%L", id, "YOU_HAVE_NO_ACCESS", g_MODclient); return PLUGIN_HANDLED; } // OK we're free to go!!! new szArg1[32], szArg2[32]; read_argv(1, szArg1, 31); read_argv(2, szArg2, 31); // Give the user XP if (equal(szCmd, "wc3_givexp") || equal(szCmd, "amx_givexp")) { if ( read_argc() < 3 ) { ADMIN_Print( id, "Format: %s <name|#id|auth|@TEAM|@ALL> <xp>", szCmd ); return PLUGIN_HANDLED; } ADMIN_GiveXP( id, szArg1, str_to_num( szArg2 ) ); } // Set the level of a user's race else if ( equal( szCmd, "wc3_setlevel" ) ) { if ( read_argc() < 3 ) { ADMIN_Print( id, "Format: %s <name|#id|auth|@TEAM|@ALL> <level>", szCmd ); return PLUGIN_HANDLED; } new iLevel = str_to_num( szArg2 ); if ( iLevel < 0 || iLevel >= 11 ) { ADMIN_Print( id, "%s Error, level must be in between (or equal to) 0 and 10", g_MODclient ); return PLUGIN_HANDLED; } ADMIN_SetLevel( id, szArg1, iLevel ); } // Give the user an item else if ( equal( szCmd, "wc3_giveitem" ) ) { if ( read_argc() < 3 ) { ADMIN_Print( id, "Format: %s <name|#id|auth|@TEAM|@ALL> <item id or name>", szCmd ); return PLUGIN_HANDLED; } new iItemID; if ( is_str_num( szArg2 ) ) { iItemID = str_to_num( szArg2 ); if ( iItemID > 17 || iItemID < 0 ) { ADMIN_Print( id, "%s Error, item id must be in between (or equal to) 0 and 17", g_MODclient ); return PLUGIN_HANDLED; } } ADMIN_GiveItem( id, szArg1, iItemID ); } // Enable the plugin else if ( equal( szCmd, "wc3_enable" ) ) { // Plugin was already enabled, why re-enable? if ( warcraft3 ) { ADMIN_Print( id, "%s The plugin was already enabled!", g_MODclient ); } // Enable the plugin! else { warcraft3 = true; ADMIN_Print( id, "%s Plugin enabled!", g_MODclient ); } } // Disable the plugin else if ( equal( szCmd, "wc3_disable" ) ) { // Plugin was already enabled, why re-enable? if ( !warcraft3 ) { ADMIN_Print( id, "%s The plugin was already disabled!", g_MODclient ); } // Disable the plugin! else { // What needs to happen here? // - all skills set to 0 for each player // - call SHARED_SetGravity // - call SHARED_SetInvis // - call SHARED_SetSpeed // - stop tasks - like money task for dod // - ULT_ClearIcons( id ) warcraft3 = false; ADMIN_Print( id, "%s Plugin disabled!", g_MODclient ); } } new szArgs[128]; read_args( szArgs, 127 ); ADMIN_Log( id, szCmd, "%s", szArgs ); return PLUGIN_HANDLED; } // Actually set the user's XP ADMIN_SetXP( id, iXP ) { if ( iXP < 0 ) { iXP = 0; } p_data[id][P_XP] = iXP; XP_Check( id ); set_task( 0.3, "WC3_GetUserInput", TASK_GETINPUT + id ); } // Set the user's level ADMIN_SetLevel( id, szTarget[], iLevel ) { new iXP = XP_GetByLevel( iLevel ); new iTarget = 0, bool:bTargetFound = false; // Do this while we continue having a target! while ( ( iTarget = FindTarget( iTarget, szTarget ) ) > 0 ) { ADMIN_SetXP( iTarget, iXP ); client_print( iTarget, print_chat, "%s The admin has set your race's level to %d", g_MODclient, iLevel ); bTargetFound = true; } // No target found :/ if ( !bTargetFound ) { ADMIN_NoTargetFound( id, szTarget, ( iTarget == -2 ) ); } } // Give the user some XP ADMIN_GiveXP( id, szTarget[], iXP ) { new iTarget = 0, bool:bTargetFound = false; // Do this while we continue having a target! while ( ( iTarget = FindTarget( iTarget, szTarget ) ) > 0 ) { ADMIN_SetXP( iTarget, p_data[iTarget][P_XP] + iXP ); client_print( iTarget, print_chat, "%s %L", g_MODclient, iTarget, "THE_ADMIN_GAVE_YOU_EXPERIENCE", iXP ); bTargetFound = true; } // No target found :/ if ( !bTargetFound ) { ADMIN_NoTargetFound( id, szTarget, ( iTarget == -2 ) ); } } // Give the user an item ADMIN_GiveItem( id, szTarget[], iItemID ) { new szItemName[32]; LANG_GetItemName ( iItemID, id, szItemName, 31 ); new iTarget = 0, bool:bTargetFound = false; // Do this while we continue having a target! while ( ( iTarget = FindTarget( iTarget, szTarget ) ) > 0 ) { client_print( iTarget, print_chat, "%s The admin has given you the item '%s'", g_MODclient, szItemName ); ITEM_GiveItem( iTarget, iItemID ); bTargetFound = true; } // No target found :/ if ( !bTargetFound ) { ADMIN_NoTargetFound( id, szTarget, ( iTarget == -2 ) ); } } // Find a user based on szTarget FindTarget( iLastID, szTarget[] ) { new iTarget = -1; // Then we want to basically return everyone! if ( equali( szTarget, "@ALL" ) ) { new players[32], iTotalPlayers, i; get_players( players, iTotalPlayers ); // Loop through and search for the next target for ( i = 0; i < iTotalPlayers; i++ ) { // Target found, so lets return the next one (if possible)!! if ( players[i] == iLastID && i + 1 != iTotalPlayers ) { iTarget = players[i+1]; } } // No target was found so return the first one if ( iTotalPlayers > 0 && iLastID == 0 ) { iTarget = players[0]; } } // Find a target based on the team else if ( szTarget[0] == '@' ) { new iTeam = -1; // Counter-Strike and Condition Zero Checks if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO ) { if ( equali( szTarget, "@T" ) ) { iTeam = TEAM_T; } else if ( equali( szTarget, "@CT" ) ) { iTeam = TEAM_CT; } } // Day of Defeat check else if ( g_MOD == GAME_DOD ) { if ( equali( szTarget, "@ALLIES" ) ) { iTeam = ALLIES; } else if ( equali( szTarget, "@AXIS" ) ) { iTeam = AXIS; } } // Make sure a team was found if ( iTeam != -1 ) { new players[32], iTotalPlayers, i, iFirstPlayer = -1, bool:bSaveNext = false; get_players( players, iTotalPlayers ); // Loop through and search for the next target for ( i = 0; i < iTotalPlayers; i++ ) { // Make sure they're on the same team if ( iTeam == get_user_team( players[i] ) ) { // This is the next available player if ( bSaveNext ) { iTarget = players[i]; break; } // If this is the previous target, we need to get the next one! if ( players[i] == iLastID ) { bSaveNext = true; } // Save the FIRST player on this team if ( iFirstPlayer == -1 ) { iFirstPlayer = players[i]; } } } // No target was found so return the first one that matches the team (the target could still be -1 if iFirstPlayer wasn't found) if ( iLastID == 0 ) { iTarget = iFirstPlayer; } } } // Otherwise search for a player else { // Initial search is by player name new iPlayer = find_player( "a", szTarget ); // If not found, search by partial match if ( !iPlayer ) { iPlayer = find_player( "bl", szTarget ); if ( iPlayer ) { // Then Multiple clients found if ( iPlayer != find_player( "blj", szTarget ) ) { return -2; } } } // If not found, search by auth id if ( !iPlayer ) { iPlayer = find_player( "c" , szTarget ); } // If not found, search by user id if ( !iPlayer ) { // Make sure we have a user id if ( szTarget[0] == '#' && szTarget[1] ) { iPlayer = find_player( "k", str_to_num( szTarget[1] ) ) } } // Yay we have a match!!! if ( iPlayer && iLastID != iPlayer ) { iTarget = iPlayer; } } return iTarget; } ADMIN_NoTargetFound( id, szTarget[], bool:bMulti ) { // Multiple clients found if ( bMulti ) { ADMIN_Print( id, "%s There is more than one client matching '%s'", g_MODclient, szTarget ); } else { ADMIN_Print( id, "%s Unable to find target(s) '%s'", g_MODclient, szTarget ); } // List what the available targets are if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO ) { ADMIN_Print( id, "%s Available targets are: @ALL, @CT, @T or the player's name/auth/#id", g_MODclient ); } else if ( g_MOD == GAME_DOD ) { ADMIN_Print( id, "%s Available targets are: @ALL, @ALLIES, @AXIS or the player's name/auth/#id", g_MODclient ); } } // Function will print to server console or client console based on the ID number ADMIN_Print( id, text[], {Float,_}:...) { // format the text as needed new szFormattedText[128]; format_args( szFormattedText, 127, 1 ); if ( id == 0 ) { server_print( szFormattedText ); } else { client_print( id, print_console, szFormattedText ); } // Gets rid of compiler warning if ( text[0] == 0 ) { return; } } // Adapted from war3x's log file (I was lazy) ADMIN_Log( id, szCommand[], {Float,_}:... ) { new szLogFile[128]; get_configsdir( szLogFile, 127 ); formatex( szLogFile, 127, "%s/war3ft/wc3_admin.log", szLogFile ); new szFormattedText[128]; format_args( szFormattedText, 127, 2 ); if ( !file_exists( szLogFile ) ) { write_file( szLogFile, "WC3 : Frozen Throne", -1 ); write_file( szLogFile, "Logging of admin commands", -1 ); write_file( szLogFile, " ", -1 ); } new szAdminName[32], szSteamID[32], szTeam[13]; if ( id > 0 ) { get_user_name( id, szAdminName, 31 ); get_user_authid( id, szSteamID, 31 ); get_user_team( id, szTeam, 12 ); } else { copy( szAdminName, 31, "SERVER" ); copy( szSteamID, 31, "SERVER" ); } new szCurrentTime[32]; get_time( "L %m/%d/%Y %H:%M:%:S", szCurrentTime, 31 ); new szLogEntry[256]; formatex( szLogEntry, 255, "%s Cmd: ^"%s<%d><%s><%s>^" '%s %s'", szCurrentTime, szAdminName, get_user_userid( id ), szSteamID, szTeam, szCommand, szFormattedText ); write_file( szLogFile, szLogEntry, -1 ); // Gets rid of compiler warning if ( szCommand[0] == 0 ) { return; } } Attached Files Get Plugin or Get Source (war3ft.sma - 20.4 KB) Przeczytaj cały wpis
  5. Allows use sb_takecontrol command without sv_cheats 1. Only L4D2 Support. code: #include <sourcemod> #define PLUGIN_VERSION "0.0.1" public OnPluginStart(){ int flags=GetCommandFlags("sb_takecontrol"); SetCommandFlags("sb_takecontrol", flags & ~FCVAR_CHEAT); } Attached Files Get Plugin or Get Source (sb_tk.sp - 189 Bytes) sb_tk.smx (3.5 KB) Wyświetl pełny artykuł
  6. Wczoraj
  7. Description: I will short discuss how this plugin works. This plugin checks players frags, kills (Boomer, Smoker, Hunter) special infected, don't works with witch and tank. ----------------------------------------------- How To Install? 1.First L4D_FragsChecker.sp -> comile sp file to smx. 2.Put your L4D_FragsChecker.sp file to plugins folder. 3.Run. or you can download smx, and put right away to plugin folder. :) ----------------------------------------------- Commands for use in-game: write in chat-game: /frags or !frags You will see a list of kills at the bottom. ----------------------------------------------- This plugin works to all versions of sourcemod. So yo can test it to your game. Attached Files Get Plugin or Get Source (L4D_FragsChecker.sp - 4.3 KB) L4D_FragsChecker.smx (5.0 KB) Wyświetl pełny artykuł
  8. Ostatni tydzień
  9. siema, od aktualizacji w cs go zepsuł mi się mikrofon. w innych grach mikrofon normalnie działa. Pomoze ktoś?
  10. siema, mam problem z mikrofonem w CS2. w menu cs jak i na steamie działa normalnie. Wiecie jak to naprawić ?
  11. Who can help me,how to create buy zone on maps that don't have it,like fy and aim maps? Przeczytaj cały wpis
  12. GTR

    Kupie wpln pukawka

    Kupie niewielką kwote wpln pukawka + - 100 zł Max przelicznik 0,65
  13. I found this plugin down there. https://forums.alliedmods.net/showthread.php?t=202853 This plugin is using Parachute admins only. I want to make it BOTS ONLY. I think it should be a little tweaks, but I'm noob in scripting. Hoping for you help. Have a nice Day. PHP Code: #include <amxmodx> #include <hamsandwich> #include <fakemeta> #include <engine> new para_ent[33] new pDetach, pFallSpeed, pEnabled new gBitAdmin #define AddToBit(%1) ( gBitAdmin |= (1<<%1) ) #define RemoveFromBit(%1) ( gBitAdmin |= ~(1<<%1) ) #define IsInBit(%1) ( gBitAdmin & %1 ) public plugin_precache() precache_model("models/parachute.mdl") public plugin_init() { register_plugin("Parachute", "1.3", "KRoT@L/JTP10181") // edited by ^^KaMaZZ~.^ pEnabled = register_cvar("sv_parachute", "1" ) pFallSpeed = register_cvar("parachute_fallspeed", "100") pDetach = register_cvar("parachute_detach", "1") RegisterHam(Ham_Spawn, "player", "newSpawn", 1) register_event("DeathMsg", "death_event", "a") } public client_putinserver(id) { static iFlags iFlags = get_user_flags(id) if(iFlags & ADMIN_BAN) AddToBit(id) parachute_reset(id) } public client_disconnect(id) { if(IsInBit(id)) RemoveFromBit(id) parachute_reset(id) } public newSpawn(id) { if(IsInBit(id)) { if(para_ent[id] > 0) { remove_entity(para_ent[id]) fm_set_user_gravity(id, 1.0) para_ent[id] = 0 } } } public death_event() { new id = read_data(2) parachute_reset(id) } parachute_reset(id) { if(para_ent[id] > 0) { if (is_valid_ent(para_ent[id])) remove_entity(para_ent[id]) } if (is_user_alive(id)) fm_set_user_gravity(id, 1.0) para_ent[id] = 0 } public client_PreThink(id) { if( !get_pcvar_num(pEnabled) || !is_user_alive(id) || !IsInBit(id) ) return; new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0 new Float:frame new button = get_user_button(id) new oldbutton = get_user_oldbutton(id) new flags = get_entity_flags(id) if (para_ent[id] > 0 && (flags & FL_ONGROUND)) { if (get_pcvar_num(pDetach)) { if (fm_get_user_gravity(id) == 0.1) fm_set_user_gravity(id, 1.0) if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) { entity_set_int(para_ent[id], EV_INT_sequence, 2) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.0) return } frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame) if (frame > 254.0) { remove_entity(para_ent[id]) para_ent[id] = 0 } } else { remove_entity(para_ent[id]) fm_set_user_gravity(id, 1.0) para_ent[id] = 0 } return } if (button & IN_USE) { new Float:velocity[3] entity_get_vector(id, EV_VEC_velocity, velocity) if (velocity[2] < 0.0) { if(para_ent[id] <= 0) { para_ent[id] = create_entity("info_target") if(para_ent[id] > 0) { entity_set_string(para_ent[id],EV_SZ_classname,"parachute") entity_set_edict(para_ent[id], EV_ENT_aiment, id) entity_set_edict(para_ent[id], EV_ENT_owner, id) entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW) entity_set_model(para_ent[id], "models/parachute.mdl") entity_set_int(para_ent[id], EV_INT_sequence, 0) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } } if (para_ent[id] > 0) { entity_set_int(id, EV_INT_sequence, 3) entity_set_int(id, EV_INT_gaitsequence, 1) entity_set_float(id, EV_FL_frame, 1.0) entity_set_float(id, EV_FL_framerate, 1.0) fm_set_user_gravity(id, 0.1) velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed entity_set_vector(id, EV_VEC_velocity, velocity) if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) { frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0 entity_set_float(para_ent[id],EV_FL_fuser1,frame) entity_set_float(para_ent[id],EV_FL_frame,frame) if (frame > 100.0) { entity_set_float(para_ent[id], EV_FL_animtime, 0.0) entity_set_float(para_ent[id], EV_FL_framerate, 0.4) entity_set_int(para_ent[id], EV_INT_sequence, 1) entity_set_int(para_ent[id], EV_INT_gaitsequence, 1) entity_set_float(para_ent[id], EV_FL_frame, 0.0) entity_set_float(para_ent[id], EV_FL_fuser1, 0.0) } } } } else if (para_ent[id] > 0) { remove_entity(para_ent[id]) fm_set_user_gravity(id, 1.0) para_ent[id] = 0 } } else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) { remove_entity(para_ent[id]) fm_set_user_gravity(id, 1.0) para_ent[id] = 0 } } stock Float:fm_get_user_gravity(index) { new Float:gravity; pev(index, pev_gravity, gravity); return gravity; } stock fm_set_user_gravity(index, Float:gravity = 1.0) { set_pev(index, pev_gravity, gravity); return 1; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ fbidis\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang13313\\ f0\\ fs16 \n\\ par } */ Przeczytaj cały wpis
  14. Unicode Host Name Source Dedicated Server is very bad at parsing Unicode characters when reading the server .cfg file, however, it is supported internally. This plugin correctly applies the hostname ConVar including all the Unicode characters. Drag and drop and easy to use. ConVars None, uninstall plugin to disable. Changelog1.0.0Initial Release Special Considerations Only server names defined in the server's desired .cfg file are supported. Launching your server with the +hostname parameter is not supported. Supported Games Every Source Engine game should be supported in theory. But only Left 4 Dead 2 was tested. Screenshots Attached Thumbnails Attached Files Get Plugin or Get Source (unicode_hostname.sp - 2.5 KB) Wyświetl pełny artykuł
  15. Witajcie! 🖐️ Z wielką radością pragniemy ogłosić, że właśnie wystartowała sprzedaż serwerów do CS2! Zapraszamy do zapoznania się z naszą atrakcyjną ofertą (klik), która składa się obecnie z dwóch pakietów: CS2 DEV oraz CS2 STANDARD. Ceny naszych usług rozpoczynają się już od 24.99 zł / 54.99 zł brutto. Dodatkowo, oferujemy wyjątkowo rozbudowany Panel, w którym znajdziesz między innymi: 🛒 Itemshop całkowicie darmowy w ramach usługi. Przykładowy itemshop dostępny tutaj: https://is.zenway.pl/purchase/9c7AaqnY0J 🛠️ Wbudowany instalator pluginów, ułatwiający proces instalacji 📦 Instalator paczek serwerowych 📜 Rozbudowany system logów, który możesz dostosować do własnych potrzeb i wysyłać na swój serwer Discord Aby uczcić ten początek, zachęcamy użytkowników Mygo do skorzystania z naszej promocji -15% z kodem mygo15 Zapraszamy do dołączenia do naszej społeczności! 🎮
  16. This is a plugin based off of the bring/goto plugin from tf2 which doesn't work in the source mods so i decided to make this invoke the cheat commands, getpos through functions and setpos on the target to teleport to them or bring them! This should work on the TF2 sourcemod's for admins to use! CVARS: sm_bring - Brings a specified client to you sm_goto - Teleports you to the specified client Attached Files Teleport.smx (5.2 KB) Get Plugin or Get Source (Teleport.sp - 3.0 KB) Wyświetl pełny artykuł
  17. Thanks for reading. I have a rather small issue with uq_jumpstats, I think if someone fixes this all people will benefit I connected uq_jumpstats to mysql, and I find out that special characters are not working in the database, let me show you what I mean: Quote: It should look like this: name "エ ォ オ カ ガ キ ギ ク グ ケ ゲ " ______________________________ But It looks like this in the web page: Attachment 204275 ______________________________ In the database It is the same issue: Attachment 204276 Who's willing to fix this? ________________________ Link to the plugin: https://forums.alliedmods.net/showthread.php?t=141586 Attached Thumbnails Przeczytaj cały wpis
  18. Hello this is the .sma Code: #include <amxmodx> #include <engine> #include <fakemeta> #include <fakemeta_util> #include <hamsandwich> #include <cstrike> #include <xs> #define PLUGIN "Dragon Sword" #define VERSION "2.0" #define AUTHOR "Dias Leon" #define V_MODEL "models/v_dragonsword2.mdl" #define P_MODEL "models/p_dragonsword.mdl" #define CSW_DRAGONSWORD CSW_KNIFE #define weapon_dragonsword "weapon_knife" #define WEAPON_ANIMEXT "knife" //"skullaxe" #define DRAW_TIME 1.0 #define SLASH_ROTATE_DAMAGE 75.0 #define SLASH_ROTATE_RADIUS 110.0 #define SLASH_ROTATE_POINT_DIS 60.0 #define SLASH_ROTATE_DELAY_TIME 0.7 #define SLASH_ROTATE_RESET_TIME 1.0 #define SLASH_AHEAD_DAMAGE 90.0 #define SLASH_AHEAD_RADIUS 90.0 #define SLASH_AHEAD_POINT_DIS 30.0 #define SLASH_AHEAD_DELAY_TIME 0.3 #define SLASH_AHEAD_RESET_TIME 0.9 #define STAB_DAMAGE 110.0 #define STAB_RADIUS 100.0 #define STAB_POINT_DIS 80.0 #define STAB_TIME 0.657 #define STAB_RESET_TIME 0.75 #define TASK_SLASHING 2033+20 #define TASK_STABING 2033+10 // OFFSET const PDATA_SAFE = 2 const OFFSET_LINUX_WEAPONS = 4 const OFFSET_WEAPONOWNER = 41 const m_flNextAttack = 83 const m_szAnimExtention = 492 new const DragonSword_Sound[8][] = { "weapons/dragonsword_draw.wav", "weapons/dragonsword_hit1.wav", "weapons/dragonsword_hit2.wav", "weapons/dragonsword_idle.wav", "weapons/dragonsword_slash1.wav", "weapons/dragonsword_slash2.wav", "weapons/dragonsword_stab_hit.wav", "weapons/dragonsword_wall.wav" } enum { ATTACK_SLASH_ROTATE = 1, ATTACK_SLASH_AHEAD, ATTACK_STAB } enum { DS_ANIM_IDLE = 0, DS_ANIM_SLASH_ROTATE, DS_ANIM_SLASH_AHEAD, DS_ANIM_DRAW, DS_ANIM_STAB_BEGIN, DS_ANIM_STAB_END } enum { HIT_NOTHING = 0, HIT_ENEMY, HIT_WALL } new g_Had_DragonSword[33], g_Slashing_Mode[33], g_Attack_Mode[33], g_Checking_Mode[33], g_Hit_Ing[33] new g_Old_Weapon[33], g_Ham_Bot, g_MaxPlayers public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0") register_event("CurWeapon", "Event_CurWeapon", "be", "1=1") register_forward(FM_EmitSound, "fw_EmitSound") register_forward(FM_CmdStart, "fw_CmdStart") register_forward(FM_TraceLine, "fw_TraceLine") register_forward(FM_TraceHull, "fw_TraceHull") RegisterHam(Ham_TraceAttack, "player", "fw_PlayerTraceAttack") g_MaxPlayers = get_maxplayers() register_clcmd("admin_get_dragonsword", "get_dragonsword", ADMIN_KICK) } public plugin_precache() { engfunc(EngFunc_PrecacheModel, V_MODEL) engfunc(EngFunc_PrecacheModel, P_MODEL) for(new i = 0; i < sizeof(DragonSword_Sound); i++) engfunc(EngFunc_PrecacheSound, DragonSword_Sound[i]) } public get_dragonsword(id) { if(!is_user_alive(id)) return remove_task(id+TASK_SLASHING) remove_task(id+TASK_STABING) g_Had_DragonSword[id] = 1 g_Slashing_Mode[id] = 0 g_Attack_Mode[id] = 0 g_Checking_Mode[id] = 0 g_Hit_Ing[id] = 0 if(get_user_weapon(id) == CSW_KNIFE) { set_pev(id, pev_viewmodel2, V_MODEL) set_pev(id, pev_weaponmodel2, P_MODEL) set_weapon_anim(id, DS_ANIM_DRAW) set_player_nextattack(id, DRAW_TIME) } else { engclient_cmd(id, weapon_dragonsword) } } public remove_dragonsword(id) { remove_task(id+TASK_SLASHING) remove_task(id+TASK_STABING) g_Had_DragonSword[id] = 0 g_Slashing_Mode[id] = 0 g_Attack_Mode[id] = 0 g_Checking_Mode[id] = 0 g_Hit_Ing[id] = 0 } public client_putinserver(id) { if(!g_Ham_Bot && is_user_bot(id)) { g_Ham_Bot = 1 set_task(0.1, "Do_RegisterHam_Bot", id) } } public Do_RegisterHam_Bot(id) { RegisterHamFromEntity(Ham_TraceAttack, id, "fw_PlayerTraceAttack") } public Event_NewRound() { for(new i = 0; i < g_MaxPlayers; i++) remove_dragonsword(i) } public Event_CurWeapon(id) { if(!is_user_alive(id)) return // Problem Here ?. SHUT THE FUCK UP if((read_data(2) == CSW_DRAGONSWORD && g_Old_Weapon[id] != CSW_DRAGONSWORD) && g_Had_DragonSword[id]) { set_pev(id, pev_viewmodel2, V_MODEL) set_pev(id, pev_weaponmodel2, P_MODEL) set_weapon_anim(id, DS_ANIM_DRAW) set_player_nextattack(id, DRAW_TIME) set_pdata_string(id, m_szAnimExtention * 4, WEAPON_ANIMEXT, -1 , 20) } g_Old_Weapon[id] = read_data(2) } public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch) { if(!is_user_connected(id)) return FMRES_IGNORED if(/*get_user_weapon(id) != CSW_DRAGONSWORD || */!g_Had_DragonSword[id]) return FMRES_IGNORED if(sample[8] == 'k' && sample[9] == 'n' && sample[10] == 'i') { if(sample[14] == 's' && sample[15] == 'l' && sample[16] == 'a') return FMRES_SUPERCEDE if (sample[14] == 'h' && sample[15] == 'i' && sample[16] == 't') { if (sample[17] == 'w') // wall { g_Hit_Ing[id] = HIT_WALL return FMRES_SUPERCEDE } else { g_Hit_Ing[id] = HIT_ENEMY return FMRES_SUPERCEDE } } if (sample[14] == 's' && sample[15] == 't' && sample[16] == 'a') return FMRES_SUPERCEDE; } return FMRES_IGNORED } public fw_CmdStart(id, uc_handle, seed) { if (!is_user_alive(id)) return if(get_user_weapon(id) != CSW_DRAGONSWORD || !g_Had_DragonSword[id]) return static ent; ent = fm_get_user_weapon_entity(id, CSW_DRAGONSWORD) if(!pev_valid(ent)) return if(get_pdata_float(ent, 46, OFFSET_LINUX_WEAPONS) > 0.0 || get_pdata_float(ent, 47, OFFSET_LINUX_WEAPONS) > 0.0) return static CurButton CurButton = get_uc(uc_handle, UC_Buttons) if (CurButton & IN_ATTACK) { set_uc(uc_handle, UC_Buttons, CurButton & ~IN_ATTACK) if(!g_Slashing_Mode[id]) { g_Attack_Mode[id] = ATTACK_SLASH_ROTATE g_Checking_Mode[id] = 1 ExecuteHamB(Ham_Weapon_PrimaryAttack, ent) g_Checking_Mode[id] = 0 set_pev(id, pev_framerate, 1.5) set_weapons_timeidle(id, CSW_DRAGONSWORD, SLASH_ROTATE_RESET_TIME) set_player_nextattack(id, SLASH_ROTATE_RESET_TIME) set_weapon_anim(id, DS_ANIM_SLASH_ROTATE) set_task(SLASH_ROTATE_DELAY_TIME, "Do_Slashing_Rotate", id+TASK_SLASHING) } else { g_Attack_Mode[id] = ATTACK_SLASH_AHEAD g_Checking_Mode[id] = 1 ExecuteHamB(Ham_Weapon_PrimaryAttack, ent) g_Checking_Mode[id] = 0 set_pev(id, pev_framerate, 2.0) set_weapons_timeidle(id, CSW_DRAGONSWORD, SLASH_AHEAD_RESET_TIME) set_player_nextattack(id, SLASH_AHEAD_RESET_TIME) set_weapon_anim(id, DS_ANIM_SLASH_AHEAD) set_task(SLASH_AHEAD_DELAY_TIME, "Do_Slashing_Ahead", id+TASK_SLASHING) } g_Slashing_Mode[id] = !g_Slashing_Mode[id] } else if (CurButton & IN_ATTACK2) { set_uc(uc_handle, UC_Buttons, CurButton & ~IN_ATTACK2) g_Attack_Mode[id] = ATTACK_STAB g_Checking_Mode[id] = 1 ExecuteHamB(Ham_Weapon_SecondaryAttack, ent) g_Checking_Mode[id] = 0 set_pev(id, pev_framerate, 1.5) set_weapons_timeidle(id, CSW_DRAGONSWORD, STAB_TIME + 0.1) set_player_nextattack(id, STAB_TIME + 0.1) set_weapon_anim(id, DS_ANIM_STAB_BEGIN) remove_task(id+TASK_STABING) set_task(STAB_TIME, "Do_StabNow", id+TASK_STABING) } } public Do_Slashing_Rotate(id) { id -= TASK_SLASHING if(!is_user_alive(id)) return if(get_user_weapon(id) != CSW_DRAGONSWORD || !g_Had_DragonSword[id]) return if(Check_Attack(id, ATTACK_SLASH_ROTATE)) { emit_sound(id, CHAN_WEAPON, DragonSword_Sound[1], 1.0, ATTN_NORM, 0, PITCH_NORM) } else { if(g_Hit_Ing[id] == HIT_WALL) emit_sound(id, CHAN_WEAPON, DragonSword_Sound[7], 1.0, ATTN_NORM, 0, PITCH_NORM) else if(g_Hit_Ing[id] == HIT_NOTHING) emit_sound(id, CHAN_WEAPON, DragonSword_Sound[4], 1.0, ATTN_NORM, 0, PITCH_NORM) } g_Attack_Mode[id] = 0 g_Hit_Ing[id] = 0 } public Do_Slashing_Ahead(id) { id -= TASK_SLASHING if(!is_user_alive(id)) return if(get_user_weapon(id) != CSW_DRAGONSWORD || !g_Had_DragonSword[id]) return if(Check_Attack(id, ATTACK_SLASH_AHEAD)) { emit_sound(id, CHAN_WEAPON, DragonSword_Sound[2], 1.0, ATTN_NORM, 0, PITCH_NORM) } else { if(g_Hit_Ing[id] == HIT_WALL) emit_sound(id, CHAN_WEAPON, DragonSword_Sound[7], 1.0, ATTN_NORM, 0, PITCH_NORM) else if(g_Hit_Ing[id] == HIT_NOTHING) emit_sound(id, CHAN_WEAPON, DragonSword_Sound[5], 1.0, ATTN_NORM, 0, PITCH_NORM) } g_Attack_Mode[id] = 0 g_Hit_Ing[id] = 0 } public Do_StabNow(id) { id -= TASK_STABING if (!is_user_alive(id)) return if(!g_Had_DragonSword[id]) return set_weapon_anim(id, DS_ANIM_STAB_END) if(get_user_weapon(id) != CSW_DRAGONSWORD) { set_weapons_timeidle(id, CSW_DRAGONSWORD, 0.0) set_player_nextattack(id, 0.0) } else { set_weapons_timeidle(id, CSW_DRAGONSWORD, STAB_RESET_TIME) set_player_nextattack(id, STAB_RESET_TIME) } if(Check_Attack(id, ATTACK_STAB)) { emit_sound(id, CHAN_WEAPON, DragonSword_Sound[1], 1.0, ATTN_NORM, 0, PITCH_NORM) } else { if(g_Hit_Ing[id] == HIT_WALL) emit_sound(id, CHAN_WEAPON, DragonSword_Sound[7], 1.0, ATTN_NORM, 0, PITCH_NORM) else if(g_Hit_Ing[id] == HIT_NOTHING) emit_sound(id, CHAN_WEAPON, DragonSword_Sound[6], 1.0, ATTN_NORM, 0, PITCH_NORM) } g_Attack_Mode[id] = 0 g_Hit_Ing[id] = 0 } public Check_Attack(id, Mode) { static Float:Max_Distance, Float:Point[4][3], Float:TB_Distance, Float:Point_Dis if(Mode == ATTACK_SLASH_ROTATE) { Point_Dis = SLASH_ROTATE_POINT_DIS Max_Distance = SLASH_ROTATE_RADIUS TB_Distance = Max_Distance / 4.0 } else if(Mode == ATTACK_SLASH_AHEAD) { Point_Dis = SLASH_AHEAD_POINT_DIS Max_Distance = SLASH_AHEAD_RADIUS TB_Distance = Max_Distance / 4.0 } else if(Mode == ATTACK_STAB) { Point_Dis = STAB_POINT_DIS Max_Distance = STAB_RADIUS TB_Distance = Max_Distance / 4.0 } static Float:VicOrigin[3], Float:MyOrigin[3] pev(id, pev_origin, MyOrigin) for(new i = 0; i < 4; i++) get_position(id, TB_Distance * (i + 1), 0.0, 0.0, Point[i]) static Have_Victim; Have_Victim = 0 static ent ent = fm_get_user_weapon_entity(id, get_user_weapon(id)) if(!pev_valid(ent)) return 0 for(new i = 0; i < get_maxplayers(); i++) { if(!is_user_alive(i)) continue if(id == i) continue if(entity_range(id, i) > Max_Distance) continue pev(i, pev_origin, VicOrigin) if(is_wall_between_points(MyOrigin, VicOrigin, id)) continue if(get_distance_f(VicOrigin, Point[0]) <= Point_Dis || get_distance_f(VicOrigin, Point[1]) <= Point_Dis || get_distance_f(VicOrigin, Point[2]) <= Point_Dis || get_distance_f(VicOrigin, Point[3]) <= Point_Dis) { if(!Have_Victim) Have_Victim = 1 if(Mode == ATTACK_SLASH_ROTATE) do_attack(id, i, ent, SLASH_ROTATE_DAMAGE) else if(Mode == ATTACK_SLASH_AHEAD) do_attack(id, i, ent, SLASH_AHEAD_DAMAGE) else if(Mode == ATTACK_STAB) do_attack(id, i, ent, STAB_DAMAGE) } } if(Have_Victim) return 1 else return 0 return 0 } public fw_TraceLine(Float:vector_start[3], Float:vector_end[3], ignored_monster, id, handle) { if (!is_user_alive(id)) return FMRES_IGNORED if (get_user_weapon(id) != CSW_DRAGONSWORD || !g_Had_DragonSword[id]) return FMRES_IGNORED static Float:vecStart[3], Float:vecEnd[3], Float:v_angle[3], Float:v_forward[3], Float:view_ofs[3], Float:fOrigin[3] pev(id, pev_origin, fOrigin) pev(id, pev_view_ofs, view_ofs) xs_vec_add(fOrigin, view_ofs, vecStart) pev(id, pev_v_angle, v_angle) engfunc(EngFunc_MakeVectors, v_angle) get_global_vector(GL_v_forward, v_forward) if(g_Attack_Mode[id] == ATTACK_SLASH_ROTATE) xs_vec_mul_scalar(v_forward, SLASH_ROTATE_RADIUS, v_forward) else if(g_Attack_Mode[id] == ATTACK_SLASH_AHEAD) xs_vec_mul_scalar(v_forward, SLASH_AHEAD_RADIUS, v_forward) else if(g_Attack_Mode[id] == ATTACK_STAB) xs_vec_mul_scalar(v_forward, STAB_RADIUS, v_forward) else xs_vec_mul_scalar(v_forward, 0.0, v_forward) xs_vec_add(vecStart, v_forward, vecEnd) engfunc(EngFunc_TraceLine, vecStart, vecEnd, ignored_monster, id, handle) return FMRES_SUPERCEDE } public fw_TraceHull(Float:vector_start[3], Float:vector_end[3], ignored_monster, hull, id, handle) { if (!is_user_alive(id)) return FMRES_IGNORED if (get_user_weapon(id) != CSW_DRAGONSWORD || !g_Had_DragonSword[id]) return FMRES_IGNORED static Float:vecStart[3], Float:vecEnd[3], Float:v_angle[3], Float:v_forward[3], Float:view_ofs[3], Float:fOrigin[3] pev(id, pev_origin, fOrigin) pev(id, pev_view_ofs, view_ofs) xs_vec_add(fOrigin, view_ofs, vecStart) pev(id, pev_v_angle, v_angle) engfunc(EngFunc_MakeVectors, v_angle) get_global_vector(GL_v_forward, v_forward) if(g_Attack_Mode[id] == ATTACK_SLASH_ROTATE) xs_vec_mul_scalar(v_forward, SLASH_ROTATE_RADIUS, v_forward) else if(g_Attack_Mode[id] == ATTACK_SLASH_AHEAD) xs_vec_mul_scalar(v_forward, SLASH_AHEAD_RADIUS, v_forward) else if(g_Attack_Mode[id] == ATTACK_STAB) xs_vec_mul_scalar(v_forward, STAB_RADIUS, v_forward) else xs_vec_mul_scalar(v_forward, 0.0, v_forward) xs_vec_add(vecStart, v_forward, vecEnd) engfunc(EngFunc_TraceHull, vecStart, vecEnd, ignored_monster, hull, id, handle) return FMRES_SUPERCEDE } public fw_PlayerTraceAttack(Victim, Attacker, Float:Damage, Float:Direction[3], TraceResult, DamageBits) { if(!is_user_alive(Attacker)) return HAM_IGNORED if(!g_Had_DragonSword[Attacker] || !g_Checking_Mode[Attacker]) return HAM_IGNORED return HAM_SUPERCEDE } do_attack(Attacker, Victim, Inflictor, Float:fDamage) { fake_player_trace_attack(Attacker, Victim, fDamage) fake_take_damage(Attacker, Victim, fDamage, Inflictor) } fake_player_trace_attack(iAttacker, iVictim, &Float:fDamage) { // get fDirection new Float:fAngles[3], Float:fDirection[3] pev(iAttacker, pev_angles, fAngles) angle_vector(fAngles, ANGLEVECTOR_FORWARD, fDirection) // get fStart new Float:fStart[3], Float:fViewOfs[3] pev(iAttacker, pev_origin, fStart) pev(iAttacker, pev_view_ofs, fViewOfs) xs_vec_add(fViewOfs, fStart, fStart) // get aimOrigin new iAimOrigin[3], Float:fAimOrigin[3] get_user_origin(iAttacker, iAimOrigin, 3) IVecFVec(iAimOrigin, fAimOrigin) // TraceLine from fStart to AimOrigin new ptr = create_tr2() engfunc(EngFunc_TraceLine, fStart, fAimOrigin, DONT_IGNORE_MONSTERS, iAttacker, ptr) new pHit = get_tr2(ptr, TR_pHit) new iHitgroup = get_tr2(ptr, TR_iHitgroup) new Float:fEndPos[3] get_tr2(ptr, TR_vecEndPos, fEndPos) // get target & body at aiming new iTarget, iBody get_user_aiming(iAttacker, iTarget, iBody) // if aiming find target is iVictim then update iHitgroup if (iTarget == iVictim) { iHitgroup = iBody } // if ptr find target not is iVictim else if (pHit != iVictim) { // get AimOrigin in iVictim new Float:fVicOrigin[3], Float:fVicViewOfs[3], Float:fAimInVictim[3] pev(iVictim, pev_origin, fVicOrigin) pev(iVictim, pev_view_ofs, fVicViewOfs) xs_vec_add(fVicViewOfs, fVicOrigin, fAimInVictim) fAimInVictim[2] = fStart[2] fAimInVictim[2] += get_distance_f(fStart, fAimInVictim) * floattan( fAngles[0] * 2.0, degrees ) // check aim in size of iVictim new iAngleToVictim = get_angle_to_target(iAttacker, fVicOrigin) iAngleToVictim = abs(iAngleToVictim) new Float:fDis = 2.0 * get_distance_f(fStart, fAimInVictim) * floatsin( float(iAngleToVictim) * 0.5, degrees ) new Float:fVicSize[3] pev(iVictim, pev_size , fVicSize) if ( fDis <= fVicSize[0] * 0.5 ) { // TraceLine from fStart to aimOrigin in iVictim new ptr2 = create_tr2() engfunc(EngFunc_TraceLine, fStart, fAimInVictim, DONT_IGNORE_MONSTERS, iAttacker, ptr2) new pHit2 = get_tr2(ptr2, TR_pHit) new iHitgroup2 = get_tr2(ptr2, TR_iHitgroup) // if ptr2 find target is iVictim if ( pHit2 == iVictim && (iHitgroup2 != HIT_HEAD || fDis <= fVicSize[0] * 0.25) ) { pHit = iVictim iHitgroup = iHitgroup2 get_tr2(ptr2, TR_vecEndPos, fEndPos) } free_tr2(ptr2) } // if pHit still not is iVictim then set default HitGroup if (pHit != iVictim) { // set default iHitgroup iHitgroup = HIT_GENERIC new ptr3 = create_tr2() engfunc(EngFunc_TraceLine, fStart, fVicOrigin, DONT_IGNORE_MONSTERS, iAttacker, ptr3) get_tr2(ptr3, TR_vecEndPos, fEndPos) // free ptr3 free_tr2(ptr3) } } // set new Hit & Hitgroup & EndPos set_tr2(ptr, TR_pHit, iVictim) set_tr2(ptr, TR_iHitgroup, iHitgroup) set_tr2(ptr, TR_vecEndPos, fEndPos) // hitgroup multi fDamage new Float:fMultifDamage switch(iHitgroup) { case HIT_HEAD: fMultifDamage = 4.0 case HIT_STOMACH: fMultifDamage = 1.25 case HIT_LEFTLEG: fMultifDamage = 0.75 case HIT_RIGHTLEG: fMultifDamage = 0.75 default: fMultifDamage = 1.0 } fDamage *= fMultifDamage // ExecuteHam fake_trake_attack(iAttacker, iVictim, fDamage, fDirection, ptr) // free ptr free_tr2(ptr) } stock fake_trake_attack(iAttacker, iVictim, Float:fDamage, Float:fDirection[3], iTraceHandle, iDamageBit = (DMG_NEVERGIB | DMG_BULLET)) { ExecuteHamB(Ham_TraceAttack, iVictim, iAttacker, fDamage, fDirection, iTraceHandle, iDamageBit) } stock fake_take_damage(iAttacker, iVictim, Float:fDamage, iInflictor = 0, iDamageBit = (DMG_NEVERGIB | DMG_BULLET)) { iInflictor = (!iInflictor) ? iAttacker : iInflictor ExecuteHamB(Ham_TakeDamage, iVictim, iInflictor, iAttacker, fDamage, iDamageBit) } stock get_angle_to_target(id, const Float:fTarget[3], Float:TargetSize = 0.0) { new Float:fOrigin[3], iAimOrigin[3], Float:fAimOrigin[3], Float:fV1[3] pev(id, pev_origin, fOrigin) get_user_origin(id, iAimOrigin, 3) // end position from eyes IVecFVec(iAimOrigin, fAimOrigin) xs_vec_sub(fAimOrigin, fOrigin, fV1) new Float:fV2[3] xs_vec_sub(fTarget, fOrigin, fV2) new iResult = get_angle_between_vectors(fV1, fV2) if (TargetSize > 0.0) { new Float:fTan = TargetSize / get_distance_f(fOrigin, fTarget) new fAngleToTargetSize = floatround( floatatan(fTan, degrees) ) iResult -= (iResult > 0) ? fAngleToTargetSize : -fAngleToTargetSize } return iResult } stock get_angle_between_vectors(const Float:fV1[3], const Float:fV2[3]) { new Float:fA1[3], Float:fA2[3] engfunc(EngFunc_VecToAngles, fV1, fA1) engfunc(EngFunc_VecToAngles, fV2, fA2) new iResult = floatround(fA1[1] - fA2[1]) iResult = iResult % 360 iResult = (iResult > 180) ? (iResult - 360) : iResult return iResult } stock fm_cs_get_weapon_ent_owner(ent) { if (pev_valid(ent) != PDATA_SAFE) return -1 return get_pdata_cbase(ent, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS) } stock set_weapon_anim(id, anim) { if(!is_user_alive(id)) return set_pev(id, pev_weaponanim, anim) message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, _, id) write_byte(anim) write_byte(0) message_end() } stock set_weapons_timeidle(id, WeaponId ,Float:TimeIdle) { if(!is_user_alive(id)) return static entwpn; entwpn = fm_get_user_weapon_entity(id, WeaponId) if(!pev_valid(entwpn)) return set_pdata_float(entwpn, 46, TimeIdle, OFFSET_LINUX_WEAPONS) set_pdata_float(entwpn, 47, TimeIdle, OFFSET_LINUX_WEAPONS) set_pdata_float(entwpn, 48, TimeIdle + 0.5, OFFSET_LINUX_WEAPONS) } stock set_player_nextattack(id, Float:nexttime) { if(!is_user_alive(id)) return set_pdata_float(id, m_flNextAttack, nexttime, 5) } stock is_valid_entity(ent) { if(pev_valid(ent) != PDATA_SAFE) return 0 return 1 } stock get_position(ent, Float:forw, Float:right, Float:up, Float:vStart[]) { static Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3] pev(ent, pev_origin, vOrigin) pev(ent, pev_view_ofs,vUp) //for player xs_vec_add(vOrigin,vUp,vOrigin) pev(ent, pev_v_angle, vAngle) // if normal entity ,use pev_angles angle_vector(vAngle,ANGLEVECTOR_FORWARD,vForward) //or use EngFunc_AngleVectors angle_vector(vAngle,ANGLEVECTOR_RIGHT,vRight) angle_vector(vAngle,ANGLEVECTOR_UP,vUp) vStart[0] = vOrigin[0] + vForward[0] * forw + vRight[0] * right + vUp[0] * up vStart[1] = vOrigin[1] + vForward[1] * forw + vRight[1] * right + vUp[1] * up vStart[2] = vOrigin[2] + vForward[2] * forw + vRight[2] * right + vUp[2] * up } stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent) { static ptr ptr = create_tr2() engfunc(EngFunc_TraceLine, start, end, IGNORE_MONSTERS, ignore_ent, ptr) static Float:EndPos[3] get_tr2(ptr, TR_vecEndPos, EndPos) free_tr2(ptr) return floatround(get_distance_f(end, EndPos)) }The .inl model example Code: /////////////////////////////////////////////////////////////////////////////////////////////////// //-----------------------------------------| DualKatana |------------------------------------------ //========================================== sDs|Aragon* ========================================== ///////////// // Settings | //==========/ #define DUALKATANA_OLD_NAME "knife" #define DUALKATANA_NEW_NAME "dualkatana" #define DUALKATANA_OLD_EVENT "events/knife.sc" #define weapon_dualkatana "weapon_knife" #define CSW_DUALKATANA CSW_KNIFE #define DUALKATANA_NAME "Dual Katana" #define DUALKATANA_TEAM WPN_TEAM_T #define DUALKATANA_ACCES WPN_ACCES_ALL #define DUALKATANA_LEVEL 0 #define DUALKATANA_DAMAGE 3.0 #define DUALKATANA_SLASH_DELAY 0.5 #define DUALKATANA_STAB_DELAY 1.0 new DualKatanaModel_V[] = "models/Furien40+/v_dualkatana.mdl", DualKatanaModel_P[] = "models/Furien40/p_dualkatana.mdl", DualKatana_WeaponList[] = "furien40_dualkatana", DualKatana_Sprites[] = "sprites/Furien40/dualkatana.spr", DualKatana_Sound[][][] = { { "weapons/dualkatana_draw.wav", "weapons/knife_deploy1.wav" }, { "weapons/dualkatana_hit1.wav", "weapons/knife_hit1.wav" }, { "weapons/dualkatana_hit2.wav", "weapons/knife_hit2.wav" }, { "weapons/dualkatana_hit1.wav", "weapons/knife_hit3.wav" }, { "weapons/dualkatana_hit2.wav", "weapons/knife_hit4.wav" }, { "weapons/dualkatana_hitwall.wav", "weapons/knife_hitwall1.wav" }, { "weapons/dualkatana_slash1.wav", "weapons/knife_slash1.wav" }, { "weapons/dualkatana_slash2.wav", "weapons/knife_slash2.wav" }, { "weapons/dualkatana_stab.wav", "weapons/knife_stab.wav" } }; /////////////// // Model Info | //============/ enum { DUALKATANA_ANIM_IDLE = 0, DUALKATANA_ANIM_SLASH1, DUALKATANA_ANIM_SLASH2, DUALKATANA_ANIM_DRAW, DUALKATANA_ANIM_STAB, DUALKATANA_ANIM_STAB_MISS }; new Float:DualKatana_AnimationTime[] = { 7.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; //////////// // Globals | //=========/ #define dualkatana_get_anim(%1) entity_get_int(%1, EV_INT_iuser1) #define dualkatana_set_anim(%1,%2) entity_set_int(%1, EV_INT_iuser1, %2) new DualKatanaID, dualkatana_event; /////////////////////////////////////////////////////////////////////////////////////////////////// // Plugin | //================================================================================================= DualKatana_Init() { if (!DualKatanaID) return; register_clcmd(DualKatana_WeaponList, "CMD_DualKatana"); register_message(MSGID_DeathMsg, "DualKatana_DeathMsg"); register_event("CurWeapon", "DualKatana_ViewModel", "be", "1=1", "2=29"); register_forward(FM_PlaybackEvent, "DualKatana_PlaybackEvent"); register_forward(FM_EmitSound, "DualKatana_EmitSound"); register_forward(FM_CmdStart, "DualKatana_CmdStart"); RegisterHam(Ham_Item_Deploy, weapon_dualkatana, "DualKatana_Deploy_Post", 1); RegisterHam(Ham_Weapon_WeaponIdle, weapon_dualkatana, "DualKatana_WeaponIdle"); RegisterHookChain(RG_CBasePlayer_TakeDamage, "DualKatana_TakeDamage"); } DualKatana_Precache() { DualKatanaID = RegisterWeapon(CSW_DUALKATANA, DUALKATANA_NAME, DUALKATANA_TEAM, DUALKATANA_ACCES, DUALKATANA_LEVEL); if (!DualKatanaID) return; register_forward(FM_PrecacheEvent, "DualKatana_PrecacheEvent_Post", 1); precache_model(DualKatanaModel_V); precache_model(DualKatanaModel_P); new WPNList[128]; formatex(WPNList, charsmax(WPNList), "sprites/%s.txt", DualKatana_WeaponList); precache_generic(WPNList); precache_generic(DualKatana_Sprites); for (new i = 0; i < sizeof(DualKatana_Sound); i++) precache_sound(DualKatana_Sound[i][0]); } DualKatana_Natives() { register_native("get_user_dualkatana", "native_get_user_dualkatana"); register_native("set_user_dualkatana", "native_set_user_dualkatana"); register_native("dualkatana_id", "native_dualkatana_id"); } /////////////////////////////////////////////////////////////////////////////////////////////////// // Funcitons | //================================================================================================= public DualKatana_DeathMsg(msg_id, msg_dest, id) { new Attacker = get_msg_arg_int(1); if (is_user_connected(Attacker)) { new TruncatedWeapon[33]; get_msg_arg_string(4, TruncatedWeapon, charsmax(TruncatedWeapon)); if (equal(TruncatedWeapon, DUALKATANA_OLD_NAME)) { if (get_user_dualkatana(Attacker)) set_msg_arg_string(4, DUALKATANA_NEW_NAME); } } } public DualKatana_ViewModel(id) { if (is_user_alive(id) && get_user_dualkatana(id, true)) set_weapon_model(id, DualKatanaModel_V, DualKatanaModel_P); } public DualKatana_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2) { if (is_user_connected(invoker) && eventid == dualkatana_event) { playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2); return FMRES_HANDLED; } return FMRES_IGNORED; } public DualKatana_PrecacheEvent_Post(type, const name[]) { if (equal(DUALKATANA_OLD_EVENT, name)) { dualkatana_event = get_orig_retval(); return FMRES_HANDLED; } return FMRES_IGNORED; } public DualKatana_EmitSound(id, channel, const sound[]) { if (is_user_alive(id) && get_user_dualkatana(id, true)) { for (new i = 0; i < sizeof DualKatana_Sound; i++) { if (equal(sound, DualKatana_Sound[i][1])) { emit_sound(id, channel, DualKatana_Sound[i][0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM); return FMRES_SUPERCEDE; } } } return FMRES_IGNORED; } public DualKatana_CmdStart(id, uc_handle, seed) { if (!is_user_alive(id) || get_user_weapon(id) != CSW_DUALKATANA) return FMRES_IGNORED; new CurButton = get_uc(uc_handle, UC_Buttons); if (CurButton & IN_ATTACK) { new ENT_Weapon = cs_get_user_weapon_entity(id); if (is_valid_ent(ENT_Weapon) && get_weapon_key(ENT_Weapon) == DualKatanaID) { if (get_user_NextAttack(id) <= 0.1) { ExecuteHamB(Ham_Weapon_PrimaryAttack, ENT_Weapon); if (dualkatana_get_anim(ENT_Weapon) >= 2) dualkatana_set_anim(ENT_Weapon, 1); else dualkatana_set_anim(ENT_Weapon, dualkatana_get_anim(ENT_Weapon) + 1); new Anim = dualkatana_get_anim(ENT_Weapon); set_weapon_TimeWeaponIdle(ENT_Weapon, DualKatana_AnimationTime[Anim]); set_user_NextAttack(id, DUALKATANA_SLASH_DELAY); SendWeaponAnim(id, Anim, ENT_Weapon); } CurButton &= ~IN_ATTACK; set_uc(uc_handle, UC_Buttons, CurButton); return FMRES_HANDLED; } } else if (CurButton & IN_ATTACK2) { new ENT_Weapon = cs_get_user_weapon_entity(id); if (is_valid_ent(ENT_Weapon) && get_weapon_key(ENT_Weapon) == DualKatanaID) { if (get_user_NextAttack(id) <= 0.1) { ExecuteHamB(Ham_Weapon_SecondaryAttack, ENT_Weapon); new Anim = DUALKATANA_ANIM_STAB; set_weapon_TimeWeaponIdle(ENT_Weapon, DualKatana_AnimationTime[Anim]); set_user_NextAttack(id, DUALKATANA_STAB_DELAY); SendWeaponAnim(id, Anim, ENT_Weapon); } CurButton &= ~IN_ATTACK2; set_uc(uc_handle, UC_Buttons, CurButton); return FMRES_HANDLED; } } return FMRES_IGNORED; } public DualKatana_TakeDamage(const victim, pevInflictor, attacker, Float:flDamage, bitsDamageType) { if (is_user_alive(attacker) && get_user_dualkatana(attacker, true) && (bitsDamageType & DMG_BULLET)) SetHookChainArg(4, ATYPE_FLOAT, flDamage * DUALKATANA_DAMAGE); return HC_CONTINUE; } public DualKatana_Deploy_Post(ENT_Weapon) { if (is_valid_ent(ENT_Weapon)) { new id = pev(ENT_Weapon, pev_owner); if (is_user_alive(id) && get_weapon_key(ENT_Weapon) == DualKatanaID) { new Anim = DUALKATANA_ANIM_DRAW; set_weapon_model(id, DualKatanaModel_V, DualKatanaModel_P); set_weapon_TimeWeaponIdle(ENT_Weapon, DualKatana_AnimationTime[Anim]); set_user_NextAttack(id, DualKatana_AnimationTime[Anim]); SendWeaponAnim(id, Anim, ENT_Weapon); return HAM_HANDLED; } } return HAM_IGNORED; } public DualKatana_WeaponIdle(ENT_Weapon) { if (is_valid_ent(ENT_Weapon)) { new id = pev(ENT_Weapon, pev_owner); if (is_user_alive(id) && get_weapon_key(ENT_Weapon) == DualKatanaID && get_weapon_TimeWeaponIdle(ENT_Weapon) <= 0.1) { new Anim = DUALKATANA_ANIM_IDLE; set_weapon_TimeWeaponIdle(ENT_Weapon, DualKatana_AnimationTime[Anim]); set_weapon_model(id, DualKatanaModel_V, DualKatanaModel_P); SendWeaponAnim(id, Anim, ENT_Weapon); return HAM_HANDLED; } } return HAM_IGNORED; } public CMD_DualKatana(id) { engclient_cmd(id, weapon_dualkatana); return PLUGIN_HANDLED; } /////////////////////////////////////////////////////////////////////////////////////////////////// // Natives | //================================================================================================= public native_get_user_dualkatana(plugin_id, argc) return get_user_dualkatana(get_param(1), bool:get_param(2)); public native_set_user_dualkatana(plugin_id, argc) return set_weapon(get_param(1), CSW_DUALKATANA, DualKatanaID); public native_dualkatana_id() return DualKatanaID; /////////////////////////////////////////////////////////////////////////////////////////////////// // Stock | //================================================================================================= stock get_user_dualkatana(id, bool:CurrWeapon = false) return get_weapon(id, CSW_DUALKATANA, DualKatanaID, CurrWeapon); /////////////////////////////////////////////////////////////////////////////////////////////////// //-----------------------------------------| DualKatana |------------------------------------------ //========================================== sDs|Aragon* ==========================================Please i want someone if can help to modify the .sma similar to the .inl example but the same settings because i need to add new weapons to the shop. Like to convert similar like .inl Przeczytaj cały wpis
  19. Hello!, I wanted to get the server to place bots only on the axies team and proportionate the number of players on the allies team. If 5 players join allies, the server places 5 on axies. it's possible? as? Przeczytaj cały wpis
  20. Dorzucam tutaj kolejna mapę dla sieci 1S2K - am_minecraftfix
  21. I would also like in that plugin for the votemap commands and all of others to be usable with "/" Code: 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 Votes Plugin // #include <amxmodx> #include <amxmisc> new g_Answer[128] new g_optionName[4][64] new g_voteCount[4] new g_validMaps new g_yesNoVote new g_coloredMenus new g_voteCaller new g_Execute[256] new g_execLen new bool:g_execResult new Float:g_voteRatio public plugin_init() { register_plugin("Admin Votes", AMXX_VERSION_STR, "AMXX Dev Team") register_dictionary("adminvote.txt") register_dictionary("common.txt") register_dictionary("mapsmenu.txt") register_menucmd(register_menuid("Change map to "), MENU_KEY_1|MENU_KEY_2, "voteCount") register_menucmd(register_menuid("Choose map: "), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "voteCount") register_menucmd(register_menuid("Kick "), MENU_KEY_1|MENU_KEY_2, "voteCount") register_menucmd(register_menuid("Ban "), MENU_KEY_1|MENU_KEY_2, "voteCount") register_menucmd(register_menuid("Vote: "), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "voteCount") register_menucmd(register_menuid("The result: "), MENU_KEY_1|MENU_KEY_2, "actionResult") register_concmd("amx_votemap", "cmdVoteMap", ADMIN_KICK, "<map> [map] [map] [map]") register_concmd("amx_votekick", "cmdVoteKickBan", ADMIN_KICK, "<name or #userid>") register_concmd("amx_voteban", "cmdVoteKickBan", ADMIN_BAN, "<name or #userid>") register_concmd("amx_vote", "cmdVote", ADMIN_KICK, "<question> <answer#1> <answer#2>") register_concmd("amx_cancelvote", "cmdCancelVote", ADMIN_KICK, "- cancels last vote") register_clcmd("say /votemap", "cmdVoteMap", ADMIN_KICK) g_coloredMenus = colored_menus() } public cmdCancelVote(id, level, cid) { if (!cmd_access(id, level, cid, 0)) return PLUGIN_HANDLED if (task_exists(99889988, 1)) { new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) log_amx("Vote: ^"%s<%d><%s><>^" cancel vote session", name, get_user_userid(id), authid) new msg[256]; for (new i = 1; i <= MaxClients; i++) { if (is_user_connected(i) && !is_user_bot(i)) { // HACK: ADMIN_CANC_VOTE_{1,2} keys were designed very poorly. Remove all : and %s in it. LookupLangKey(msg, charsmax(msg), "ADMIN_CANC_VOTE_1", i); replace_all(msg, charsmax(msg), "%s", ""); replace_all(msg, charsmax(msg), ":", ""); trim(msg); show_activity_id(i, id, name, msg); } } console_print(id, "%L", id, "VOTING_CANC") client_print(0,print_chat,"%L",LANG_PLAYER,"VOTING_CANC") remove_task(99889988, 1) set_cvar_float("amx_last_voting", get_gametime()) } else console_print(id, "%L", id, "NO_VOTE_CANC") return PLUGIN_HANDLED } public delayedExec(cmd[]) server_cmd("%s", cmd) public autoRefuse() { log_amx("Vote: %L", "en", "RES_REF") client_print(0, print_chat, "%L", LANG_PLAYER, "RES_REF") } public actionResult(id, key) { remove_task(4545454) switch (key) { case 0: { set_task(2.0, "delayedExec", 0, g_Execute, g_execLen) log_amx("Vote: %L", "en", "RES_ACCEPTED") client_print(0, print_chat, "%L", LANG_PLAYER, "RES_ACCEPTED") } case 1: autoRefuse() } return PLUGIN_HANDLED } public checkVotes() { new best = 0 if (!g_yesNoVote) { for (new a = 0; a < 4; ++a) if (g_voteCount[a] > g_voteCount[best]) best = a } new votesNum = g_voteCount[0] + g_voteCount[1] + g_voteCount[2] + g_voteCount[3] new iRatio = votesNum ? floatround(g_voteRatio * float(votesNum), floatround_ceil) : 1 new iResult = g_voteCount[best] new players[MAX_PLAYERS], pnum, i get_players(players, pnum, "c") if (iResult < iRatio) { new lVotingFailed[64] for (i = 0; i < pnum; i++) { format(lVotingFailed, 63, "%L", players[i], "VOTING_FAILED") if (g_yesNoVote) client_print(players[i], print_chat, "%L", players[i], "VOTING_RES_1", lVotingFailed, g_voteCount[0], g_voteCount[1], iRatio) else client_print(players[i], print_chat, "%L", players[i], "VOTING_RES_2", lVotingFailed, iResult, iRatio) } format(lVotingFailed, 63, "%L", "en", "VOTING_FAILED") log_amx("Vote: %s (got ^"%d^") (needed ^"%d^")", lVotingFailed, iResult, iRatio) return PLUGIN_CONTINUE } g_execLen = format(g_Execute, charsmax(g_Execute), g_Answer, g_optionName[best]) + 1 if (g_execResult) { g_execResult = false if (is_user_connected(g_voteCaller)) { new menuBody[512], lTheResult[32], lYes[16], lNo[16] format(lTheResult, charsmax(lTheResult), "%L", g_voteCaller, "THE_RESULT") format(lYes, charsmax(lYes), "%L", g_voteCaller, "YES") format(lNo, charsmax(lNo), "%L", g_voteCaller, "NO") new len = format(menuBody, charsmax(menuBody), g_coloredMenus ? "\y%s: \w%s^n^n" : "%s: %s^n^n", lTheResult, g_Execute) len += format(menuBody[len], charsmax(menuBody) - len, g_coloredMenus ? "\y%L^n\w" : "%L^n", g_voteCaller, "WANT_CONTINUE") format(menuBody[len], charsmax(menuBody) - len, "^n1. %s^n2. %s", lYes, lNo) show_menu(g_voteCaller, 0x03, menuBody, 10, "The result: ") set_task(10.0, "autoRefuse", 4545454) } else set_task(2.0, "delayedExec", 0, g_Execute, g_execLen) } new lVotingSuccess[32] for (i = 0; i < pnum; i++) { format(lVotingSuccess, charsmax(lVotingSuccess), "%L", players[i], "VOTING_SUCCESS") client_print(players[i], print_chat, "%L", players[i], "VOTING_RES_3", lVotingSuccess, iResult, iRatio, g_Execute) } format(lVotingSuccess, charsmax(lVotingSuccess), "%L", "en", "VOTING_SUCCESS") log_amx("Vote: %s (got ^"%d^") (needed ^"%d^") (result ^"%s^")", lVotingSuccess, iResult, iRatio, g_Execute) return PLUGIN_CONTINUE } public voteCount(id, key) { if (get_cvar_num("amx_vote_answers")) { new name[MAX_NAME_LENGTH] get_user_name(id, name, charsmax(name)) if (g_yesNoVote) client_print(0, print_chat, "%L", LANG_PLAYER, key ? "VOTED_AGAINST" : "VOTED_FOR", name) else client_print(0, print_chat, "%L", LANG_PLAYER, "VOTED_FOR_OPT", name, key + 1) } ++g_voteCount[key] return PLUGIN_HANDLED } public cmdVoteMap(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new Float:voting = get_cvar_float("amx_last_voting") if (voting > get_gametime()) { console_print(id, "%L", id, "ALREADY_VOTING") return PLUGIN_HANDLED } if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) { console_print(id, "%L", id, "VOTING_NOT_ALLOW") return PLUGIN_HANDLED } new argc = read_argc() if (argc > 5) argc = 5 g_validMaps = 0 g_optionName[0][0] = 0 g_optionName[1][0] = 0 g_optionName[2][0] = 0 g_optionName[3][0] = 0 for (new i = 1; i < argc; ++i) { read_argv(i, g_optionName[g_validMaps], 31) if (is_map_valid(g_optionName[g_validMaps])) g_validMaps++ } if (g_validMaps == 0) { new lMaps[16] format(lMaps, charsmax(lMaps), "%L", id, (argc == 2) ? "MAP_IS" : "MAPS_ARE") console_print(id, "%L", id, "GIVEN_NOT_VALID", lMaps) return PLUGIN_HANDLED } new menu_msg[256], len = 0 new keys = 0 if (g_validMaps > 1) { keys = MENU_KEY_0 len = format(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%L: \w^n^n" : "%L: ^n^n", LANG_SERVER, "CHOOSE_MAP") new temp[128] for (new a = 0; a < g_validMaps; ++a) { format(temp, charsmax(temp), "%d. %s^n", a+1, g_optionName[a]) len += copy(menu_msg[len], charsmax(menu_msg) - len, temp) keys |= (1<<a) } format(menu_msg[len], charsmax(menu_msg) - len, "^n0. %L", LANG_SERVER, "NONE") g_yesNoVote = 0 } else { new lChangeMap[32], lYes[16], lNo[16] format(lChangeMap, charsmax(lChangeMap), "%L", LANG_SERVER, "CHANGE_MAP_TO") format(lYes, charsmax(lYes), "%L", LANG_SERVER, "YES") format(lNo, charsmax(lNo), "%L", LANG_SERVER, "NO") format(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%s %s?\w^n^n1. %s^n2. %s" : "%s %s?^n^n1. %s^n2. %s", lChangeMap, g_optionName[0], lYes, lNo) keys = MENU_KEY_1|MENU_KEY_2 g_yesNoVote = 1 } new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) if (argc == 2) log_amx("Vote: ^"%s<%d><%s><>^" vote map (map ^"%s^")", name, get_user_userid(id), authid, g_optionName[0]) else log_amx("Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")", name, get_user_userid(id), authid, g_optionName[0], g_optionName[1], g_optionName[2], g_optionName[3]) new msg[256]; for (new i = 1; i <= MaxClients; i++) { if (is_user_connected(i) && !is_user_bot(i)) { // HACK: ADMIN_VOTE_MAP_{1,2} keys were designed very poorly. Remove all : and %s in it. LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_MAP_1", i); replace_all(msg, charsmax(msg), "%s", ""); replace_all(msg, charsmax(msg), ":", ""); trim(msg); show_activity_id(i, id, name, msg); } } g_execResult = true new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0 set_cvar_float("amx_last_voting", get_gametime() + vote_time) g_voteRatio = get_cvar_float("amx_votemap_ratio") g_Answer = "changelevel %s" show_menu(0, keys, menu_msg, floatround(vote_time), (g_validMaps > 1) ? "Choose map: " : "Change map to ") set_task(vote_time, "checkVotes", 99889988) g_voteCaller = id console_print(id, "%L", id, "VOTING_STARTED") g_voteCount = {0, 0, 0, 0} return PLUGIN_HANDLED } public cmdVote(id, level, cid) { if (!cmd_access(id, level, cid, 4)) return PLUGIN_HANDLED new Float:voting = get_cvar_float("amx_last_voting") if (voting > get_gametime()) { console_print(id, "%L", id, "ALREADY_VOTING") return PLUGIN_HANDLED } if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) { console_print(id, "%L", id, "VOTING_NOT_ALLOW") return PLUGIN_HANDLED } new quest[48] read_argv(1, quest, charsmax(quest)) trim(quest); if (containi(quest, "sv_password") != -1 || containi(quest, "rcon_password") != -1) { console_print(id, "%L", id, "VOTING_FORBIDDEN") return PLUGIN_HANDLED } new count=read_argc(); for (new i=0;i<4 && (i+2)<count;i++) { read_argv(i+2, g_optionName[i], charsmax(g_optionName[])); } new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) log_amx("Vote: ^"%s<%d><%s><>^" vote custom (question ^"%s^") (option#1 ^"%s^") (option#2 ^"%s^")", name, get_user_userid(id), authid, quest, g_optionName[0], g_optionName[1]) new msg[256]; for (new i = 1; i <= MaxClients; i++) { if (is_user_connected(i) && !is_user_bot(i)) { // HACK: ADMIN_VOTE_CUS_{1,2} keys were designed very poorly. Remove all : and %s in it. LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_CUS_1", i); replace_all(msg, charsmax(msg), "%s", ""); replace_all(msg, charsmax(msg), ":", ""); trim(msg); show_activity_id(i, id, name, msg); } } new menu_msg[512], lVote[16] format(lVote, charsmax(lVote), "%L", LANG_SERVER, "VOTE") count-=2; if (count>4) { count=4; } // count now shows how many options were listed new keys=0; for (new i=0;i<count;i++) { keys |= (1<<i); } new len=formatex(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%s: %s\w^n^n" : "%s: %s^n^n", lVote, quest); for (new i=0;i<count;i++) { len+=formatex(menu_msg[len], charsmax(menu_msg) - len ,"%d. %s^n",i+1,g_optionName[i]); } g_execResult = false new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0 set_cvar_float("amx_last_voting", get_gametime() + vote_time) g_voteRatio = get_cvar_float("amx_vote_ratio") replace_all(quest, charsmax(quest), "%", ""); format(g_Answer, charsmax(g_Answer), "%s - ^"%%s^"", quest) show_menu(0, keys, menu_msg, floatround(vote_time), "Vote: ") set_task(vote_time, "checkVotes", 99889988) g_voteCaller = id console_print(id, "%L", id, "VOTING_STARTED") g_voteCount = {0, 0, 0, 0} g_yesNoVote = 0 return PLUGIN_HANDLED } public cmdVoteKickBan(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED new Float:voting = get_cvar_float("amx_last_voting") if (voting > get_gametime()) { console_print(id, "%L", id, "ALREADY_VOTING") return PLUGIN_HANDLED } if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) { console_print(id, "%L", id, "VOTING_NOT_ALLOW") return PLUGIN_HANDLED } new cmd[32] read_argv(0, cmd, charsmax(cmd)) new voteban = equal(cmd, "amx_voteban") 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 if (voteban && is_user_bot(player)) { new imname[MAX_NAME_LENGTH] get_user_name(player, imname, charsmax(imname)) console_print(id, "%L", id, "ACTION_PERFORMED", imname) return PLUGIN_HANDLED } new keys = MENU_KEY_1|MENU_KEY_2 new menu_msg[256], lYes[16], lNo[16], lKickBan[16] format(lYes, charsmax(lYes), "%L", LANG_SERVER, "YES") format(lNo, charsmax(lNo), "%L", LANG_SERVER, "NO") format(lKickBan, charsmax(lKickBan), "%L", LANG_SERVER, voteban ? "BAN" : "KICK") ucfirst(lKickBan) get_user_name(player, arg, charsmax(arg)) format(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%s %s?\w^n^n1. %s^n2. %s" : "%s %s?^n^n1. %s^n2. %s", lKickBan, arg, lYes, lNo) g_yesNoVote = 1 new bool:ipban=false; if (voteban) { get_user_authid(player, g_optionName[0], charsmax(g_optionName[])); // Do the same check that's in plmenu to determine if this should be an IP ban instead if (equal("4294967295", g_optionName[0]) || equal("HLTV", g_optionName[0]) || equal("STEAM_ID_LAN", g_optionName[0]) || equali("VALVE_ID_LAN", g_optionName[0])) { get_user_ip(player, g_optionName[0], charsmax(g_optionName[]), 1); ipban=true; } } else { num_to_str(get_user_userid(player), g_optionName[0], charsmax(g_optionName[])) } new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, charsmax(authid)) get_user_name(id, name, charsmax(name)) log_amx("Vote: ^"%s<%d><%s><>^" vote %s (target ^"%s^")", name, get_user_userid(id), authid, voteban ? "ban" : "kick", arg) new msg[256]; new right[256]; new dummy[1]; for (new i = 1; i <= MaxClients; i++) { if (is_user_connected(i) && !is_user_bot(i)) { formatex(lKickBan, charsmax(lKickBan), "%L", i, voteban ? "BAN" : "KICK"); // HACK: ADMIN_VOTE_FOR{1,2} keys are really weird. Tokenize and ignore the text before the : LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_FOR_1", i); strtok(msg, dummy, 0, right, charsmax(right), ':'); trim(right); show_activity_id(i, id, name, right, lKickBan, arg); } } g_execResult = true new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0 set_cvar_float("amx_last_voting", get_gametime() + vote_time) g_voteRatio = get_cvar_float(voteban ? "amx_voteban_ratio" : "amx_votekick_ratio") if (voteban) { if (ipban==true) { g_Answer = "addip 30.0 %s"; } else { g_Answer = "banid 30.0 %s kick"; } } else { g_Answer = "kick #%s"; } show_menu(0, keys, menu_msg, floatround(vote_time), voteban ? "Ban " : "Kick ") set_task(vote_time, "checkVotes", 99889988) g_voteCaller = id console_print(id, "%L", id, "VOTING_STARTED") g_voteCount = {0, 0, 0, 0} return PLUGIN_HANDLED } Przeczytaj cały wpis
  22. A plugin for Setting a Client's Team, this was mainly made so admins can either force bots onto a specific team or choose a team for someone. In this plugin you can only specify all the way up to TeamNum 5 which is the max for Open Fortress and might be about the same for Team Fortress 2 Classic. This is another command invoking plugin that uses ent_fire as the base to set a target's team which means sv_cheats must be enabled and that person must have the rights to use ent_fire in the first place. Some of the code was largely based off of the plugin cexec, which i had originally made this idea into a small plugin that when combined with cexec would allow the admin to change the team of a client, but now you can do it all in one here! Cvars: sm_setteam <CLIENT> <TEAMNUMBER> Attached Files Setteam.smx (4.7 KB) Get Plugin or Get Source (Setteam.sp - 1.9 KB) Wyświetl pełny artykuł
  23. A plugin that was made for admins to put the addcond conditions onto specified clients when sv_cheats 1 is enabled, you'd typically need to combine sv_cheats with some form of anti cheat command plugin that makes sv_cheats relatively useless for non-admin clients. So have fun applying conditions to your players! Keep in mind that this plugin can only invoke the addcond command and doesn't use it's own custom condtion functions to make conditions apply to players, as that would be too complicated so instead we use addcond as the base and apply the command to the specified target! Btw this was also mainly centered around TF2 and it's sourcemod's so feel free to use this plugin on those games aswell! Cvars: sm_addcond <Client> <Condition Number> Attached Files AddcondPlugin.smx (4.7 KB) Get Plugin or Get Source (AddcondPlugin.sp - 2.2 KB) Wyświetl pełny artykuł
  24. This is a simple plugin who add the country of the player in the chat when he join the game. Ex: Ranily has joined the game from germany No CVAR command for now, and work in english only, but new update can come soon ! This plugins doesn't need anything, just put the .smx on the /addons/sourcemod/plugins folder and that's it ! Source Code Attached Files Get Plugin or Get Source (Country_Message.sp - 727 Bytes) Wyświetl pełny artykuł
  25. Wcześniejsza
  26. hello im currently making a cz tour of duty that adds cut content of condition zero im currently finding a m60 plugin i kept searching but the other doesnt work if anyone knows a m60 plugin please help Przeczytaj cały wpis
  27. This is a simple plugin who add the country of the player in the chat when he join the game. Ex: Ranily has joined the game from germany This plugins doesn't need anything, just put the .smx on the /addons/sourcemod/plugins folder and that's it ! Source Code Attached Files Get Plugin or Get Source (Country_Message.sp - 727 Bytes) Przeczytaj cały wpis
  28. MYGO.pl

    RSSWelcome

    Hi Iv been looking for a plugin cs1.6 or somehow to welcome every player that joins the server with a welcome ie welcome "new player name " to "server name" This message too come up in the chat messages area bottom left with all the other messages, a colour choice would be good also. I sure its out there but I cant find it or anything like it, hopefully someone out there does know. Thanks Przeczytaj cały wpis
  29. https://dev-cs.ru/resources/494/ I saw it from this website Because I couldn’t find any relevant content here (or I didn’t see it myself) Players will throw C4 randomly or in places where it cannot be picked up. Attached Files Get Plugin or Get Source (c4_drop_0_7.sma - 2.0 KB) Przeczytaj cały wpis
  30. Descriptionsince the compatibility of my restart empty server plugin is not perfect, I deviced to provide this plugin. It can load custom commands on server empty. Cvars PHP Code: load_command_on_empty_path "data/load_command_on_empty.txt" Change log Spoiler Code: 1.0 (2024-04-30: -init public release. Configs installationcreate a file named "load_command_on_empty.txt" at "sourcemod/data/", put commands into each line of the file. if you changed the "path" cvar, you have to change the file name or path too! Attached Files Get Plugin or Get Source (load_command_on_empty.sp - 2.1 KB) Wyświetl pełny artykuł
  1. Pokaż więcej elementów aktywności
×
×
  • Dodaj nową pozycję...