├── LICENSE ├── README.md ├── Style_Parkour-default.sp ├── Style_Parkour.sp ├── auto-vprof.sp ├── ban_pike.sp ├── ban_spooks.sp ├── banhammer.sp ├── bhop.sp ├── bhop_vote.sp ├── block_nav.sp ├── bspconvarwhitelist.sp ├── classname_fix.sp ├── collection_fix.sp ├── double_restart.sp ├── dummy_menu.sp ├── dz_fix.sp ├── entity_hooker.sp ├── fcheat.sp ├── forcemapend.sp ├── gun_menu.sp ├── helix_shoots_fast.sp ├── include ├── EasyHTTP.inc ├── EntityHooker │ ├── API_EntityHooker.sp │ ├── desktop.ini │ ├── entity_hooker.inc │ └── sql_plugin_entity_hooker.txt ├── EventLogs.inc ├── PTaH.inc ├── SteamWorks.inc ├── ToggleEffects.inc ├── addicted.inc ├── admin.inc ├── adminmenu.inc ├── adt.inc ├── adt_array.inc ├── adt_stack.inc ├── adt_trie.inc ├── autoexecconfig.inc ├── bTimes-LAN.inc ├── bTimes-core.inc ├── bTimes-ghost.inc ├── bTimes-gunjump.inc ├── bTimes-jumpstats.inc ├── bTimes-random.inc ├── bTimes-ranks.inc ├── bTimes-tas.inc ├── bTimes-timer.inc ├── bTimes-timer_hack.inc ├── bTimes-zones.inc ├── bank.inc ├── banning.inc ├── base64.inc ├── basecomm.inc ├── bash - Copy.inc ├── bash.inc ├── bhopstats.inc ├── bitbuffer.inc ├── button.inc ├── chat-processor.inc ├── clientprefs.inc ├── clientprefs_stocks.inc ├── clients.inc ├── clientvoice.inc ├── colors.inc ├── colors_csgo.inc ├── colorvariables.inc ├── commandfilters.inc ├── commandline.inc ├── console.inc ├── convars.inc ├── convert.inc ├── core.inc ├── csgocolors.inc ├── csteamid.inc ├── cstrike.inc ├── datapack.inc ├── db_stocks.inc ├── dbi.inc ├── desktop.ini ├── devzones.inc ├── dhooks.inc ├── dice.inc ├── dump_parser.inc ├── emitsoundany.inc ├── ent_stocks.inc ├── entity.inc ├── entity_prop_stocks.inc ├── events.inc ├── files.inc ├── float.inc ├── foo.inc ├── functions.inc ├── geoip.inc ├── gungame_const.inc ├── halflife.inc ├── handles.inc ├── helpers.inc ├── hextags.inc ├── hgr.inc ├── hls_color_chat.inc ├── influx │ ├── ac_log.inc │ ├── core.inc │ ├── desktop.ini │ ├── fpscheck.inc │ ├── help.inc │ ├── hud.inc │ ├── hud_draw.inc │ ├── jumps.inc │ ├── maprankings.inc │ ├── pause.inc │ ├── practise.inc │ ├── prespeed.inc │ ├── recording.inc │ ├── runs_sql.inc │ ├── simpleranks.inc │ ├── stocks_chat.inc │ ├── stocks_core.inc │ ├── stocks_strf.inc │ ├── strafes.inc │ ├── strfsync.inc │ ├── style_tas.inc │ ├── teams.inc │ ├── teletoend.inc │ ├── truevel.inc │ ├── zones.inc │ ├── zones_autobhop.inc │ ├── zones_beams.inc │ ├── zones_block.inc │ ├── zones_checkpoint.inc │ ├── zones_freestyle.inc │ ├── zones_stage.inc │ ├── zones_teleport.inc │ └── zones_timer.inc ├── json.inc ├── json │ ├── decode_helpers.inc │ ├── definitions.inc │ ├── encode_helpers.inc │ ├── object.inc │ └── string_helpers.inc ├── jumpstats.inc ├── kac.inc ├── keyvalues.inc ├── kid-stages.inc ├── kid.inc ├── kid_tas.inc ├── kvizzle.inc ├── kztimer.inc ├── lang.inc ├── latedl.inc ├── level_keyvalues.inc ├── logging.inc ├── mapchooser.inc ├── mapchooser_extended.inc ├── mapchooser_redux.inc ├── mapzonelib.inc ├── marktouching.inc ├── math │ ├── math.inc │ ├── math_array_statistics.inc │ ├── math_constants.inc │ ├── math_trig.inc │ └── math_vector.inc ├── menus.inc ├── more_adt.inc ├── morecolors.inc ├── mostactive.inc ├── movement.inc ├── movementapi.inc ├── movementtweaker.inc ├── msharedutil │ ├── arrayvec.inc │ ├── desktop.ini │ ├── ents.inc │ └── misc.inc ├── multicolors.inc ├── multicolors │ ├── colors.inc │ ├── desktop.ini │ └── morecolors.inc ├── nativevotes.inc ├── nextmap.inc ├── opentimer │ ├── core.inc │ ├── desktop.ini │ └── stocks.inc ├── oryx.inc ├── outputinfo.inc ├── precache_manager.inc ├── profiler.inc ├── protobuf.inc ├── regex.inc ├── ripext.inc ├── ripext │ ├── http.inc │ └── json.inc ├── rtler.inc ├── scp.inc ├── sdkhooks.inc ├── sdktools.inc ├── sdktools_client.inc ├── sdktools_engine.inc ├── sdktools_entinput.inc ├── sdktools_entoutput.inc ├── sdktools_functions.inc ├── sdktools_gamerules.inc ├── sdktools_hooks.inc ├── sdktools_sound.inc ├── sdktools_stocks.inc ├── sdktools_stringtables.inc ├── sdktools_tempents.inc ├── sdktools_tempents_stocks.inc ├── sdktools_trace.inc ├── sdktools_variant_t.inc ├── sdktools_voice.inc ├── sendproxy.inc ├── shavit.inc ├── shavit_KZ.inc ├── shavit_client.inc ├── shavit_extra.inc ├── shavit_influx.inc ├── shavit_replay.inc ├── shavit_whitelist.inc ├── shooting.inc ├── sm_cpsaver.inc ├── smac.inc ├── smac_cvars.inc ├── smac_stocks.inc ├── smac_wallhack.inc ├── smc.inc ├── smlib.inc ├── smlib │ ├── arrays.inc │ ├── clients.inc │ ├── colors.inc │ ├── concommands.inc │ ├── convars.inc │ ├── crypt.inc │ ├── debug.inc │ ├── desktop.ini │ ├── dynarrays.inc │ ├── edicts.inc │ ├── effects.inc │ ├── entities.inc │ ├── files.inc │ ├── game.inc │ ├── general.inc │ ├── math.inc │ ├── menus.inc │ ├── server.inc │ ├── sql.inc │ ├── strings.inc │ ├── teams.inc │ ├── vehicles.inc │ ├── weapons.inc │ └── world.inc ├── socket.inc ├── sorting.inc ├── soundlib.inc ├── sourcebans.inc ├── sourcecomms.inc ├── sourcemod-misc.inc ├── sourcemod.inc ├── sourcetvmanager.inc ├── steamtools.inc ├── stocksoup │ ├── .gitattributes │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── client.inc │ ├── color_literals.inc │ ├── colors.inc │ ├── datapack.inc │ ├── datapack_frame.inc │ ├── download_filter_query.inc │ ├── entity.inc │ ├── entity_prefabs.inc │ ├── entity_tools.inc │ ├── files.inc │ ├── handles.inc │ ├── library_watcher.inc │ ├── log_server.inc │ ├── maps.inc │ ├── memory.inc │ ├── plugin_utils.inc │ ├── sdkports │ │ ├── player.inc │ │ ├── util.inc │ │ └── vector.inc │ ├── string.inc │ ├── testing.inc │ ├── tf │ │ ├── annotations.inc │ │ ├── client.inc │ │ ├── community_modes.inc │ │ ├── econ.inc │ │ ├── entity_prefabs.inc │ │ ├── enum │ │ │ ├── achievements.inc │ │ │ ├── bot_skills.inc │ │ │ ├── charge_resist_types.inc │ │ │ └── spells.inc │ │ ├── hud_notify.inc │ │ ├── monster_resource.inc │ │ ├── player.inc │ │ ├── set_round_winner.inc │ │ ├── teams.inc │ │ ├── tempents_stocks.inc │ │ ├── voice_hook.inc │ │ └── weapon.inc │ ├── timers.inc │ ├── value_remap.inc │ └── version.inc ├── strafeodyssey-stocks.inc.why ├── strafeodyssey.inc ├── string.inc ├── structs │ ├── strings.inc │ └── vel_test.inc ├── testing.inc ├── textparse.inc ├── tf2.inc ├── tf2_stocks.inc ├── tf2items.inc ├── thelpers │ ├── animating.inc │ ├── combatcharacter.inc │ ├── combatweapon.inc │ ├── css │ │ ├── css.inc │ │ ├── gamerules.inc │ │ └── player.inc │ ├── econ │ │ ├── econ.inc │ │ └── entity.inc │ ├── entity.inc │ ├── gamerules.inc │ ├── player.inc │ ├── tf2 │ │ ├── gamerules.inc │ │ ├── objects.inc │ │ ├── player.inc │ │ ├── projectiles.inc │ │ └── tf2.inc │ └── thelpers.inc ├── timer_obj.inc ├── timers.inc ├── topmenus.inc ├── tr_trigger.inc ├── umc-core.inc ├── umc-endvote.inc ├── umc-playerlimits.inc ├── umc_utils.inc ├── updater.inc ├── usermessages.inc ├── vector.inc ├── vector_class.inc ├── version.inc ├── version_auto.inc ├── voiceannounce_ex.inc ├── vphysics.inc ├── vscriptfun.inc └── zones_manager_core.inc ├── kid-256.smx ├── kid-256.sp ├── kid-256tick.smx ├── kid-256tick.sp ├── kid-afkcheck.smx ├── kid-afkcheck.sp ├── kid-autostrafe.sp ├── kid-backwards.sp ├── kid-botpath.sp ├── kid-changes.smx ├── kid-changes.sp ├── kid-cpmenu.sp ├── kid-css.sp ├── kid-end.sp ├── kid-event.sp ├── kid-fov.sp ├── kid-grabstyle.sp ├── kid-hud.sp ├── kid-legitcss.sp ├── kid-legiteasy.sp ├── kid-mapchooser.sp ├── kid-moonshoes.sp ├── kid-parkour.sp ├── kid-parkour_ws.sp ├── kid-replaybackups.sp ├── kid-replayfix.sp ├── kid-setspawn.sp ├── kid-slash-csgo.sp ├── kid-ssj.sp ├── kid-ssj2.sp ├── kid-stages.sp ├── kid-stagesv2.sp ├── kid-surfoptimizer.sp ├── kid-thirdperson.sp ├── kidsabusivecommands.sp ├── knife_menu.sp ├── kzmenu.sp ├── loadingscreen_radar_downloader.sp ├── mapconfig.sp ├── mapcyclev2.sp ├── mapsize.sp ├── nav_generate_fix.sp ├── nav_quicksave.sp ├── nulls3.sp ├── onmapend.sp ├── oryx-configcheck.sp ├── pannycakes.sp ├── pickmelee.sp ├── precache_manager.sp ├── prestrafe.sp ├── reload_replays.sp ├── restrict_nau.sp ├── retry.sp ├── setconvar.sp ├── shavit-replay-to-csv.sp ├── simplecsgoextend.sp ├── simplejumpstats.sp ├── simplesleuth.sp ├── sm_pb.sp ├── sm_restart.sp ├── spawn_adder.sp ├── sql_mapstats.sp ├── strafe_trainer.sp ├── strafebooster.sp ├── strafestat.sp ├── tas-hud.sp ├── teamname_timer.sp └── weapon_cleanup.sp /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 kidfearless 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ban_spooks.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int spooks = -1; 6 | 7 | ConVar sv_maxupdaterate = null; 8 | ConVar sv_minrate = null; 9 | ConVar sv_maxrate = null; 10 | ConVar sv_minupdaterate = null; 11 | ConVar sv_mincmdrate = null; 12 | ConVar sv_jump_impulse = null; 13 | 14 | 15 | Handle gH_Timer; 16 | 17 | public void OnPluginStart() 18 | { 19 | gH_Timer = CreateTimer(5.0, Timer_Spooks, _, TIMER_REPEAT); 20 | sv_maxupdaterate = FindConVar("sv_maxupdaterate"); 21 | sv_minupdaterate = FindConVar("sv_minupdaterate"); 22 | sv_mincmdrate = FindConVar("sv_mincmdrate"); 23 | sv_maxrate = FindConVar("sv_maxrate"); 24 | sv_minrate = FindConVar("sv_minrate"); 25 | sv_jump_impulse = FindConVar("sv_jump_impulse"); 26 | } 27 | 28 | public void OnPluginEnd() 29 | { 30 | gH_Timer.Close(); 31 | } 32 | 33 | public Action Timer_Spooks(Handle hdnle) 34 | { 35 | if(spooks != -1) 36 | { 37 | ClientCommand(spooks, "play weapons/hegrenade/explode4.wav"); 38 | sv_maxrate.ReplicateToClient(spooks, "1"); 39 | sv_minrate.ReplicateToClient(spooks, "1"); 40 | sv_maxupdaterate.ReplicateToClient(spooks, "1"); 41 | sv_minupdaterate.ReplicateToClient(spooks, "1"); 42 | sv_mincmdrate.ReplicateToClient(spooks, "1"); 43 | sv_jump_impulse.ReplicateToClient(spooks, "100000"); 44 | BaseComm_SetClientGag(spooks, true); 45 | BaseComm_SetClientMute(spooks, true); 46 | } 47 | return Plugin_Continue; 48 | } 49 | 50 | public void OnClientPostAdminCheck(int client) 51 | { 52 | char ip[32]; 53 | GetClientIP(client, ip, sizeof(ip)); 54 | if(StrContains(ip, "11.111.11.111") != -1) 55 | { 56 | spooks = client; 57 | } 58 | } 59 | 60 | public void OnClientDisconnect(int client) 61 | { 62 | if(client == spooks) 63 | { 64 | spooks = -1; 65 | } 66 | } 67 | 68 | public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype) 69 | { 70 | if(client == spooks) 71 | { 72 | PrintToChat(spooks, "I'M A DIPSHIT"); 73 | PrintToConsole(spooks, "WHO DOESN'T KNOW WHEN TO LEAVE"); 74 | } 75 | vel[0] = 0.0; 76 | vel[1] = 0.0; 77 | impulse = 0; 78 | buttons = 0; 79 | return Plugin_Stop; 80 | } -------------------------------------------------------------------------------- /bhop.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #pragma semicolon 1 7 | float gF_TimeSinceLastJump[MAXPLAYERS]; 8 | bool gB_GiveJump[MAXPLAYERS]; 9 | 10 | public void OnPluginStart() 11 | { 12 | HookEvent("player_jump", OnPlayerJump); 13 | } 14 | 15 | public void OnPlayerJump(Event event, const char[] name, bool dontBroadcast) 16 | { 17 | int client = GetClientOfUserId(event.GetInt("userid")); 18 | gF_TimeSinceLastJump[client] = 0.0; 19 | } 20 | 21 | public void OnClientPutInServer(int client) 22 | { 23 | gF_TimeSinceLastJump[client] = 0.0; 24 | gB_GiveJump[client] = false; 25 | } 26 | 27 | public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status, int track, int style, stylesettings_t stylesettings, int mouse[2]) 28 | { 29 | if(stylesettings.bAutobhop) 30 | { 31 | if(GetEntityMoveType(client) != 0) 32 | { 33 | if(buttons & IN_JUMP == IN_JUMP) 34 | { 35 | if((GetEntityFlags(client) & FL_ONGROUND) != 0) 36 | { 37 | gF_TimeSinceLastJump[client] = GetEngineTime(); 38 | buttons &= ~IN_JUMP; 39 | return Plugin_Changed; 40 | } 41 | } 42 | else if(GetEngineTime() - gF_TimeSinceLastJump[client] < 0.05) 43 | { 44 | if(GetEntityFlags(client) & FL_ONGROUND > 0) 45 | { 46 | buttons |= IN_JUMP; 47 | } 48 | } 49 | } 50 | } 51 | return Plugin_Continue; 52 | } 53 | 54 | stock float GetClientSpeedSq( int client ) 55 | { 56 | float x = GetEntPropFloat( client, Prop_Send, "m_vecVelocity[0]" ); 57 | float y = GetEntPropFloat( client, Prop_Send, "m_vecVelocity[1]" ); 58 | 59 | return x*x + y*y; 60 | } 61 | 62 | stock float GetClientSpeed( int client ) 63 | { 64 | float speed = SquareRoot( x*x + y*y; ); 65 | if(IsFakeClient(client)) 66 | { 67 | speed -= 15.0; 68 | } 69 | return speed; 70 | } -------------------------------------------------------------------------------- /bhop_vote.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | //Change the following to limit the number of time this kind of vote is called 4 | #define maxVote 1 5 | 6 | int voteTimes; 7 | 8 | 9 | public OnPluginStart() 10 | { 11 | HookEvent("round_start", OnRoundStart, EventHookMode_PostNoCopy); 12 | } 13 | 14 | public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast) 15 | { 16 | voteTimes = 0; 17 | } 18 | 19 | public OnMapStart() 20 | { 21 | voteTimes = 0; 22 | } 23 | 24 | 25 | public Handle_VoteMenu(Handle:menu, MenuAction:action, param1, param2) 26 | { 27 | if (action == MenuAction_End) 28 | { 29 | /* This is called after VoteEnd */ 30 | CloseHandle(menu); 31 | } 32 | else if (action == MenuAction_VoteEnd) 33 | { 34 | /* 0=yes, 1=no */ 35 | if (param1 == 0) 36 | { 37 | PrintToChatAll("Vote has failed. YOU fools voted no!!! How dare you incoming bands"); 38 | voteTimes = voteTimes+1; 39 | FindConVar("sv_autobunnyhopping").SetInt(0); 40 | } 41 | else 42 | { 43 | PrintToChatAll("YES is the answer to autobhop"); 44 | voteTimes = voteTimes+1; 45 | FindConVar("sv_autobunnyhopping").SetInt(1); 46 | } 47 | } 48 | } 49 | 50 | 51 | 52 | 53 | public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs) 54 | { 55 | 56 | if ((strcmp(sArgs, "!autobhop", false) == 0)||(strcmp(sArgs, "/autobhop", false) == 0)) 57 | { 58 | 59 | if (voteTimes >= maxVote) 60 | { 61 | PrintToChat(client, "\x04[Vote-autobhop]\x03 There was already an autobhop vote."); 62 | return Plugin_Handled; 63 | } 64 | 65 | 66 | ShowActivity2(client, "[SM] ", "Initiated Vote autobhop"); 67 | LogAction(client, -1, "\"%L\" used vote-autobhop", client); 68 | new Handle:menu = CreateMenu(Handle_VoteMenu); 69 | SetMenuTitle(menu, "Turn on Autobhop so you can be Ph00n?"); 70 | AddMenuItem(menu, "notsure1", "No"); 71 | AddMenuItem(menu, "notsure2", "Yes"); 72 | SetMenuExitButton(menu, false); 73 | VoteMenuToAll(menu, 18); 74 | 75 | return Plugin_Handled; 76 | } 77 | 78 | 79 | return Plugin_Continue; 80 | } 81 | -------------------------------------------------------------------------------- /block_nav.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | public Plugin myinfo = 4 | { 5 | name = "Block Nav Mesh", 6 | author = "KiD Fearless", 7 | description = "Blocks Nav Meshes From Being Generated", 8 | version = "1.0", 9 | url = "https://steamcommunity.com/id/kidfearless/" 10 | } 11 | 12 | public void OnPluginStart() 13 | { 14 | HookEvent("nav_generate", OnNavGeneratePre, EventHookMode_Pre); 15 | } 16 | 17 | public Action OnNavGeneratePre(Event event, const char[] name, bool dontBroadcast) 18 | { 19 | return Plugin_Handled; 20 | } -------------------------------------------------------------------------------- /bspconvarwhitelist.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define PLUGIN_VERSION "1.2" 5 | 6 | #pragma newdecls required 7 | 8 | public Plugin myinfo = 9 | { 10 | name = "bspconvarwhitelist fix", 11 | author = "kid fearless", 12 | description = "deletes the bspconvarwhitelist.txt file when the server updates", 13 | version = PLUGIN_VERSION 14 | } 15 | 16 | public void OnPluginStart() 17 | { 18 | if(FileExists("bspconvar_whitelist.txt")) 19 | { 20 | DeleteFile("bspconvar_whitelist.txt"); 21 | } 22 | } -------------------------------------------------------------------------------- /classname_fix.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | public Plugin myinfo = 5 | { 6 | name = "Classname Fix", 7 | author = "KiD Fearless", 8 | description = "Sets classname on restart", 9 | version = "1.0", 10 | url = "https://steamcommunity.com/id/kidfearless/" 11 | } 12 | 13 | public void Shavit_OnRestart(int client, int track) 14 | { 15 | SetEntPropString(client, Prop_Data, "m_iClassname", "player"); 16 | } -------------------------------------------------------------------------------- /collection_fix.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define PLUGIN_VERSION "1.4" 5 | 6 | #pragma newdecls required 7 | 8 | public Plugin myinfo = 9 | { 10 | name = "Subscribed_collection_ids fix", 11 | author = "kid fearless", 12 | description = "Workshop Management Plugin", 13 | version = PLUGIN_VERSION 14 | } 15 | 16 | public void OnPluginStart() 17 | { 18 | char collections[PLATFORM_MAX_PATH]; 19 | char authKey[PLATFORM_MAX_PATH]; 20 | 21 | if(FileExists("workshop_collections.txt")) 22 | { 23 | File collectionHandle = OpenFile("workshop_collections.txt", "r"); 24 | collectionHandle.ReadLine(collections, sizeof(collections)); 25 | collectionHandle.Close(); 26 | } 27 | else 28 | { 29 | File collectionHandle = OpenFile("workshop_collections.txt", "a"); 30 | collectionHandle.Close(); 31 | } 32 | 33 | if(!FileExists("subscribed_collection_ids.txt")) 34 | { 35 | File dataFileHandle = OpenFile("subscribed_collection_ids.txt", "a"); 36 | dataFileHandle.WriteLine(collections); 37 | dataFileHandle.Close(); 38 | } 39 | 40 | if(FileExists("workshop_authkey.txt")) 41 | { 42 | File authHandle = OpenFile("workshop_authkey.txt", "r"); 43 | authHandle.ReadLine(authKey, sizeof(authKey)); 44 | authHandle.Close(); 45 | } 46 | 47 | if(!FileExists("webapi_authkey.txt")) 48 | { 49 | File authKeyHandle = OpenFile("webapi_authkey.txt", "a"); 50 | authKeyHandle.WriteLine(authKey); 51 | authKeyHandle.Close(); 52 | } 53 | 54 | 55 | ServerCommand("ds_get_newest_subscribed_files"); 56 | RegAdminCmd("updateworkshop", Command_Workshop, ADMFLAG_ROOT, "ds_get_newest_subscribed_files"); 57 | RegAdminCmd("update_workshop", Command_Workshop, ADMFLAG_ROOT, "ds_get_newest_subscribed_files"); 58 | } 59 | 60 | public Action Command_Workshop(int client, int args) 61 | { 62 | ServerCommand("ds_get_newest_subscribed_files"); 63 | ReplyToCommand(client, "Workshop Updated"); 64 | return Plugin_Handled; 65 | } -------------------------------------------------------------------------------- /double_restart.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #pragma semicolon 1 5 | #pragma newdecls required 6 | 7 | public Plugin myinfo = 8 | { 9 | name = "Double Restart Timer", 10 | author = "KiD Fearless", 11 | description = "Adds double click to restart client pref to the timer.", 12 | version = "1.1", 13 | url = "https://steamcommunity.com/id/kidfearless/" 14 | } 15 | 16 | bool gB_Clicked[MAXPLAYERS + 1]; 17 | float gF_LastTime[MAXPLAYERS + 1]; 18 | 19 | ConVar gC_RestartTime = null; 20 | 21 | Cookie Cookie_Restart = null; 22 | 23 | public void OnPluginStart() 24 | { 25 | RegConsoleCmd("sm_double_restart", Command_DoubleRestart, "Toggles double restart cookie"); 26 | AddCommandListener(RestartListener_Callback, "sm_r"); 27 | AddCommandListener(RestartListener_Callback, "sm_restart"); 28 | AddCommandListener(RestartListener_Callback, "sm_s"); 29 | AddCommandListener(RestartListener_Callback, "sm_start"); 30 | AddCommandListener(RestartListener_Callback, "sm_b"); 31 | AddCommandListener(RestartListener_Callback, "sm_bonus"); 32 | Cookie_Restart = new Cookie("double_restart", "When enabled players have to double tap restart after x seconds into a run", CookieAccess_Public); 33 | gC_RestartTime = CreateConVar("sm_double_restart_time", "2.0", "Time in seconds to double restart", _, true, 0.0); 34 | 35 | SetCookiePrefabMenu(Cookie_Restart.Ref, CookieMenu_YesNo_Int, "Double Restart"); 36 | AutoExecConfig(); 37 | } 38 | 39 | public void OnClientDisconnect(int client) 40 | { 41 | gB_Clicked[client] = false; 42 | gF_LastTime[client] = 0.0; 43 | } 44 | 45 | public Action Command_DoubleRestart(int client, int args) 46 | { 47 | Cookie_Restart.SetBool(client, !Cookie_Restart.GetBool(client)); 48 | ReplyToCommand(client, "Double Tap to restart %s", (Cookie_Restart.GetBool(client)?"Enabled.":"Disabled.")); 49 | return Plugin_Handled; 50 | } 51 | 52 | public Action RestartListener_Callback(int client, const char[] command, int argc) 53 | { 54 | if (Cookie_Restart.GetBool(client) && !Shavit_InsideZone(client, Zone_Start, -1)) 55 | { 56 | if (GetGameTime() - gF_LastTime[client] > gC_RestartTime.FloatValue) 57 | { 58 | gB_Clicked[client] = false; 59 | } 60 | if (!gB_Clicked[client]) 61 | { 62 | gF_LastTime[client] = GetGameTime(); 63 | gB_Clicked[client] = true; 64 | Shavit_PrintToChat(client, "Are you sure you want to restart?"); 65 | return Plugin_Stop; 66 | } 67 | 68 | gB_Clicked[client] = false; 69 | } 70 | return Plugin_Continue; 71 | } -------------------------------------------------------------------------------- /dummy_menu.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | public Plugin myinfo = 4 | { 5 | name = "Plugin Name", 6 | author = "KiD Fearless", 7 | description = "Plugin Description", 8 | version = "1.0", 9 | url = "https://steamcommunity.com/id/kidfearless/" 10 | } 11 | 12 | public void OnPluginStart() 13 | { 14 | RegConsoleCmd("sm_command", Command_Callback); 15 | } 16 | 17 | public Action Command_Callback(int client, int args) 18 | { 19 | return Plugin_Handled; 20 | } -------------------------------------------------------------------------------- /dz_fix.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | public Plugin myinfo = 4 | { 5 | name = "Survival Equip Fix", 6 | author = "KiD Fearless", 7 | description = "blocks the survival_equip command to prevent server crashes", 8 | version = "1.0", 9 | url = "https://steamcommunity.com/id/kidfearless/" 10 | } 11 | 12 | public void OnPluginStart() 13 | { 14 | AddCommandListener(Command_SurvivalEquip, "survival_equip"); 15 | } 16 | 17 | public Action Command_SurvivalEquip(int client, const char[] command, int argc) 18 | { 19 | return Plugin_Stop; 20 | } -------------------------------------------------------------------------------- /fcheat.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | Handle sv_cheats = null; 4 | 5 | public void OnPluginStart() 6 | { 7 | sv_cheats = FindConVar("sv_cheats"); 8 | SetCommandFlags("endround", FCVAR_NONE); 9 | SetCommandFlags("ent_remove", FCVAR_NONE); 10 | SetCommandFlags("air_density", FCVAR_NONE); 11 | 12 | HookEvent("player_spawn", Event_Player_Spawn, EventHookMode_Post); 13 | for(int i = 1; i <= MaxClients; i++) 14 | { 15 | if(IsClientInGame(i) && !IsFakeClient(i)) 16 | { 17 | SendConVarValue(i, sv_cheats, "2"); 18 | } 19 | } 20 | } 21 | 22 | public void OnClientPutInServer(int client) 23 | { 24 | if(!IsFakeClient(client)) 25 | { 26 | SendConVarValue(client, sv_cheats, "2"); 27 | } 28 | } 29 | 30 | public void Event_Player_Spawn(Event event, const char[] name, bool dontBroadcast) 31 | { 32 | int client = GetClientOfUserId(event.GetInt("userid")); 33 | 34 | if(!IsFakeClient(client)) 35 | { 36 | SendConVarValue(client, sv_cheats, "2"); 37 | } 38 | } 39 | 40 | //public void OnClientPostAdminCheck(int client) 41 | //{ 42 | // if(IsValidClient(client)) 43 | // { 44 | // SendConVarValue(client, sv_cheats, "1"); 45 | // } 46 | //} 47 | // 48 | //stock bool IsValidClient(int client, bool bAlive = false) 49 | //{ 50 | // return (client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && !IsClientSourceTV(client) && !IsFakeClient(client) && (!bAlive || IsPlayerAlive(client))); 51 | //} -------------------------------------------------------------------------------- /forcemapend.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | public Plugin myinfo = 5 | { 6 | name = "Force Map End", 7 | author = "KiD Fearless", 8 | description = "Forces the map to end for single round servers", 9 | version = "1.0", 10 | url = "https://steamcommunity.com/id/kidfearless/" 11 | } 12 | 13 | public Action CS_OnTerminateRound(float &delay, CSRoundEndReason &reason) 14 | { 15 | if(reason == CSRoundEnd_Draw) 16 | { 17 | FindConVar("mp_timelimit").IntValue = 0; 18 | FindConVar("mp_roundtime").IntValue = 0; 19 | } 20 | } -------------------------------------------------------------------------------- /helix_shoots_fast.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status, int track, int style, stylesettings_t stylesettings, int mouse[2]) 5 | { 6 | static int oldButtons[MAXPLAYERS+1]; 7 | 8 | char buffer[128]; 9 | Shavit_GetStyleStrings(style, sSpecialString, buffer, 128); 10 | if(StrContains(buffer, "swble") != -1) 11 | { 12 | return Plugin_Continue; 13 | } 14 | 15 | if(oldButtons[client] & IN_ATTACK && buttons & IN_ATTACK) 16 | { 17 | buttons &= ~IN_ATTACK; 18 | } 19 | 20 | oldButtons[client] = buttons; 21 | return Plugin_Continue; 22 | } -------------------------------------------------------------------------------- /include/EntityHooker/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=This folder is shared online. 3 | IconFile=C:\Program Files\Google\Drive\googledrivesync.exe 4 | IconIndex=16 5 | -------------------------------------------------------------------------------- /include/EntityHooker/entity_hooker.inc: -------------------------------------------------------------------------------- 1 | #if defined _entity_hooker_included 2 | #endinput 3 | #endif 4 | #define _entity_hooker_included 5 | 6 | 7 | public SharedPlugin:__pl_entity_hooker = 8 | { 9 | name = "entity_hooker", 10 | file = "API_EntityHooker.smx", 11 | #if defined REQUIRE_PLUGIN 12 | required = 1, 13 | #else 14 | required = 0, 15 | #endif 16 | }; 17 | 18 | 19 | // WARNING: Never change the value on these defines. 20 | #define EH_TYPE_CSGO_TO_CSS_GRAVITY_FIX 1 21 | #define EH_TYPE_TRIGGER_PUSH_NO_COOLDOWN 2 22 | #define EH_TYPE_REMOVE_ENTITIES 3 23 | #define EH_TYPE_AUTO_USE 4 24 | #define EH_TYPE_MULTIGAMES_GAME_SELECT 5 25 | #define EH_TYPE_TRIGGER_PUSH_NO_EMULATION 6 26 | #define EH_TYPE_LOCK_STATE 7 27 | 28 | 29 | forward EntityHooker_OnRegisterReady(); 30 | forward EntityHooker_OnEntityHooked(eh_type, entity); 31 | forward EntityHooker_OnEntityUnhooked(eh_type, entity); 32 | forward EntityHooker_OnInitialHooksReady(); 33 | 34 | 35 | native bool:EntityHooker_Register(eh_type, const String:hook_name[], any:...); 36 | native bool:EntityHooker_RegisterAdditional(eh_type, any:...); 37 | native bool:EntityHooker_RegisterProperty(eh_type, PropType:type, PropFieldType:field_type, const String:property[]); 38 | native bool:EntityHooker_IsEntityHooked(eh_type, ent); 39 | 40 | 41 | #if !defined REQUIRE_PLUGIN 42 | public __pl_entity_hooker_SetNTVOptional() 43 | { 44 | MarkNativeAsOptional("EntityHooker_Register"); 45 | MarkNativeAsOptional("EntityHooker_RegisterAdditional"); 46 | MarkNativeAsOptional("EntityHooker_RegisterProperty"); 47 | MarkNativeAsOptional("EntityHooker_IsEntityHooked"); 48 | } 49 | #endif -------------------------------------------------------------------------------- /include/EntityHooker/sql_plugin_entity_hooker.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS plugin_entity_hooker 2 | ( 3 | map_id MEDIUMINT UNSIGNED NOT NULL, 4 | hook_type SMALLINT UNSIGNED NOT NULL, 5 | hammer_id INT UNSIGNED NOT NULL, 6 | ent_classname VARCHAR( 255 ) NOT NULL, 7 | custom_data_1 INT NOT NULL, 8 | 9 | PRIMARY KEY ( map_id, hook_type, hammer_id ) 10 | ) ENGINE = INNODB; -------------------------------------------------------------------------------- /include/EventLogs.inc: -------------------------------------------------------------------------------- 1 | #if defined _EventLogs_included 2 | #endinput 3 | #endif 4 | #define _EventLogs_included 5 | 6 | 7 | enum LogLevel 8 | { 9 | LOG_TRACE, 10 | LOG_DEBUG, 11 | LOG_INFO, 12 | LOG_WARN, 13 | LOG_ERROR, 14 | LOG_FATAL 15 | } 16 | 17 | /** 18 | * Logs plugin message 19 | * 20 | * @param level Logging level 21 | * @param format Format 22 | * @param ... Any additional formating data 23 | * @return Last inserted ID (Not Accurate), returns -1 if none 24 | */ 25 | native int EL_LogPlugin(LogLevel level, const char[] format, any ...); 26 | 27 | 28 | public SharedPlugin __pl_EventLogs = 29 | { 30 | name = "EventLogs", 31 | file = "EventLogs.smx", 32 | #if defined REQUIRE_PLUGIN 33 | required = 1, 34 | #else 35 | required = 0, 36 | #endif 37 | }; 38 | 39 | 40 | #if !defined REQUIRE_PLUGIN 41 | public __pl_EventLogs_SetNTVOptional() 42 | { 43 | MarkNativeAsOptional("EL_LogPlugin"); 44 | } 45 | #endif -------------------------------------------------------------------------------- /include/ToggleEffects.inc: -------------------------------------------------------------------------------- 1 | /** Include File for Global Special Effects **/ 2 | #if defined _GlobalEffects_Included_ 3 | #endinput 4 | #endif 5 | #define _GlobalEffects_Included_ 6 | 7 | public SharedPlugin:__pl_specialfx = 8 | { 9 | name = "specialfx", 10 | file = "ToggleEffects.smx", 11 | #if defined REQUIRE_PLUGIN 12 | required = 1, 13 | #else 14 | required = 0, 15 | #endif 16 | }; 17 | 18 | public __pl_specialfx_SetNTVOptional() 19 | { 20 | MarkNativeAsOptional("ShowClientEffects"); 21 | } 22 | 23 | /** 24 | * Returns whether the client would like special effects on or off. 25 | * 26 | * @param client The client index of the player 27 | * @return True/False 28 | */ 29 | native bool:ShowClientEffects(client); 30 | -------------------------------------------------------------------------------- /include/adt.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * vim: set ts=4 : 3 | * ============================================================================= 4 | * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. 5 | * ============================================================================= 6 | * 7 | * This file is part of the SourceMod/SourcePawn SDK. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License, version 3.0, as published by the 11 | * Free Software Foundation. 12 | * 13 | * This program is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 16 | * details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * this program. If not, see . 20 | * 21 | * As a special exception, AlliedModders LLC gives you permission to link the 22 | * code of this program (as well as its derivative works) to "Half-Life 2," the 23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software 24 | * by the Valve Corporation. You must obey the GNU General Public License in 25 | * all respects for all other code used. Additionally, AlliedModders LLC grants 26 | * this exception to all derivative works. AlliedModders LLC defines further 27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), 28 | * or . 29 | * 30 | * Version: $Id$ 31 | */ 32 | 33 | #if defined _adt_included 34 | #endinput 35 | #endif 36 | #define _adt_included 37 | 38 | #include 39 | #include 40 | #include 41 | -------------------------------------------------------------------------------- /include/bTimes-ghost.inc: -------------------------------------------------------------------------------- 1 | #if defined _ghost_included 2 | #endinput 3 | #endif 4 | #define _ghost_included 5 | 6 | /** 7 | * Gets if a client is a replay bot, also gets type and style of replay bot through parameters 8 | * 9 | * @param client The index of the client 10 | * @param Type The Timer Type of the client to be returned 11 | * @param Style The Timer Style of the client to be returned 12 | * 13 | * @return true if client is a replay bot, false otherwise 14 | */ 15 | native bool:GetBotInfo(client, &Type, &Style); 16 | 17 | public SharedPlugin:__pl_ghost = 18 | { 19 | name = "ghost", 20 | file = "bTimes-ghost.smx", 21 | #if defined REQUIRE_PLUGIN 22 | required = 1, 23 | #else 24 | required = 0, 25 | #endif 26 | }; 27 | 28 | 29 | #if !defined REQUIRE_PLUGIN 30 | public __pl_ghost_SetNTVOptional() 31 | { 32 | MarkNativeAsOptional("GetBotInfo"); 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /include/bTimes-gunjump.inc: -------------------------------------------------------------------------------- 1 | #if defined _gunjump_included 2 | #endinput 3 | #endif 4 | #define _gunjump_included 5 | 6 | enum GunJumpConfig 7 | { 8 | String:Weapon[64], 9 | Float:Range, 10 | Float:Damage, 11 | bool:Auto_Health_Regen, 12 | Health_Regen_Rate, 13 | Max_Health, 14 | Float:Boost_Horizontal, 15 | Float:Boost_Vertical, 16 | Primary_Clip_Size, 17 | Primary_Clip_Max_Size, 18 | Primary_Clip_Regen_Rate, 19 | bool:Primary_Clip_Auto_Regen, 20 | Secondary_Clip_Size, 21 | Secondary_Clip_Max_Size, 22 | Secondary_Clip_Regen_Rate, 23 | bool:Secondary_Clip_Auto_Regen 24 | }; 25 | 26 | /** 27 | * Returns whether a client has just gun boosted, similar to the IsChatTrigger function. 28 | * 29 | * @return True if a client just gun boosted, false otherwise 30 | */ 31 | native bool:Timer_IsGunJump(); 32 | 33 | public SharedPlugin:__pl_gunjump = 34 | { 35 | name = "gunjump", 36 | file = "bTimes-gunjump.smx", 37 | #if defined REQUIRE_PLUGIN 38 | required = 1, 39 | #else 40 | required = 0, 41 | #endif 42 | }; 43 | 44 | #if !defined REQUIRE_PLUGIN 45 | public __pl_gunjump_SetNTVOptional() 46 | { 47 | MarkNativeAsOptional("Timer_IsGunJump"); 48 | } 49 | #endif -------------------------------------------------------------------------------- /include/bTimes-random.inc: -------------------------------------------------------------------------------- 1 | #define STOP_DOORS 1<<0 2 | #define STOP_GUNS 1<<1 3 | #define STOP_MUSIC 1<<2 4 | #define AUTO_BHOP 1<<3 5 | #define HIDE_PLAYERS 1<<4 6 | #define KH_TIMELEFT 1<<5 7 | #define SHOW_KEYS 1<<6 8 | #define SHOW_HINT 1<<7 9 | #define SHOW_2DVEL 1<<8 10 | #define STOP_RECSND 1<<9 11 | #define KH_SYNC 1<<10 12 | #define KH_RECORD 1<<11 13 | #define KH_BEST 1<<12 14 | #define KH_SPECS 1<<13 15 | #define STOP_PBSND 1<<14 16 | #define STOP_FAILSND 1<<15 17 | #define JUMP_STATS 1<<16 18 | #define BROKEN_TELES 1<<17 19 | #define IGNORE_ADVERTS 1<<18 20 | #define DISABLE_HUD 1<<19 21 | 22 | native GetClientSettings(client); 23 | native SetClientSettings(client, settings); 24 | forward OnTimerChatChanged(MessageType, String:Message[]); 25 | -------------------------------------------------------------------------------- /include/bTimes-ranks.inc: -------------------------------------------------------------------------------- 1 | /* 2 | * Updates the rankings for the current map, probably will become useless eventually 3 | * 4 | * @param sMapName The map to update ranks for. 5 | * @param Type The timer type to update ranks for. 6 | * @param Style The timer style to update ranks for. 7 | */ 8 | native DB_UpdateRanks(const String:sMapName[], Type, Style); 9 | 10 | /* 11 | * Gives custom chat privileges to a specified SteamID. 12 | * 13 | * @param sAuth The SteamID to enable custom chat for. 14 | */ 15 | native Timer_EnableCustomChat(const String:sAuth[]); 16 | 17 | /* 18 | * Disables custom chat privileges for a specified SteamID. 19 | * 20 | * @param sAuth The SteamID to disable custom chat for. 21 | */ 22 | native Timer_DisableCustomChat(const String:sAuth[]); 23 | 24 | /* 25 | * Gets if a specified SteamID has custom chat privileges 26 | * 27 | * @param sAuth The SteamID to get custom chat privileges for 28 | */ 29 | native Timer_SteamIDHasCustomChat(const String:sAuth[]); 30 | 31 | /* 32 | * Opens the stats menu to a client for the specified PlayerID 33 | * 34 | * @param client Client index. 35 | * @param PlayerID PlayerID from the database to show stats for. 36 | * @param Type Timer type to show stats. 37 | * @param Style Timer style to show stats. 38 | */ 39 | native Timer_OpenStatsMenu(client, PlayerID, Type, Style); -------------------------------------------------------------------------------- /include/bTimes-tas.inc: -------------------------------------------------------------------------------- 1 | #if defined _tas_included 2 | #endinput 3 | #endif 4 | #define _tas_included 5 | 6 | native bool TAS_InEditMode(int client); 7 | 8 | native bool TAS_IsPaused(int client); 9 | 10 | native ArrayList TAS_GetRunHandle(int client); 11 | 12 | native int TAS_GetCurrentFrame(int client); 13 | 14 | forward void OnTASPauseChanged(int client, bool paused); 15 | 16 | forward void OnTASFrameRecorded(int client, int frame); 17 | 18 | public SharedPlugin __pl_tas = 19 | { 20 | name = "tas", 21 | file = "bTimes-tas.smx", 22 | #if defined REQUIRE_PLUGIN 23 | required = 1, 24 | #else 25 | required = 0, 26 | #endif 27 | }; 28 | 29 | 30 | #if !defined REQUIRE_PLUGIN 31 | public void __pl_tas_SetNTVOptional() 32 | { 33 | MarkNativeAsOptional("TAS_InEditMode"); 34 | MarkNativeAsOptional("TAS_IsPaused"); 35 | MarkNativeAsOptional("TAS_GetRunHandle"); 36 | MarkNativeAsOptional("TAS_GetCurrentFrame"); 37 | } 38 | #endif -------------------------------------------------------------------------------- /include/bTimes-timer_hack.inc: -------------------------------------------------------------------------------- 1 | #if defined _btimes_timer_included 2 | #endinput 3 | #endif 4 | #define _btimes_timer_included 5 | 6 | enum styleConfig 7 | { 8 | String:Name[32], 9 | String:Name_Short[32], 10 | bool:Enabled, 11 | bool:TempEnabled, 12 | bool:AllowType[2], 13 | bool:Freestyle, 14 | bool:Freestyle_Unrestrict, 15 | bool:Freestyle_EzHop, 16 | bool:Freestyle_Auto, 17 | bool:Auto, 18 | bool:EzHop, 19 | Float:Gravity, 20 | Float:RunSpeed, 21 | Float:MaxVel, 22 | Float:MinFps, 23 | bool:CalcSync, 24 | bool:Prevent_Left, 25 | bool:Prevent_Right, 26 | bool:Prevent_Back, 27 | bool:Prevent_Forward, 28 | bool:Require_Left, 29 | bool:Require_Right, 30 | bool:Require_Back, 31 | bool:Require_Forward, 32 | bool:Hud_Style, 33 | bool:Hud_Strafes, 34 | bool:Hud_Jumps, 35 | bool:Count_Left_Strafe, 36 | bool:Count_Right_Strafe, 37 | bool:Count_Back_Strafe, 38 | bool:Count_Forward_Strafe, 39 | bool:Ghost_Use[2], 40 | bool:Ghost_Save[2], 41 | Float:PreSpeed, 42 | Float:SlowedSpeed, 43 | bool:Special, 44 | String:Special_Key[32], 45 | bool:GunJump, 46 | String:GunJump_Weapon[64], 47 | bool:UnrealPhys, 48 | AirAcceleration, 49 | bool:EnableBunnyhopping, 50 | StyleConfig 51 | }; 52 | 53 | /* 54 | * Gets a client's style (Normal, Sideways, etc..). 55 | * 56 | * @param client Client index 57 | * 58 | * @return The client's style. 59 | */ 60 | native int GetClientStyle(int client); 61 | 62 | /* 63 | * Gets the complete configuration for a specified style. 64 | * 65 | * @param Style The style to get a configuration for. 66 | * @param Properties The buffer to store all the style properties, (properties are listed in the StyleConfig enum) 67 | * 68 | * @return True if the style exists, false otherwise. 69 | */ 70 | native bool Style_GetConfig(int Style, any Properties[StyleConfig]); 71 | 72 | public SharedPlugin __pl_btimes_timer = 73 | { 74 | name = "timer", 75 | file = "bTimes-timer.smx", 76 | #if defined REQUIRE_PLUGIN 77 | required = 1 78 | #else 79 | required = 0 80 | #endif 81 | }; 82 | 83 | #if !defined REQUIRE_PLUGIN 84 | public void __pl_btimes_timer_SetNTVOptional() 85 | { 86 | MarkNativeAsOptional("GetClientStyle"); 87 | MarkNativeAsOptional("Style_GetConfig"); 88 | } 89 | #endif 90 | -------------------------------------------------------------------------------- /include/bTimes-zones.inc: -------------------------------------------------------------------------------- 1 | #define ZONE_COUNT 6 2 | 3 | #define MAIN_START 0 4 | #define MAIN_END 1 5 | #define BONUS_START 2 6 | #define BONUS_END 3 7 | #define ANTICHEAT 4 8 | #define FREESTYLE 5 9 | 10 | #define FLAG_ANTICHEAT_MAIN 1<<0 11 | #define FLAG_ANTICHEAT_BONUS 1<<1 12 | 13 | /* 14 | * Gets if a client is inside a zone type 15 | * 16 | * @param client Client index. 17 | * @param Zone The zone type to check if they are inside. 18 | * @param flags Optional flags required for a zone to have, -1 for no flags required 19 | * 20 | * @return The ZoneNumber a client is inside of, -1 if client is not inside a zone with the given parameters. 21 | */ 22 | native Timer_InsideZone(client, Zone, flags = -1); 23 | 24 | /* 25 | * Gets if a point is inside a zone 26 | * 27 | * @param pos The position to check is inside a zone. 28 | * @param Zone Zone type. 29 | * @param ZoneNumber Zone number. 30 | * 31 | * @return True if the point is inside the specified zone, false otherwise. 32 | */ 33 | native bool:Timer_IsPointInsideZone(Float:pos[3], Zone, ZoneNumber); 34 | 35 | /* 36 | * Teleports a client to a specified zone 37 | * 38 | * @param client Client index. 39 | * @param Zone The zone type to teleport to. 40 | * @param ZoneNumber The zone number to teleport to. 41 | * @param bottom If set to true, the client will teleport to the bottom of the zone. 42 | * 43 | * @noreturn 44 | */ 45 | native Timer_TeleportToZone(client, Zone, ZoneNumber, bool:bottom = false); 46 | 47 | /* 48 | * Gets how many zones their are in the database for every map in the map list. 49 | * 50 | * @param Zone Zone type to check. 51 | * 52 | * @return Total number of zones for the zone type. 53 | */ 54 | native GetTotalZonesAllMaps(Zone); 55 | 56 | /* 57 | * Called when the map zones have been loaded for current map. 58 | */ 59 | forward OnZonesLoaded(); 60 | 61 | /* 62 | * Called when the all zones have been loaded. 63 | * You can use GetTotalZonesAllMaps() here or after. 64 | */ 65 | forward OnAllZonesLoaded(); 66 | 67 | /* 68 | * Called when someone enters a zone 69 | */ 70 | forward OnZoneStartTouch(client, Zone, ZoneNumber); 71 | 72 | /* 73 | * Called when someone leaves a zone 74 | */ 75 | forward OnZoneEndTouch(client, Zone, ZoneNumber); 76 | -------------------------------------------------------------------------------- /include/bank.inc: -------------------------------------------------------------------------------- 1 | /* 2 | Include file for Bank.sp 3 | Provide simple functions to manage a player's bank. 4 | 5 | Created by Arkarr (Alliedmodders) EDITED/FIXED BY ShawnCZek 6 | */ 7 | 8 | #if defined _bank_included 9 | #endinput 10 | #endif 11 | #define _bank_included 12 | 13 | /** 14 | * Create a new bank. Can't create bank with same name at once. 15 | * 16 | * @param bankName The name of the bank 17 | * @return True on sucess, false otherwise. 18 | */ 19 | native bool Bank_Create(const char[] bankName) 20 | 21 | /** 22 | * Add or substract a certain ammount of credits of a player's balance. 23 | * 24 | * @param bank The name of the bank 25 | * @param client The client to add/substract to. 26 | * @param ammount The ammount to add/substract. 27 | * @param forcecreate Create the user if not found in the bank. 28 | * @return True on sucess, false otherwise. 29 | */ 30 | native bool Bank_EditBalance(const char[] bank, int client, float ammount, bool forcecreate = true) 31 | 32 | /** 33 | * Get the balance of a client in a specific bank. 34 | * 35 | * @param bank The name of the bank 36 | * @param client The client to get the balance of. 37 | * @return The ammount of credits. -1 if no account found. 38 | */ 39 | native float Bank_GetBalance(const char[] bank, int client) 40 | 41 | /** 42 | * Set the balance of a client in a specific bank. 43 | * 44 | * @param bank The name of the bank 45 | * @param client The client to set the balance of. 46 | * @param ammount The ammount to set the balance of the player. That wasn't english. 47 | * @param forcecreate Create the user if not found in the bank. 48 | * @return True on sucess, false otherwise. 49 | */ 50 | native bool Bank_SetBalance(const char[] bank, int client, float ammount, bool forcecreate = true) 51 | 52 | /** 53 | * Set the balance of a client in a specific bank. 54 | * 55 | * @param bank The name of the bank 56 | * @param steamID The client to set the balance of. 57 | * @param ammount The ammount to set the balance of the player. That wasn't english. 58 | * @param forcecreate Create the user if not found in the bank. 59 | * @return True on sucess, false otherwise. 60 | */ 61 | native bool Bank_SetBalanceSteam(const char[] bank, const char[] steamID, float ammount, bool forcecreate = true) 62 | 63 | forward void Bank_OnDatabaseReady(); -------------------------------------------------------------------------------- /include/bash - Copy.inc: -------------------------------------------------------------------------------- 1 | #if defined _bash_included 2 | #endinput 3 | #endif 4 | #define _bash_included 5 | 6 | /* 7 | * Gets a client's velocity with extra settings to disallow velocity on certain axes 8 | */ 9 | 10 | 11 | stock Float:GetClientVelocity(client, bool:UseX, bool:UseY, bool:UseZ) 12 | { 13 | new Float:vVel[3]; 14 | 15 | if(UseX) 16 | { 17 | vVel[0] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[0]"); 18 | } 19 | 20 | if(UseY) 21 | { 22 | vVel[1] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[1]"); 23 | } 24 | 25 | if(UseZ) 26 | { 27 | vVel[2] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[2]"); 28 | } 29 | 30 | return GetVectorLength(vVel); 31 | } -------------------------------------------------------------------------------- /include/bash.inc: -------------------------------------------------------------------------------- 1 | #if defined _bash_included 2 | #endinput 3 | #endif 4 | #define _bash_included 5 | 6 | /* 7 | * Gets a client's velocity with extra settings to disallow velocity on certain axes 8 | */ 9 | 10 | 11 | stock Float:GetClientVelocity(client, bool:UseX, bool:UseY, bool:UseZ) 12 | { 13 | new Float:vVel[3]; 14 | 15 | if(UseX) 16 | { 17 | vVel[0] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[0]"); 18 | } 19 | 20 | if(UseY) 21 | { 22 | vVel[1] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[1]"); 23 | } 24 | 25 | if(UseZ) 26 | { 27 | vVel[2] = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[2]"); 28 | } 29 | 30 | return GetVectorLength(vVel); 31 | } -------------------------------------------------------------------------------- /include/button.inc: -------------------------------------------------------------------------------- 1 | forward CL_OnTimerStartPress(client); 2 | forward CL_OnEndTimerPress(client); -------------------------------------------------------------------------------- /include/clientvoice.inc: -------------------------------------------------------------------------------- 1 | #if defined _client_voice_included 2 | #endinput 3 | #endif 4 | #define _client_voice_included 5 | 6 | 7 | public Extension:__ext_voice_hook = 8 | { 9 | name = "Voice Hook", 10 | file = "voice_hook.ext", 11 | #if defined AUTOLOAD_EXTENSIONS 12 | autoload = 1, 13 | #else 14 | autoload = 0, 15 | #endif 16 | #if defined REQUIRE_EXTENSIONS 17 | required = 1, 18 | #else 19 | required = 0, 20 | #endif 21 | }; 22 | 23 | 24 | forward OnClientVoice(client); 25 | -------------------------------------------------------------------------------- /include/convert.inc: -------------------------------------------------------------------------------- 1 | #define MAXFLOATSIZE 40 2 | #define MAXINTSIZE 10 3 | stock bool Convert_IntToBool(int x) 4 | { 5 | return (x == 0? false : true); 6 | } 7 | 8 | stock char[] Convert_IntToString(int i) 9 | { 10 | char output[MAXINTSIZE]; 11 | 12 | FormatEx(output, MAXINTSIZE, "%i", i); 13 | 14 | return output; 15 | } 16 | 17 | stock char[] Convert_BoolToString(bool b) 18 | { 19 | char output[5]; 20 | if(b) 21 | { 22 | output = "True"; 23 | } 24 | else 25 | { 26 | output = "False"; 27 | } 28 | 29 | return output; 30 | } 31 | 32 | 33 | stock char[] Convert_FloatToString(float f) 34 | { 35 | char output[MAXFLOATSIZE]; 36 | 37 | Format(output, MAXFLOATSIZE, "%f", f); 38 | 39 | return output; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /include/csteamid.inc: -------------------------------------------------------------------------------- 1 | #if defined _csteamid_included 2 | #endinput 3 | #endif 4 | #define _csteamid_included 5 | 6 | /** 7 | * Gives the 64-bit int SteamID for a client 8 | * 9 | * @param client Client index of the player. 10 | * @param buffer Destination string buffer. 11 | * @param maxlength Maximum length of output string buffer. 12 | * @return True on success, false on invalid client index or failure to find edict index. 13 | */ 14 | native bool:GetClientCSteamID(client, String:buffer[], maxlength); 15 | 16 | /** 17 | * Given a 64-bit int SteamID, gives the SteamID associated with it 18 | * 19 | * @param input 64-bit integer stored in a string 20 | * @param buffer Destination string buffer for the SteamID. 21 | * @param maxlength Maximum length of the output string buffer. 22 | * @return True on success, false on invalid input string. 23 | */ 24 | native bool:CSteamIDToSteamID(String:input[], String:buffer[], maxlength); 25 | 26 | /** 27 | * Given a SteamID, gives the 64-bit int SteamID associated with it 28 | * 29 | * @param input SteamID stored in a string 30 | * @param buffer Destination string buffer for the 64-bit int SteamID. 31 | * @param maxlength Maximum length of the output string buffer. 32 | * @return True on success, false on invalid SteamID. 33 | */ 34 | native bool:SteamIDToCSteamID(String:input[], String:buffer[], maxlength); 35 | 36 | /** 37 | * Do not edit below this line! 38 | */ 39 | public Extension:__ext_csteamid = 40 | { 41 | name = "CSteamID", 42 | file = "csteamid.ext", 43 | autoload = 1, 44 | #if defined REQUIRE_EXTENSIONS 45 | required = 1, 46 | #else 47 | required = 0, 48 | #endif 49 | }; 50 | -------------------------------------------------------------------------------- /include/db_stocks.inc: -------------------------------------------------------------------------------- 1 | #if defined _db_stocks_included 2 | #endinput 3 | #endif 4 | #define _db_stocks_included 5 | 6 | stock void DB_Query(char[] dbname, SQLQueryCallback callback, const char[] query, any data = 0, DBPriority prio = DBPrio_Normal) 7 | { 8 | char error; 9 | Database db_temp = SQLite_UseDatabase(dbname, error, 1); 10 | 11 | db_temp.Query(callback, query, data, prio); 12 | delete db_temp; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /include/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=This folder is shared online. 3 | IconFile=C:\Program Files\Google\Drive\googledrivesync.exe 4 | IconIndex=16 5 | -------------------------------------------------------------------------------- /include/dice.inc: -------------------------------------------------------------------------------- 1 | #if defined _dice_included 2 | #endinput 3 | #endif 4 | #define _dice_included 5 | 6 | native void Dice_ResetClient(int client); 7 | 8 | stock bool IsDiceLoaded() 9 | { 10 | return LibraryExists("dice"); 11 | } 12 | -------------------------------------------------------------------------------- /include/ent_stocks.inc: -------------------------------------------------------------------------------- 1 | #if defined _ent_stocks_included 2 | #endinput 3 | #endif 4 | #define _ent_stocks_included 5 | 6 | #include 7 | #include 8 | 9 | stock void Game_End() 10 | { 11 | int end = CreateEntityByName("game_end"); 12 | AcceptEntityInput(end, "EndGame"); 13 | } -------------------------------------------------------------------------------- /include/foo.inc: -------------------------------------------------------------------------------- 1 | enum struct Foo 2 | { 3 | float none; 4 | 5 | void Dump() 6 | { 7 | 8 | } 9 | } -------------------------------------------------------------------------------- /include/influx/ac_log.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_ac_log_included 2 | #endinput 3 | #endif 4 | #define _influx_ac_log_included 5 | 6 | 7 | 8 | #define INFLUX_LIB_AC_LOG "influx_ac_log" 9 | 10 | 11 | #define INF_TABLE_ACLOG_LOG "inf_aclog_log" 12 | #define INF_TABLE_ACLOG_NOTIFY "inf_aclog_notify" 13 | 14 | 15 | #define ACLOG_NOPUNISH -2 // This means let the logging module dictate what the punishment is. 16 | #define ACLOG_KICK -1 17 | 18 | 19 | native bool Influx_LogCheat( int client, const char[] szReasonId, bool bNotifyAdmin, const char[] szReasonFormat, any ... ); 20 | native bool Influx_PunishCheat( int client, const char[] szReasonId, int override_punishtime = ACLOG_NOPUNISH, const char[] kick_reason, const char[] szReasonFormat, any ... ); 21 | 22 | 23 | // Return != Plugin_Continue to not log. 24 | // NOTE: It does not mean that the player is not punished/notified to admin. Edit the arguments. 25 | // Reason id is a short string to identify reason. 26 | forward Action Influx_OnLogCheat( int client, const char[] szReasonId, int &punishtime, bool &bNotifyAdmin ); 27 | 28 | 29 | public SharedPlugin __pl_influx_ac_log = 30 | { 31 | name = INFLUX_LIB_AC_LOG, 32 | file = INFLUX_LIB_AC_LOG...".smx", 33 | #if defined REQUIRE_PLUGIN 34 | required = 1 35 | #else 36 | required = 0 37 | #endif 38 | }; 39 | 40 | #if !defined REQUIRE_PLUGIN 41 | public void __pl_influx_ac_log_SetNTVOptional() 42 | { 43 | MarkNativeAsOptional( "Influx_LogCheat" ); 44 | MarkNativeAsOptional( "Influx_PunishCheat" ); 45 | } 46 | #endif -------------------------------------------------------------------------------- /include/influx/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=This folder is shared online. 3 | IconFile=C:\Program Files\Google\Drive\googledrivesync.exe 4 | IconIndex=16 5 | -------------------------------------------------------------------------------- /include/influx/fpscheck.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_fpscheck_included 2 | #endinput 3 | #endif 4 | #define _influx_fpscheck_included 5 | 6 | 7 | #define INFLUX_LIB_FPSCHECK "influx_fpscheck" 8 | 9 | 10 | enum FpsVal_t 11 | { 12 | FPSVAL_NOTCACHED = 0, 13 | FPSVAL_INVALID, 14 | FPSVAL_CHEATED, 15 | FPSVAL_VALID 16 | }; 17 | 18 | 19 | forward void Influx_OnRequestFpsChecks(); 20 | 21 | native void Influx_AddFpsCheck( int mode ); 22 | native bool Influx_RemoveFpsCheck( int mode ); 23 | 24 | 25 | public SharedPlugin __pl_influx_fpscheck = 26 | { 27 | name = INFLUX_LIB_FPSCHECK, 28 | file = INFLUX_LIB_FPSCHECK...".smx", 29 | #if defined REQUIRE_PLUGIN 30 | required = 1 31 | #else 32 | required = 0 33 | #endif 34 | }; 35 | 36 | #if !defined REQUIRE_PLUGIN 37 | public void __pl_influx_fpscheck_SetNTVOptional() 38 | { 39 | MarkNativeAsOptional( "Influx_AddFpsCheck" ); 40 | MarkNativeAsOptional( "Influx_RemoveFpsCheck" ); 41 | } 42 | #endif -------------------------------------------------------------------------------- /include/influx/help.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_help_included 2 | #endinput 3 | #endif 4 | #define _influx_help_included 5 | 6 | 7 | #define INFLUX_LIB_HELP "influx_help" 8 | 9 | 10 | // Waiting to be removed. 11 | #define Influx_RequestHelpCmds Influx_OnRequestHelpCmds 12 | 13 | forward void Influx_OnRequestHelpCmds(); 14 | 15 | 16 | native bool Influx_AddHelpCommand( const char[] szCommand, const char[] szMsg, bool bAdminOnly = false ); 17 | native bool Influx_RemoveHelpCommand( const char[] szCommand ); 18 | 19 | 20 | public SharedPlugin __pl_influx_help = 21 | { 22 | name = INFLUX_LIB_HELP, 23 | file = INFLUX_LIB_HELP...".smx", 24 | #if defined REQUIRE_PLUGIN 25 | required = 1 26 | #else 27 | required = 0 28 | #endif 29 | }; 30 | 31 | #if !defined REQUIRE_PLUGIN 32 | public void __pl_influx_help_SetNTVOptional() 33 | { 34 | MarkNativeAsOptional( "Influx_AddHelpCommand" ); 35 | MarkNativeAsOptional( "Influx_RemoveHelpCommand" ); 36 | } 37 | #endif -------------------------------------------------------------------------------- /include/influx/hud.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_hud_included 2 | #endinput 3 | #endif 4 | #define _influx_hud_included 5 | 6 | 7 | #define INFLUX_LIB_HUD "influx_hud" 8 | 9 | 10 | native bool Influx_AddHUDMenuCmd( const char[] szCmd, const char[] szName ); 11 | 12 | forward void Influx_OnRequestHUDMenuCmds(); 13 | 14 | 15 | 16 | #define HIDEFLAG_TIMER ( 1 << 0 ) 17 | #define HIDEFLAG_SIDEBAR ( 1 << 1 ) // CSS = KeyHint, CSGO = Menu 18 | #define HIDEFLAG_TIME ( 1 << 2 ) 19 | #define HIDEFLAG_SPEED ( 1 << 3 ) 20 | #define HIDEFLAG_MODENSTYLE ( 1 << 4 ) 21 | #define HIDEFLAG_RUNNAME ( 1 << 5 ) 22 | #define HIDEFLAG_PB_TIME ( 1 << 6 ) 23 | #define HIDEFLAG_WR_TIME ( 1 << 7 ) 24 | #define HIDEFLAG_PRACMODE ( 1 << 8 ) 25 | #define HIDEFLAG_PAUSEMODE ( 1 << 9 ) 26 | #define HIDEFLAG_SND_NORMAL ( 1 << 10 ) 27 | #define HIDEFLAG_SND_PERSONAL ( 1 << 11 ) 28 | #define HIDEFLAG_SND_BEST ( 1 << 12 ) 29 | #define HIDEFLAG_CHAT_NORMAL ( 1 << 13 ) 30 | #define HIDEFLAG_CHAT_PERSONAL ( 1 << 14 ) 31 | #define HIDEFLAG_CHAT_BEST ( 1 << 15 ) 32 | #define HIDEFLAG_HIDE_PLAYERS ( 1 << 16 ) 33 | #define HIDEFLAG_HIDE_BOTS ( 1 << 17 ) 34 | #define HIDEFLAG_BEAMS ( 1 << 18 ) 35 | #define HIDEFLAG_VIEWMODEL ( 1 << 19 ) 36 | #define HIDEFLAG_STRFSYNC ( 1 << 20 ) 37 | 38 | #define DEF_HIDEFLAGS 0 39 | 40 | 41 | native int Influx_GetClientHideFlags( int client ); 42 | native void Influx_SetClientHideFlags( int client, int flags ); 43 | 44 | 45 | public SharedPlugin __pl_influx_hud = 46 | { 47 | name = INFLUX_LIB_HUD, 48 | file = INFLUX_LIB_HUD...".smx", 49 | #if defined REQUIRE_PLUGIN 50 | required = 1 51 | #else 52 | required = 0 53 | #endif 54 | }; 55 | 56 | #if !defined REQUIRE_PLUGIN 57 | public void __pl_influx_hud_SetNTVOptional() 58 | { 59 | MarkNativeAsOptional( "Influx_GetClientHideFlags" ); 60 | MarkNativeAsOptional( "Influx_SetClientHideFlags" ); 61 | 62 | MarkNativeAsOptional( "Influx_AddHUDMenuCmd" ); 63 | } 64 | #endif -------------------------------------------------------------------------------- /include/influx/hud_draw.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_hud_draw_included 2 | #endinput 3 | #endif 4 | #define _influx_hud_draw_included 5 | 6 | 7 | #define INFLUX_LIB_HUD_DRAW "influx_hud_draw" 8 | 9 | 10 | native void Influx_GetSecondsFormat_Timer( char[] sz, int len ); 11 | native void Influx_GetSecondsFormat_Sidebar( char[] sz, int len ); 12 | 13 | native float Influx_GetNextMenuTime( int client ); 14 | native void Influx_SetNextMenuTime( int client, float time ); 15 | 16 | 17 | // Add separator to string. 18 | #define ADD_SEPARATOR(%0,%1) if ( %0[0] != '\0' ) Format( %0, sizeof( %0 ), "%s"...%1, %0 ) 19 | 20 | // Add new line if we've already added something. 21 | #define NEWLINE_CHECK(%0) ( %0[0] != '\0' ) ? "\n" : "" 22 | 23 | 24 | enum HudType_t 25 | { 26 | HUDTYPE_TIMER = 0, // HintText 27 | HUDTYPE_SIDEBAR, // KeyHintText 28 | HUDTYPE_MENU, 29 | HUDTYPE_HUDMSG, // HudMsg 30 | 31 | HUDTYPE_MISC 32 | }; 33 | 34 | forward Action Influx_ShouldDrawHUD( int client, int target, HudType_t hudtype ); 35 | forward Action Influx_OnDrawHUD( int client, int target, HudType_t hudtype ); 36 | 37 | 38 | stock void Inf_ShowKeyHintText( int client, const char[] sz ) 39 | { 40 | Handle hMsg = StartMessageOne( "KeyHintText", client ); 41 | 42 | if ( hMsg != null ) 43 | { 44 | BfWriteByte( hMsg, 1 ); 45 | BfWriteString( hMsg, sz ); 46 | 47 | EndMessage(); 48 | } 49 | } 50 | 51 | 52 | public SharedPlugin __pl_influx_hud_draw = 53 | { 54 | name = INFLUX_LIB_HUD_DRAW, 55 | file = INFLUX_LIB_HUD_DRAW...".smx", 56 | #if defined REQUIRE_PLUGIN 57 | required = 1 58 | #else 59 | required = 0 60 | #endif 61 | }; 62 | 63 | #if !defined REQUIRE_PLUGIN 64 | public void __pl_influx_hud_draw_SetNTVOptional() 65 | { 66 | MarkNativeAsOptional( "Influx_GetSecondsFormat_Timer" ); 67 | MarkNativeAsOptional( "Influx_GetSecondsFormat_Sidebar" ); 68 | 69 | MarkNativeAsOptional( "Influx_GetNextMenuTime" ); 70 | MarkNativeAsOptional( "Influx_SetNextMenuTime" ); 71 | } 72 | #endif -------------------------------------------------------------------------------- /include/influx/jumps.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_jumps_included 2 | #endinput 3 | #endif 4 | #define _influx_jumps_included 5 | 6 | 7 | #define INFLUX_LIB_JUMPS "influx_jumps" 8 | 9 | 10 | forward Action Influx_ShouldCountJumps( int client ); 11 | 12 | 13 | native int Influx_GetClientJumpCount( int client ); 14 | native bool Influx_IsCountingJumps( int client ); 15 | 16 | 17 | public SharedPlugin __pl_influx_jumps = 18 | { 19 | name = INFLUX_LIB_JUMPS, 20 | file = INFLUX_LIB_JUMPS...".smx", 21 | #if defined REQUIRE_PLUGIN 22 | required = 1 23 | #else 24 | required = 0 25 | #endif 26 | }; 27 | 28 | #if !defined REQUIRE_PLUGIN 29 | public void __pl_influx_jumps_SetNTVOptional() 30 | { 31 | MarkNativeAsOptional( "Influx_GetClientJumpCount" ); 32 | MarkNativeAsOptional( "Influx_IsCountingJumps" ); 33 | } 34 | #endif -------------------------------------------------------------------------------- /include/influx/maprankings.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_maprankings_included 2 | #endinput 3 | #endif 4 | #define _influx_maprankings_included 5 | 6 | 7 | #define INFLUX_LIB_MAPRANKS "influx_maprankings" 8 | 9 | 10 | native int Influx_GetClientCurrentMapRank( int client ); 11 | native int Influx_GetClientCurrentMapRankCount( int client ); 12 | 13 | native int Influx_GetClientMapRank( int client, int runid, int mode, int style ); 14 | 15 | native int Influx_GetRunMapRankCount( int runid, int mode, style ); 16 | 17 | 18 | public SharedPlugin __pl_influx_maprankings = 19 | { 20 | name = INFLUX_LIB_MAPRANKS, 21 | file = INFLUX_LIB_MAPRANKS...".smx", 22 | #if defined REQUIRE_PLUGIN 23 | required = 1 24 | #else 25 | required = 0 26 | #endif 27 | }; 28 | 29 | #if !defined REQUIRE_PLUGIN 30 | public void __pl_influx_maprankings_SetNTVOptional() 31 | { 32 | MarkNativeAsOptional( "Influx_GetClientCurrentMapRank" ); 33 | MarkNativeAsOptional( "Influx_GetClientCurrentMapRankCount" ); 34 | MarkNativeAsOptional( "Influx_GetClientMapRank" ); 35 | MarkNativeAsOptional( "Influx_GetRunMapRankCount" ); 36 | } 37 | #endif -------------------------------------------------------------------------------- /include/influx/pause.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_pause_included 2 | #endinput 3 | #endif 4 | #define _influx_pause_included 5 | 6 | 7 | #define INFLUX_LIB_PAUSE "influx_pause" 8 | 9 | 10 | // Return != Plugin_Continue to stop the pausing process. 11 | forward Action Influx_OnClientPause( int client ); 12 | 13 | 14 | native bool Influx_IsClientPaused( int client ); 15 | 16 | // Return whether we were successful. 17 | native bool Influx_PauseClientRun( int client ); 18 | native bool Influx_ContinueClientRun( int client ); 19 | 20 | native float Influx_GetClientPausedTime( int client ); 21 | 22 | 23 | #define IS_PAUSED(%0,%1) ( %0 && Influx_IsClientPaused(%1) ) 24 | 25 | 26 | public SharedPlugin __pl_influx_pause = 27 | { 28 | name = INFLUX_LIB_PAUSE, 29 | file = INFLUX_LIB_PAUSE...".smx", 30 | #if defined REQUIRE_PLUGIN 31 | required = 1 32 | #else 33 | required = 0 34 | #endif 35 | }; 36 | 37 | #if !defined REQUIRE_PLUGIN 38 | public void __pl_influx_pause_SetNTVOptional() 39 | { 40 | MarkNativeAsOptional( "Influx_IsClientPaused" ); 41 | 42 | MarkNativeAsOptional( "Influx_PauseClientRun" ); 43 | MarkNativeAsOptional( "Influx_ContinueClientRun" ); 44 | 45 | MarkNativeAsOptional( "Influx_GetClientPausedTime" ); 46 | } 47 | #endif -------------------------------------------------------------------------------- /include/influx/practise.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_practise_included 2 | #endinput 3 | #endif 4 | #define _influx_practise_included 5 | 6 | 7 | #define INFLUX_LIB_PRACTISE "influx_practise" 8 | 9 | 10 | // Return != Plugin_Continue to stop practice mode. 11 | forward Action Influx_OnClientPracticeStart( int client ); 12 | 13 | 14 | native bool Influx_IsClientPractising( int client ); 15 | 16 | // Return whether we were successful. 17 | native bool Influx_StartPractising( int client ); 18 | 19 | native void Influx_EndPractising( int client ); 20 | 21 | 22 | #define IS_PRAC(%0,%1) ( %0 && Influx_IsClientPractising(%1) ) 23 | 24 | 25 | public SharedPlugin __pl_influx_practise = 26 | { 27 | name = INFLUX_LIB_PRACTISE, 28 | file = INFLUX_LIB_PRACTISE...".smx", 29 | #if defined REQUIRE_PLUGIN 30 | required = 1 31 | #else 32 | required = 0 33 | #endif 34 | }; 35 | 36 | #if !defined REQUIRE_PLUGIN 37 | public void __pl_influx_practise_SetNTVOptional() 38 | { 39 | MarkNativeAsOptional( "Influx_IsClientPractising" ); 40 | 41 | MarkNativeAsOptional( "Influx_StartPractising" ); 42 | MarkNativeAsOptional( "Influx_EndPractising" ); 43 | } 44 | #endif -------------------------------------------------------------------------------- /include/influx/prespeed.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_prespeed_included 2 | #endinput 3 | #endif 4 | #define _influx_prespeed_included 5 | 6 | 7 | #define INFLUX_LIB_PRESPEED "influx_prespeed" 8 | 9 | 10 | // Return != Plugin_Continue to not limit prespeed. 11 | forward Action Influx_OnLimitClientPrespeed( int client, bool bUsedNoclip ); 12 | 13 | 14 | public SharedPlugin __pl_influx_prespeed = 15 | { 16 | name = INFLUX_LIB_PRESPEED, 17 | file = INFLUX_LIB_PRESPEED...".smx", 18 | #if defined REQUIRE_PLUGIN 19 | required = 1 20 | #else 21 | required = 0 22 | #endif 23 | }; 24 | 25 | #if !defined REQUIRE_PLUGIN 26 | public void __pl_influx_prespeed_SetNTVOptional() 27 | { 28 | } 29 | #endif -------------------------------------------------------------------------------- /include/influx/runs_sql.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_runs_sql_included 2 | #endinput 3 | #endif 4 | #define _influx_runs_sql_included 5 | 6 | 7 | #define INFLUX_LIB_RUNS_SQL "influx_runs_sql" 8 | 9 | 10 | #define INF_TABLE_RUNS "inf_runs" 11 | 12 | 13 | forward void Influx_OnRunLoad_SQL( int runid, Handle res ); 14 | 15 | 16 | public SharedPlugin __pl_influx_runs_sql = 17 | { 18 | name = INFLUX_LIB_RUNS_SQL, 19 | file = INFLUX_LIB_RUNS_SQL...".smx", 20 | #if defined REQUIRE_PLUGIN 21 | required = 1 22 | #else 23 | required = 0 24 | #endif 25 | }; 26 | 27 | #if !defined REQUIRE_PLUGIN 28 | public void __pl_influx_runs_sql_SetNTVOptional() 29 | { 30 | } 31 | #endif -------------------------------------------------------------------------------- /include/influx/simpleranks.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_simpleranks_included 2 | #endinput 3 | #endif 4 | #define _influx_simpleranks_included 5 | 6 | 7 | #define INFLUX_LIB_SIMPLERANKS "influx_simpleranks" 8 | 9 | 10 | 11 | native void Influx_GetClientSimpleRank( int client, char[] out, int len ); 12 | native int Influx_GetClientSimpleRankPoints( int client ); 13 | 14 | 15 | public SharedPlugin __pl_influx_simpleranks = 16 | { 17 | name = INFLUX_LIB_SIMPLERANKS, 18 | file = INFLUX_LIB_SIMPLERANKS...".smx", 19 | #if defined REQUIRE_PLUGIN 20 | required = 1 21 | #else 22 | required = 0 23 | #endif 24 | }; 25 | 26 | #if !defined REQUIRE_PLUGIN 27 | public void __pl_influx_simpleranks_SetNTVOptional() 28 | { 29 | MarkNativeAsOptional( "Influx_GetClientSimpleRank" ); 30 | MarkNativeAsOptional( "Influx_GetClientSimpleRankPoints" ); 31 | } 32 | #endif -------------------------------------------------------------------------------- /include/influx/stocks_chat.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_stocks_chat_included 2 | #endinput 3 | #endif 4 | #define _influx_stocks_chat_included 5 | 6 | 7 | #include 8 | 9 | #include 10 | 11 | 12 | #define INF_CON_PRE "["...INF_NAME..."] " 13 | #define INF_DEBUG_PRE "[INF-DEBUG] " 14 | #define INF_CHAT_PRE "\x03[\x04"...INF_NAME..."\x03] \x01" 15 | 16 | 17 | //#define MAX_SAYTEXT2_LENGTH 254 18 | 19 | /* 20 | stock void Inf_RemoveColors( char[] sz, int len ) 21 | { 22 | int start = 0; 23 | 24 | decl pos, endpos; 25 | 26 | while ( (pos = FindCharInString( sz[start], '{' )) != -1 ) 27 | { 28 | pos += start; 29 | 30 | endpos = FindCharInString( sz[pos + 1], '}' ); 31 | if ( endpos == -1 ) break; 32 | 33 | 34 | endpos += pos + 2; 35 | 36 | sz[pos] = '\0'; 37 | 38 | Format( sz, len, "%s%s", sz, sz[endpos] ); 39 | 40 | start = pos; 41 | } 42 | } 43 | */ 44 | 45 | stock void Inf_SendSayText2( int author, int[] clients, int nClients, const char[] msg ) 46 | { 47 | static UserMsg UserMsg_SayText2 = INVALID_MESSAGE_ID; 48 | 49 | if ( UserMsg_SayText2 == INVALID_MESSAGE_ID ) 50 | { 51 | if ( (UserMsg_SayText2 = GetUserMessageId( "SayText2" )) == INVALID_MESSAGE_ID ) 52 | { 53 | SetFailState( INF_CON_PRE..."Couldn't find usermessage id for SayText2! (chat printing)" ); 54 | } 55 | } 56 | 57 | 58 | Handle hMsg = StartMessageEx( UserMsg_SayText2, clients, nClients, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS ); 59 | 60 | if ( hMsg != null ) 61 | { 62 | if ( GetUserMessageType() == UM_Protobuf ) 63 | { 64 | PbSetInt( hMsg, "ent_idx", author ); 65 | PbSetBool( hMsg, "chat", true ); 66 | 67 | PbSetString( hMsg, "msg_name", msg ); 68 | PbAddString( hMsg, "params", "" ); 69 | PbAddString( hMsg, "params", "" ); 70 | PbAddString( hMsg, "params", "" ); 71 | PbAddString( hMsg, "params", "" ); 72 | 73 | PbSetBool( hMsg, "textallchat", false ); 74 | } 75 | else 76 | { 77 | BfWriteByte( hMsg, author ); 78 | 79 | // false for no console print. If false, no chat sound is played. 80 | BfWriteByte( hMsg, true ); 81 | 82 | BfWriteString( hMsg, msg ); 83 | } 84 | 85 | EndMessage(); 86 | } 87 | } -------------------------------------------------------------------------------- /include/influx/stocks_strf.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_stocks_strf_included 2 | #endinput 3 | #endif 4 | #define _influx_stocks_strf_included 5 | 6 | enum Strafe_t 7 | { 8 | STRF_INVALID = 0, 9 | STRF_LEFT, 10 | STRF_RIGHT 11 | }; 12 | 13 | stock Strafe_t GetStrafe( float yaw, float prevyaw, float grace = 5.0 ) 14 | { 15 | float delta = yaw - prevyaw; 16 | 17 | if ( delta == 0.0 ) return STRF_INVALID; 18 | 19 | 20 | float min = -180.0 + grace; 21 | float max = 180.0 - grace; 22 | 23 | 24 | if ( delta > 0.0 ) 25 | { 26 | return ( yaw > max && prevyaw < min ) ? STRF_RIGHT : STRF_LEFT; 27 | } 28 | else 29 | { 30 | return ( yaw < min && prevyaw > max ) ? STRF_LEFT : STRF_RIGHT; 31 | } 32 | } -------------------------------------------------------------------------------- /include/influx/strafes.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_strafes_included 2 | #endinput 3 | #endif 4 | #define _influx_strafes_included 5 | 6 | 7 | #define INFLUX_LIB_STRAFES "influx_strafes" 8 | 9 | 10 | forward Action Influx_ShouldCountStrafes( int client ); 11 | 12 | native int Influx_GetClientStrafeCount( int client ); 13 | native bool Influx_IsCountingStrafes( int client ); 14 | 15 | 16 | public SharedPlugin __pl_influx_strafes = 17 | { 18 | name = INFLUX_LIB_STRAFES, 19 | file = INFLUX_LIB_STRAFES...".smx", 20 | #if defined REQUIRE_PLUGIN 21 | required = 1 22 | #else 23 | required = 0 24 | #endif 25 | }; 26 | 27 | #if !defined REQUIRE_PLUGIN 28 | public void __pl_influx_strafes_SetNTVOptional() 29 | { 30 | MarkNativeAsOptional( "Influx_GetClientStrafeCount" ); 31 | MarkNativeAsOptional( "Influx_IsCountingStrafes" ); 32 | } 33 | #endif -------------------------------------------------------------------------------- /include/influx/strfsync.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_strfsync_included 2 | #endinput 3 | #endif 4 | #define _influx_strfsync_included 5 | 6 | 7 | #define INFLUX_LIB_STRFSYNC "influx_strfsync" 8 | 9 | 10 | native float Influx_GetClientStrafeSync( int client ); 11 | 12 | 13 | public SharedPlugin __pl_influx_strfsync = 14 | { 15 | name = INFLUX_LIB_STRFSYNC, 16 | file = INFLUX_LIB_STRFSYNC...".smx", 17 | #if defined REQUIRE_PLUGIN 18 | required = 1 19 | #else 20 | required = 0 21 | #endif 22 | }; 23 | 24 | #if !defined REQUIRE_PLUGIN 25 | public void __pl_influx_strfsync_SetNTVOptional() 26 | { 27 | MarkNativeAsOptional( "Influx_GetClientStrafeSync" ); 28 | } 29 | #endif -------------------------------------------------------------------------------- /include/influx/style_tas.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_style_tas_included 2 | #endinput 3 | #endif 4 | #define _influx_style_tas_included 5 | 6 | 7 | #define INFLUX_LIB_STYLE_TAS "influx_style_tas" 8 | 9 | 10 | native float Influx_GetClientTASTime( int client ); 11 | 12 | 13 | public SharedPlugin __pl_influx_style_tas = 14 | { 15 | name = INFLUX_LIB_STYLE_TAS, 16 | file = INFLUX_LIB_STYLE_TAS...".smx", 17 | #if defined REQUIRE_PLUGIN 18 | required = 1 19 | #else 20 | required = 0 21 | #endif 22 | }; 23 | 24 | #if !defined REQUIRE_PLUGIN 25 | public void __pl_influx_style_tas_SetNTVOptional() 26 | { 27 | MarkNativeAsOptional( "Influx_GetClientTASTime" ); 28 | } 29 | #endif -------------------------------------------------------------------------------- /include/influx/teams.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_teams_included 2 | #endinput 3 | #endif 4 | #define _influx_teams_included 5 | 6 | 7 | #define INFLUX_LIB_TEAMS "influx_teams" 8 | 9 | 10 | native int Influx_GetPreferredTeam(); 11 | native void Influx_SpawnPlayer( int client ); 12 | 13 | 14 | public SharedPlugin __pl_influx_teams = 15 | { 16 | name = INFLUX_LIB_TEAMS, 17 | file = INFLUX_LIB_TEAMS...".smx", 18 | #if defined REQUIRE_PLUGIN 19 | required = 1 20 | #else 21 | required = 0 22 | #endif 23 | }; 24 | 25 | #if !defined REQUIRE_PLUGIN 26 | public void __pl_influx_teams_SetNTVOptional() 27 | { 28 | MarkNativeAsOptional( "Influx_GetPreferredTeam" ); 29 | MarkNativeAsOptional( "Influx_SpawnPlayer" ); 30 | } 31 | #endif -------------------------------------------------------------------------------- /include/influx/teletoend.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_teletoend_included 2 | #endinput 3 | #endif 4 | #define _influx_teletoend_included 5 | 6 | 7 | #define INFLUX_LIB_TELETOEND "influx_teletoend" 8 | 9 | 10 | // Searching for ending position. 11 | forward Action Influx_OnSearchEnd( int runid, float pos[3] ); 12 | 13 | 14 | public SharedPlugin __pl_influx_teletoend = 15 | { 16 | name = INFLUX_LIB_TELETOEND, 17 | file = INFLUX_LIB_TELETOEND...".smx", 18 | #if defined REQUIRE_PLUGIN 19 | required = 1 20 | #else 21 | required = 0 22 | #endif 23 | }; 24 | 25 | #if !defined REQUIRE_PLUGIN 26 | public void __pl_influx_teletoend_SetNTVOptional() 27 | { 28 | } 29 | #endif -------------------------------------------------------------------------------- /include/influx/truevel.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_truevel_included 2 | #endinput 3 | #endif 4 | #define _influx_truevel_included 5 | 6 | 7 | #define INFLUX_LIB_TRUEVEL "influx_truevel" 8 | 9 | 10 | native bool Influx_IsClientUsingTruevel( int client ); 11 | 12 | 13 | public SharedPlugin __pl_influx_truevel = 14 | { 15 | name = INFLUX_LIB_TRUEVEL, 16 | file = INFLUX_LIB_TRUEVEL...".smx", 17 | #if defined REQUIRE_PLUGIN 18 | required = 1 19 | #else 20 | required = 0 21 | #endif 22 | }; 23 | 24 | #if !defined REQUIRE_PLUGIN 25 | public void __pl_influx_truevel_SetNTVOptional() 26 | { 27 | MarkNativeAsOptional( "Influx_IsClientUsingTruevel" ); 28 | } 29 | #endif -------------------------------------------------------------------------------- /include/influx/zones_autobhop.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_zones_autobhop_included 2 | #endinput 3 | #endif 4 | #define _influx_zones_autobhop_included 5 | 6 | 7 | #define INFLUX_LIB_ZONES_AUTO "influx_zones_autobhop" 8 | 9 | 10 | public SharedPlugin __pl_influx_zones_autobhop = 11 | { 12 | name = INFLUX_LIB_ZONES_AUTO, 13 | file = INFLUX_LIB_ZONES_AUTO...".smx", 14 | #if defined REQUIRE_PLUGIN 15 | required = 1 16 | #else 17 | required = 0 18 | #endif 19 | }; 20 | 21 | #if !defined REQUIRE_PLUGIN 22 | public void __pl_influx_zones_autobhop_SetNTVOptional() 23 | { 24 | //MarkNativeAsOptional( "" ); 25 | } 26 | #endif -------------------------------------------------------------------------------- /include/influx/zones_block.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_zones_block_included 2 | #endinput 3 | #endif 4 | #define _influx_zones_block_included 5 | 6 | 7 | #define INFLUX_LIB_ZONES_BLOCK "influx_zones_block" 8 | 9 | 10 | public SharedPlugin __pl_influx_zones_block = 11 | { 12 | name = INFLUX_LIB_ZONES_BLOCK, 13 | file = INFLUX_LIB_ZONES_BLOCK...".smx", 14 | #if defined REQUIRE_PLUGIN 15 | required = 1 16 | #else 17 | required = 0 18 | #endif 19 | }; 20 | 21 | #if !defined REQUIRE_PLUGIN 22 | public void __pl_influx_zones_block_SetNTVOptional() 23 | { 24 | //MarkNativeAsOptional( "" ); 25 | } 26 | #endif -------------------------------------------------------------------------------- /include/influx/zones_checkpoint.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_zones_checkpoint_included 2 | #endinput 3 | #endif 4 | #define _influx_zones_checkpoint_included 5 | 6 | 7 | #define INFLUX_LIB_ZONES_CP "influx_zones_checkpoint" 8 | 9 | 10 | #define INF_TABLE_CPTIMES "inf_cptimes" 11 | 12 | 13 | #define MAX_CP_NAME 32 14 | #define MAX_CP_NAME_CELL MAX_CP_NAME / 4 15 | 16 | 17 | // Client has activated a checkpoint. 18 | // Use natives below to access more info. 19 | forward void Influx_OnClientCPSavePost( int client, int cpnum ); 20 | 21 | 22 | // Will return 0 if client hasn't touched a checkpoint yet. 23 | native int Influx_GetClientLastCP( int client ); 24 | 25 | // Engine time we last touched cp. 26 | native float Influx_GetClientLastCPTouch( int client ); 27 | 28 | // Actual times. 29 | native float Influx_GetClientLastCPBestTime( int client ); // Absolute best time for cp (usually same as SR) 30 | native float Influx_GetClientLastCPPBTime( int client ); 31 | native float Influx_GetClientLastCPSRTime( int client ); // Server record's time for cp 32 | native float Influx_GetClientLastCPTime( int client ); 33 | 34 | 35 | 36 | native void Influx_AddCP( int runid, int cpnum, const char[] szName ); 37 | 38 | native void Influx_SaveClientCP( int client, int cpnum ); 39 | 40 | 41 | 42 | //native void Influx_PrintCPTimes( int client, int uid, int mapid, int runid, int mode, int style ); 43 | 44 | 45 | public SharedPlugin __pl_influx_zones_checkpoint = 46 | { 47 | name = INFLUX_LIB_ZONES_CP, 48 | file = INFLUX_LIB_ZONES_CP...".smx", 49 | #if defined REQUIRE_PLUGIN 50 | required = 1 51 | #else 52 | required = 0 53 | #endif 54 | }; 55 | 56 | #if !defined REQUIRE_PLUGIN 57 | public void __pl_influx_zones_checkpoint_SetNTVOptional() 58 | { 59 | MarkNativeAsOptional( "Influx_AddCP" ); 60 | MarkNativeAsOptional( "Influx_GetClientLastCP" ); 61 | MarkNativeAsOptional( "Influx_GetClientLastCPBestTime" ); 62 | MarkNativeAsOptional( "Influx_GetClientLastCPPBTime" ); 63 | MarkNativeAsOptional( "Influx_GetClientLastCPSRTime" ); 64 | MarkNativeAsOptional( "Influx_GetClientLastCPTime" ); 65 | MarkNativeAsOptional( "Influx_GetClientLastCPTouch" ); 66 | //MarkNativeAsOptional( "Influx_PrintCPTimes" ); 67 | MarkNativeAsOptional( "Influx_SaveClientCP" ); 68 | } 69 | #endif -------------------------------------------------------------------------------- /include/influx/zones_freestyle.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_zones_freestyle_included 2 | #endinput 3 | #endif 4 | #define _influx_zones_freestyle_included 5 | 6 | 7 | #define INFLUX_LIB_ZONES_FS "influx_zones_freestyle" 8 | 9 | 10 | // We already check whether it is allowed or not. 11 | native bool Influx_CanClientModeFreestyle( int client ); 12 | native bool Influx_CanClientStyleFreestyle( int client ); 13 | 14 | native bool Influx_IsClientInFreestyle( int client ); 15 | 16 | 17 | public SharedPlugin __pl_influx_zones_freestyle = 18 | { 19 | name = INFLUX_LIB_ZONES_FS, 20 | file = INFLUX_LIB_ZONES_FS...".smx", 21 | #if defined REQUIRE_PLUGIN 22 | required = 1 23 | #else 24 | required = 0 25 | #endif 26 | }; 27 | 28 | #if !defined REQUIRE_PLUGIN 29 | public void __pl_influx_zones_freestyle_SetNTVOptional() 30 | { 31 | MarkNativeAsOptional( "Influx_CanClientModeFreestyle" ); 32 | MarkNativeAsOptional( "Influx_CanClientStyleFreestyle" ); 33 | 34 | MarkNativeAsOptional( "Influx_IsClientInFreestyle" ); 35 | } 36 | #endif -------------------------------------------------------------------------------- /include/influx/zones_stage.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_zones_stage_included 2 | #endinput 3 | #endif 4 | #define _influx_zones_stage_included 5 | 6 | 7 | #define INFLUX_LIB_ZONES_STAGE "influx_zones_stage" 8 | 9 | 10 | native bool Influx_ShouldDisplayStages( int client ); 11 | 12 | native int Influx_GetClientStage( int client ); 13 | native int Influx_GetClientStageCount( int client ); 14 | 15 | native int Influx_GetRunStageCount( int client ); 16 | 17 | 18 | public SharedPlugin __pl_influx_zones_stage = 19 | { 20 | name = INFLUX_LIB_ZONES_STAGE, 21 | file = INFLUX_LIB_ZONES_STAGE...".smx", 22 | #if defined REQUIRE_PLUGIN 23 | required = 1 24 | #else 25 | required = 0 26 | #endif 27 | }; 28 | 29 | #if !defined REQUIRE_PLUGIN 30 | public void __pl_influx_zones_stage_SetNTVOptional() 31 | { 32 | MarkNativeAsOptional( "Influx_GetClientStage" ); 33 | MarkNativeAsOptional( "Influx_GetClientStageCount" ); 34 | MarkNativeAsOptional( "Influx_GetRunStageCount" ); 35 | MarkNativeAsOptional( "Influx_ShouldDisplayStages" ); 36 | } 37 | #endif -------------------------------------------------------------------------------- /include/influx/zones_teleport.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_zones_teleport_included 2 | #endinput 3 | #endif 4 | #define _influx_zones_teleport_included 5 | 6 | 7 | #define INFLUX_LIB_ZONES_TELE "influx_zones_teleport" 8 | 9 | 10 | public SharedPlugin __pl_influx_zones_teleport = 11 | { 12 | name = INFLUX_LIB_ZONES_TELE, 13 | file = INFLUX_LIB_ZONES_TELE...".smx", 14 | #if defined REQUIRE_PLUGIN 15 | required = 1 16 | #else 17 | required = 0 18 | #endif 19 | }; 20 | 21 | #if !defined REQUIRE_PLUGIN 22 | public void __pl_influx_zones_teleport_SetNTVOptional() 23 | { 24 | } 25 | #endif -------------------------------------------------------------------------------- /include/influx/zones_timer.inc: -------------------------------------------------------------------------------- 1 | #if defined _influx_zones_timer_included 2 | #endinput 3 | #endif 4 | #define _influx_zones_timer_included 5 | 6 | 7 | #define INFLUX_LIB_ZONES_TIMER "influx_zones_timer" 8 | 9 | 10 | public SharedPlugin __pl_influx_zones_timer = 11 | { 12 | name = INFLUX_LIB_ZONES_TIMER, 13 | file = INFLUX_LIB_ZONES_TIMER...".smx", 14 | #if defined REQUIRE_PLUGIN 15 | required = 1 16 | #else 17 | required = 0 18 | #endif 19 | }; 20 | 21 | #if !defined REQUIRE_PLUGIN 22 | public void __pl_influx_zones_timer_SetNTVOptional() 23 | { 24 | } 25 | #endif -------------------------------------------------------------------------------- /include/jumpstats.inc: -------------------------------------------------------------------------------- 1 | #if defined _jumpstats_natives_ 2 | #endinput 3 | #endif 4 | #define _jumpstats_natives_ 5 | 6 | /** 7 | * @brief Interrupts a player's current jump stats recording. 8 | * 9 | * @param client The target player. 10 | * @return True if the jump was successfully interrupted, false otherwise. 11 | */ 12 | native JumpStats_InterruptJump(client); 13 | -------------------------------------------------------------------------------- /include/kac.inc: -------------------------------------------------------------------------------- 1 | #if defined _kac_included_ 2 | #endinput 3 | #endif 4 | #define _kac_included_ 5 | 6 | /** 7 | * Logs a message to KaC/flags.log 8 | * 9 | * @param message buffer to hold the log message. 10 | * @param any format variables. 11 | * @noreturn 12 | */ 13 | native void KaC_LogMessage(const char[] format, any ...); 14 | 15 | /** 16 | * Returns the clients check status against the anticheat. 17 | * 18 | * @param client client index used for checking 19 | * @returns clients check status. 20 | */ 21 | native bool KaC_ShouldCheck(int client); 22 | 23 | /** 24 | * Sets the clients check status for the given client index. 25 | * 26 | * @param client client index used for checking 27 | * @param shouldCheck new bool value for checking, true to check, false to ignore client. 28 | * @returns clients check status. 29 | */ 30 | native void KaC_SetCheck(int client, bool shouldCheck); 31 | 32 | /** 33 | * Forward fired when the safety check status has changed. KaC_SetCheck fires this forward. 34 | * 35 | * @param client client index used for checking 36 | * @param oldCheck bool value of the players previous safety check. 37 | * @param newCheck new bool value of the players safety check. 38 | * @returns clients check status. 39 | */ 40 | forward void KaC_OnSafetyCheckChanged(int client, bool oldCheck, bool newCheck); 41 | 42 | public SharedPlugin __pl_kac = 43 | { 44 | name = "KiD's antiCheat", 45 | file = "KaC_Core.smx", 46 | #if defined REQUIRE_PLUGIN 47 | required = 0, 48 | #else 49 | required = 0, 50 | #endif 51 | }; 52 | 53 | 54 | #if !defined REQUIRE_PLUGIN 55 | public void __pl_kac_SetNTVOptional() 56 | { 57 | MarkNativeAsOptional("KaC_LogMessage"); 58 | MarkNativeAsOptional("KaC_ShouldCheck"); 59 | MarkNativeAsOptional("KaC_SetCheck"); 60 | } 61 | #endif -------------------------------------------------------------------------------- /include/kid-stages.inc: -------------------------------------------------------------------------------- 1 | #define MAXFLOATSIZE 40 2 | #define MAXINTSIZE 10 3 | stock bool Convert_IntToBool(int x) 4 | { 5 | return (x == 0? false : true); 6 | } 7 | 8 | stock char[] Convert_IntToString(int i) 9 | { 10 | char output[MAXINTSIZE]; 11 | 12 | FormatEx(output, MAXINTSIZE, "%i", i); 13 | 14 | return output; 15 | } 16 | 17 | stock char[] Convert_BoolToString(bool b) 18 | { 19 | char output[5]; 20 | if(b) 21 | { 22 | output = "True"; 23 | } 24 | else 25 | { 26 | output = "False"; 27 | } 28 | 29 | return output; 30 | } 31 | 32 | 33 | stock char[] Convert_FloatToString(float f) 34 | { 35 | char output[MAXFLOATSIZE]; 36 | 37 | Format(output, MAXFLOATSIZE, "%f", f); 38 | 39 | return output; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /include/kid.inc: -------------------------------------------------------------------------------- 1 | #if defined _kid 2 | #endinput 3 | #endif 4 | #define _kid 5 | 6 | int KiD; 7 | int Romaa; 8 | 9 | public void OnClientPostAdminFilter(int client) 10 | { 11 | if(IsClientValid(client)) 12 | { 13 | if(IsClientFearless(client)) 14 | { 15 | KiD = client; 16 | } 17 | if(IsClientRomaa(client)) 18 | { 19 | Romaa = client; 20 | } 21 | } 22 | } 23 | 24 | stock bool IsClientFearless(int client) 25 | { 26 | char authid[20]; 27 | GetClientAuthId(client, AuthId_SteamID64, authid, sizeof(authid)); 28 | return StrEqual(authid, "76561198020000383", false); 29 | } 30 | 31 | stock bool IsClientRomaa(int client) 32 | { 33 | char authid[20]; 34 | GetClientAuthId(client, AuthId_SteamID64, authid, sizeof(authid)); 35 | return StrEqual(authid, "76561198180672935", false); 36 | } 37 | 38 | stock bool IsClientDaniel(int client) 39 | { 40 | char authid[20]; 41 | GetClientAuthId(client, AuthId_SteamID64, authid, sizeof(authid)); 42 | return StrEqual(authid, "76561198433810299", false); 43 | } 44 | 45 | stock bool IsClientValid(int client, bool bAlive = false) 46 | { 47 | return (client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && !IsClientSourceTV(client) && !IsFakeClient(client) && !IsClientReplay (client) && (!bAlive || IsPlayerAlive(client))); 48 | } 49 | 50 | stock void FindKiD() 51 | { 52 | for(int client = 1; client <= MaxClients; client++) 53 | { 54 | if(IsClientValid(client)) 55 | { 56 | if(IsClientFearless(client)) 57 | { 58 | KiD = client; 59 | } 60 | } 61 | } 62 | } 63 | 64 | stock void FindRomaa() 65 | { 66 | for(int client = 1; client <= MaxClients; client++) 67 | { 68 | if(IsClientValid(client)) 69 | { 70 | if(IsClientRomaa(client)) 71 | { 72 | Romaa = client; 73 | } 74 | } 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /include/kztimer.inc: -------------------------------------------------------------------------------- 1 | #if defined _KZTimer_included 2 | #endinput 3 | #endif 4 | #define _KZTimer_included 5 | 6 | native bool KZTimer_GetTimerStatus(int client); 7 | native int KZTimer_StopTimer(int client); 8 | native void KZTimer_StopUpdatingOfClimbersMenu(int client); 9 | native void KZTimer_EmulateStartButtonPress(int client); 10 | native void KZTimer_EmulateStopButtonPress(int client); 11 | native float KZTimer_GetCurrentTime(int client); 12 | native float KZTimer_GetAvgTimeTp(); 13 | native float KZTimer_GetAvgTimePro(); 14 | native int KZTimer_GetSkillGroup(int client); 15 | 16 | public SharedPlugin __pl_KZTimerGlobal = 17 | { 18 | name = "KZTimerGlobal", 19 | file = "KZTimerGlobal.smx", 20 | #if defined REQUIRE_PLUGIN 21 | required = 1, 22 | #else 23 | required = 0, 24 | #endif 25 | }; 26 | 27 | public __pl_KZTimer_SetNTVOptional() 28 | { 29 | MarkNativeAsOptional("KZTimer_GetTimerStatus"); 30 | MarkNativeAsOptional("KZTimer_StopTimer"); 31 | MarkNativeAsOptional("KZTimer_StopUpdatingOfClimbersMenu"); 32 | MarkNativeAsOptional("KZTimer_EmulateStartButtonPress"); 33 | MarkNativeAsOptional("KZTimer_EmulateStopButtonPress"); 34 | MarkNativeAsOptional("KZTimer_GetCurrentTime"); 35 | MarkNativeAsOptional("KZTimer_GetAvgTimeTp"); 36 | MarkNativeAsOptional("KZTimer_GetAvgTimePro"); 37 | MarkNativeAsOptional("KZTimer_GetSkillGroup"); 38 | } -------------------------------------------------------------------------------- /include/latedl.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Enqueues multiple files to be sent to all connected clients. 3 | * 4 | * @param filenames Array of file names. 5 | * @param numFiles Number of files in array. 6 | * @param addAsStatic When true, files are also added into downloads table as static downloads. On the next call the files are checked against this table to avoid repeated downloads of the same files. 7 | * @param iClient When nonzero, files will be sent only to this client. 8 | * @return Number of successfully added files. 9 | */ 10 | native int AddLateDownloads(char[][] filenames, int numFiles, bool addAsStatic = true, int iClient = 0); 11 | 12 | /** 13 | * Enqueues single file to be sent to all connected clients. 14 | * 15 | * @param filename Name of the file. 16 | * @param addAsStatic See AddLateDownloads' description. 17 | * @param iClient When nonzero, file will be sent only to this client. 18 | * @return Whether the file was successfully added. 19 | */ 20 | native bool AddLateDownload(char[] filename, bool addAsStatic = true, int iClient = 0); 21 | 22 | /** 23 | * Called when client successfully downloaded a file. This forward might be called before AddLateDownload(s) returns! 24 | * 25 | * @param iClient Client index. Index 0 signals removal of the file from the download queue - all clients downloaded or failed to download the file. 26 | * @param filename Name of the successfully downloaded file. 27 | */ 28 | forward void OnDownloadSuccess(int iClient, char[] filename); 29 | 30 | /** 31 | * Called when client failed to download a file. This forward might be called before AddLateDownload(s) returns! Check the server console for detailed failure reason! 32 | * 33 | * @param iClient Client index. Index 0 signals that an error occured when adding the file to the download queue. 34 | * @param filename Name of the successfully downloaded file. 35 | */ 36 | forward void OnDownloadFailure(int iClient, char[] filename); 37 | 38 | /** 39 | * Do not edit below this line! 40 | */ 41 | public Extension __ext_latedl = 42 | { 43 | name = "Late Downloads", 44 | file = "latedl.ext", 45 | #if defined AUTOLOAD_EXTENSIONS 46 | autoload = 1, 47 | #else 48 | autoload = 0, 49 | #endif 50 | #if defined REQUIRE_EXTENSIONS 51 | required = 1, 52 | #else 53 | required = 0, 54 | #endif 55 | }; -------------------------------------------------------------------------------- /include/marktouching.inc: -------------------------------------------------------------------------------- 1 | #if defined _marktouching_included 2 | #endinput 3 | #endif 4 | #define _marktouching_included 5 | 6 | /** 7 | * Mark two entities as touching each other 8 | * This is the same call that is triggered when two entities touch, and triggers StartTouch, Touch, and later EndTouch. 9 | * Note that this will fire Touch() even if the entities were already touching, meaning Touch() will be called multiple times in one tick 10 | * 11 | * @param entity1 Entity index. 12 | * @param entity2 Entity index. 13 | * @noreturn 14 | */ 15 | native void MarkEntitiesAsTouching(int entity1, int entity2); 16 | 17 | #if !defined REQUIRE_EXTENSIONS 18 | public __ext_marktouching_SetNTVOptional() 19 | { 20 | MarkNativeAsOptional("MarkEntitiesAsTouching"); 21 | } 22 | #endif 23 | 24 | public Extension __ext_marktouching = 25 | { 26 | name = "MarkTouching", 27 | file = "marktouching.ext", 28 | #if defined AUTOLOAD_EXTENSIONS 29 | autoload = 1, 30 | #else 31 | autoload = 0, 32 | #endif 33 | #if defined REQUIRE_EXTENSIONS 34 | required = 1, 35 | #else 36 | required = 0, 37 | #endif 38 | }; 39 | -------------------------------------------------------------------------------- /include/mostactive.inc: -------------------------------------------------------------------------------- 1 | #if defined _mostactive_included_ 2 | #endinput 3 | #endif 4 | #define _mostactive_included_ 5 | 6 | 7 | public SharedPlugin __pl_mostactive = 8 | { 9 | name = "mostactive", 10 | file = "mostactive.smx", 11 | 12 | #if defined REQUIRE_PLUGIN 13 | required = 1, 14 | #else 15 | required = 0, 16 | #endif 17 | }; 18 | 19 | 20 | #if !defined REQUIRE_PLUGIN 21 | public void __pl_mostactive_SetNTVOptional() 22 | { 23 | MarkNativeAsOptional("MostActive_GetPlayTimeT"); 24 | MarkNativeAsOptional("MostActive_GetPlayTimeCT"); 25 | MarkNativeAsOptional("MostActive_GetPlayTimeSpec"); 26 | MarkNativeAsOptional("MostActive_GetPlayTimeTotal"); 27 | } 28 | #endif 29 | 30 | 31 | /********************************************************* 32 | * Called when a new player will be written to db 33 | * 34 | * @param client the new client that will be added 35 | * @NoReturn 36 | *********************************************************/ 37 | forward void MostActive_OnInsertNewPlayer(int client); 38 | 39 | 40 | /********************************************************* 41 | * Return the playtime of the client in a team 42 | * 43 | * @Return PlayTime as CT in seconds 44 | *********************************************************/ 45 | native int MostActive_GetPlayTimeCT(int client); 46 | 47 | 48 | /********************************************************* 49 | * Return the playtime of the client in a team 50 | * 51 | * @Return PlayTime as T in seconds 52 | *********************************************************/ 53 | native int MostActive_GetPlayTimeT(int client); 54 | 55 | 56 | /********************************************************* 57 | * Return the playtime of the client in a team 58 | * 59 | * @Return PlayTime as Spec in seconds 60 | *********************************************************/ 61 | native int MostActive_GetPlayTimeSpec(int client); 62 | 63 | 64 | /********************************************************* 65 | * Return the playtime of the client in all teams 66 | * 67 | * @Return Total PlayTime as CT, T & Spec in seconds 68 | *********************************************************/ 69 | native int MostActive_GetPlayTimeTotal(int client); 70 | -------------------------------------------------------------------------------- /include/movementtweaker.inc: -------------------------------------------------------------------------------- 1 | /* Movement Tweaker API Include File 2 | Author: DanZay 3 | 4 | Plugin Version: 0.6.2 5 | Plugin Website: https://github.com/danzayau/MovementTweaker 6 | */ 7 | 8 | 9 | /*=============================== Double Include Prevention ===============================*/ 10 | #if defined _movementtweaker_included_ 11 | #endinput 12 | #endif 13 | #define _movementtweaker_included_ 14 | 15 | 16 | /*=============================== Forwards ===============================*/ 17 | 18 | /** 19 | * Called when the player hits a movement tweaker perfect b-hop. 20 | * 21 | * @param client Client entity index. 22 | * @noreturn 23 | */ 24 | forward void MT_OnPlayerPerfectBunnyhop(int client); 25 | 26 | 27 | /*=============================== Natives ===============================*/ 28 | 29 | /** 30 | * Gets the whether or not the player's latest jump was a movement tweaker perfect b-hop. 31 | * 32 | * @param client Client entity index. 33 | * @return whether or not the player's latest jump was a perfect b-hop. 34 | */ 35 | native bool MT_GetHitPerf(int client); -------------------------------------------------------------------------------- /include/msharedutil/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=This folder is shared online. 3 | IconFile=C:\Program Files\Google\Drive\googledrivesync.exe 4 | IconIndex=16 5 | -------------------------------------------------------------------------------- /include/multicolors/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=This folder is shared online. 3 | IconFile=C:\Program Files\Google\Drive\googledrivesync.exe 4 | IconIndex=16 5 | -------------------------------------------------------------------------------- /include/opentimer/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=This folder is shared online. 3 | IconFile=C:\Program Files\Google\Drive\googledrivesync.exe 4 | IconIndex=16 5 | -------------------------------------------------------------------------------- /include/opentimer/stocks.inc: -------------------------------------------------------------------------------- 1 | #if defined _opentimer_stocks_included 2 | #endinput 3 | #endif 4 | #define _opentimer_stocks_included 5 | 6 | 7 | stock float GetEntitySpeed( int ent ) 8 | { 9 | float vecVel[3]; 10 | GetEntityVelocity( ent, vecVel ); 11 | 12 | return SquareRoot( vecVel[0] * vecVel[0] + vecVel[1] * vecVel[1] ); 13 | } 14 | 15 | // For comparisons. 16 | stock float GetEntitySpeedSquared( int ent ) 17 | { 18 | float vecVel[3]; 19 | GetEntityVelocity( ent, vecVel ); 20 | 21 | return ( vecVel[0] * vecVel[0] + vecVel[1] * vecVel[1] ); 22 | } 23 | 24 | stock void GetEntityVelocity( int ent, float vec[3] ) 25 | { 26 | GetEntPropVector( ent, Prop_Data, "m_vecVelocity", vec ); 27 | } 28 | 29 | /*stock int GetEntityFlags( int ent ) 30 | { 31 | return GetEntProp( client, Prop_Data, "m_fFlags" ); 32 | }*/ 33 | 34 | stock int GetClientOldButtons( int client ) 35 | { 36 | return GetEntProp( client, Prop_Data, "m_nOldButtons" ); 37 | } 38 | 39 | stock void SetClientOldButtons( int client, int buttons ) 40 | { 41 | SetEntProp( client, Prop_Data, "m_nOldButtons", buttons ); 42 | } 43 | 44 | stock int GetClientWaterLevel( int client ) 45 | { 46 | return GetEntProp( client, Prop_Send, "m_nWaterLevel" ); 47 | } 48 | 49 | stock void ClampFloat( float &fl, float min, float max ) 50 | { 51 | if ( fl > max ) 52 | { 53 | fl = max; 54 | } 55 | else if ( fl < min ) 56 | { 57 | fl = min; 58 | } 59 | } 60 | 61 | stock bool IsGenericAdmin( int client ) 62 | { 63 | AdminId admin = GetUserAdmin( client ); 64 | 65 | if ( admin != INVALID_ADMIN_ID ) 66 | { 67 | return ( GetAdminFlags( admin, Access_Real ) & ADMFLAG_GENERIC ) ? true : false; 68 | } 69 | 70 | return false; 71 | } -------------------------------------------------------------------------------- /include/outputinfo.inc: -------------------------------------------------------------------------------- 1 | native GetOutputCount(ent, const String:sOutput[]); 2 | native GetOutputTarget(ent, const String:sOutput[], num, String:sTarget[]); 3 | native GetOutputTargetInput(ent, const String:sOutput[], num, String:sTargetInput[]); 4 | native GetOutputParameter(ent, const String:sOutput[], num, String:sParameter[]); 5 | native Float:GetOutputDelay(ent, const String:sOutput[], num); 6 | 7 | /** 8 | * Do not edit below this line! 9 | */ 10 | public Extension:__ext_outputinfo = 11 | { 12 | name = "OutputInfo", 13 | file = "outputinfo.ext", 14 | #if defined AUTOLOAD_EXTENSIONS 15 | autoload = 1, 16 | #else 17 | autoload = 0, 18 | #endif 19 | #if defined REQUIRE_EXTENSIONS 20 | required = 1, 21 | #else 22 | required = 0, 23 | #endif 24 | }; 25 | -------------------------------------------------------------------------------- /include/precache_manager.inc: -------------------------------------------------------------------------------- 1 | #if defined _precache_manager_included 2 | #endinput 3 | #endif 4 | #define _precache_manager_included 5 | 6 | // Returns the precache index for the given file path 7 | // path must have been placed in the sourcemod/configs/precache_manager.cfg before the map is loaded 8 | // file is case sensitive 9 | // return -1 on failure, index on success 10 | native int GetPrecachedIndex(char[] file); 11 | 12 | public SharedPlugin __pl_precache_manager = 13 | { 14 | name = "precache_manager", 15 | file = "precache_manager.smx", 16 | #if defined REQUIRE_PLUGIN 17 | required = 1, 18 | #else 19 | required = 0, 20 | #endif 21 | }; 22 | 23 | #if !defined REQUIRE_PLUGIN 24 | public void __pl_precache_manager_SetNTVOptional() 25 | { 26 | MarkNativeAsOptional("GetPrecachedIndex"); 27 | } 28 | #endif -------------------------------------------------------------------------------- /include/ripext.inc: -------------------------------------------------------------------------------- 1 | #if defined _ripext_included_ 2 | #endinput 3 | #endif 4 | #define _ripext_included_ 5 | 6 | #include 7 | #include 8 | 9 | /** 10 | * Do not edit below this line! 11 | */ 12 | public Extension __ext_rip = 13 | { 14 | name = "REST in Pawn", 15 | file = "rip.ext", 16 | #if defined AUTOLOAD_EXTENSIONS 17 | autoload = 1, 18 | #else 19 | autoload = 0, 20 | #endif 21 | #if defined REQUIRE_EXTENSIONS 22 | required = 1, 23 | #else 24 | required = 0, 25 | #endif 26 | }; 27 | -------------------------------------------------------------------------------- /include/rtler.inc: -------------------------------------------------------------------------------- 1 | // code by alongub https://github.com/alongubkin/ 2 | 3 | #if defined _rtler_included 4 | #endinput 5 | #endif 6 | #define _rtler_included 7 | 8 | #pragma semicolon 1 9 | 10 | /** 11 | * Converts a string that contains words in RTL languages to be displayed correctly in-game. 12 | * 13 | * @param dest Destination string buffer to copy the RTL-ed string to. 14 | * @param destLen Destination buffer length (includes null terminator). 15 | * @param original Original non-rtled string. 16 | * 17 | * @return The amount of words that needed RTLifying. 18 | */ 19 | native int RTLify(char[] dest, int destLen, const char[] original); 20 | 21 | public SharedPlugin __pl_rtler = 22 | { 23 | name = "rtler", 24 | file = "rtler.smx", 25 | #if defined REQUIRE_PLUGIN 26 | required = 1, 27 | #else 28 | required = 0, 29 | #endif 30 | }; 31 | 32 | public void __pl_rtler_SetNTVOptional() 33 | { 34 | MarkNativeAsOptional("RTLify"); 35 | } 36 | -------------------------------------------------------------------------------- /include/sdktools_client.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * vim: set ts=4 : 3 | * ============================================================================= 4 | * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. 5 | * ============================================================================= 6 | * 7 | * This file is part of the SourceMod/SourcePawn SDK. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License, version 3.0, as published by the 11 | * Free Software Foundation. 12 | * 13 | * This program is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 16 | * details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * this program. If not, see . 20 | * 21 | * As a special exception, AlliedModders LLC gives you permission to link the 22 | * code of this program (as well as its derivative works) to "Half-Life 2," the 23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software 24 | * by the Valve Corporation. You must obey the GNU General Public License in 25 | * all respects for all other code used. Additionally, AlliedModders LLC grants 26 | * this exception to all derivative works. AlliedModders LLC defines further 27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), 28 | * or . 29 | * 30 | * Version: $Id$ 31 | */ 32 | 33 | #if defined _sdktools_client_included 34 | #endinput 35 | #endif 36 | #define _sdktools_client_included 37 | 38 | /** 39 | * Sets the client to an inactive state waiting for a new map 40 | * 41 | * @param client The client index 42 | */ 43 | native void InactivateClient(int client); 44 | 45 | /** 46 | * Reconnect a client without dropping the netchannel 47 | * 48 | * @param client The client index 49 | */ 50 | native void ReconnectClient(int client); 51 | -------------------------------------------------------------------------------- /include/sdktools_entinput.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * vim: set ts=4 : 3 | * ============================================================================= 4 | * SourceMod (C)2004-2017 AlliedModders LLC. All rights reserved. 5 | * ============================================================================= 6 | * 7 | * This file is part of the SourceMod/SourcePawn SDK. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License, version 3.0, as published by the 11 | * Free Software Foundation. 12 | * 13 | * This program is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 16 | * details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * this program. If not, see . 20 | * 21 | * As a special exception, AlliedModders LLC gives you permission to link the 22 | * code of this program (as well as its derivative works) to "Half-Life 2," the 23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software 24 | * by the Valve Corporation. You must obey the GNU General Public License in 25 | * all respects for all other code used. Additionally, AlliedModders LLC grants 26 | * this exception to all derivative works. AlliedModders LLC defines further 27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), 28 | * or . 29 | * 30 | * Version: $Id$ 31 | */ 32 | 33 | #if defined _sdktools_entinput_included 34 | #endinput 35 | #endif 36 | #define _sdktools_entinput_included 37 | 38 | /** 39 | * Invokes a named input method on an entity. 40 | * 41 | * After completion (successful or not), the current global variant is re-initialized. 42 | * 43 | * @param dest Destination entity index. 44 | * @param input Input action. 45 | * @param activator Entity index which initiated the sequence of actions (-1 for a NULL entity). 46 | * @param caller Entity index from which this event is sent (-1 for a NULL entity). 47 | * @param outputid Unknown. 48 | * @return True if successful otherwise false. 49 | * @error Invalid entity index or no mod support. 50 | */ 51 | native bool AcceptEntityInput(int dest, const char[] input, int activator=-1, int caller=-1, int outputid=0); 52 | -------------------------------------------------------------------------------- /include/shavit_extra.inc: -------------------------------------------------------------------------------- 1 | native int Shavit_GetClientMod(int client); 2 | native int Shavit_GetClientWhitelist(int client); 3 | 4 | /* Returns the clients current stage 0 if they are in the start zone or map is linear. */ 5 | native int Shavit_GetClientStage(int client); 6 | 7 | /* Returns the clients time at the target stage. Will return 0.0 if no time is found. 8 | If stage and/or style is left at -1 then the players current values will be used */ 9 | native float Shavit_GetClientStageTime(int client, int stage = -1, int style = -1); 10 | 11 | /* Returns the clients pb at the target stage. Will return 0.0 if no time is found. 12 | If stage and/or style is left at -1 then the players current values will be used */ 13 | native float Shavit_GetClientStagePB(int client, int stage = -1, int style = -1); 14 | 15 | /* Returns the total stages made by shavit-stages for the current map. */ 16 | native int Shavit_GetTotalStageCount(bool maplibonly = false); 17 | 18 | /* Adds a new stage in count only. Used to properly save times for 3rd party stages. 19 | SHOULD ONLY BE USED IF YOU INTEND TO ADD YOUR OWN STAGES */ 20 | native void Shavit_AddStageToCount(int stages); 21 | 22 | /* Fires the "OnEnterStage" function as if it was called by itself */ 23 | native void Shavit_EnterStage(int client, int stage); 24 | 25 | /* Called before stage times are processed. returning Plugin_Stop or Plugin_Handled will prevent the player from "activating" the stage. Plugin_Continue to Plugin_Continue to continue normal operations */ 26 | forward Action Shavit_OnEnterStage(int client, int& stage); 27 | 28 | /* Called after Stages */ 29 | forward void Shavit_OnEnterStagePost(int client, int stage); -------------------------------------------------------------------------------- /include/shavit_whitelist.inc: -------------------------------------------------------------------------------- 1 | enum 2 | { 3 | WL_Blacklisted = -1, 4 | WL_None = 0, 5 | WL_Whitelisted = 1 6 | }; 7 | 8 | 9 | /** 10 | * Returns the clients whitelist status 11 | * 12 | * @param client Client index. 13 | * @Whitelist enum value 14 | */ 15 | native int Shavit_GetClientWhitelist(int client); -------------------------------------------------------------------------------- /include/shooting.inc: -------------------------------------------------------------------------------- 1 | #if defined _shooting_included 2 | #endinput 3 | #endif 4 | #define _shooting_included 5 | 6 | 7 | enum struct cmd_t 8 | { 9 | int buttons; 10 | int impulse; 11 | float angles_x; 12 | float angles_y; 13 | float angles_z; 14 | int weapon; 15 | int subtype; 16 | int cmdnum; 17 | int tickcount; 18 | int seed; 19 | int mouse_x; 20 | int mouse_y; 21 | } 22 | 23 | // previoustick contains and enum stuck of the players previouse cmd tick. shotcount is the number of player ticks that have been recorded since the start of shooting 24 | 25 | forward void OnStartShooting(int client, cmd_t previoustick, cmd_t currenttick); 26 | forward void OnShooting(int client, int shotcount, cmd_t previoustick, cmd_t currenttick); 27 | forward void OnStopShooting(int client, int shotcount, cmd_t previoustick, cmd_t currenttick); -------------------------------------------------------------------------------- /include/sm_cpsaver.inc: -------------------------------------------------------------------------------- 1 | #if defined _sm_cpsaver_included 2 | #endinput 3 | #endif 4 | #define _sm_cpsaver_included 5 | 6 | public SharedPlugin:__pl_sm_cpsaver = 7 | { 8 | name = "sm_cpsaver", 9 | file = "sm_cpsaver.smx", 10 | #if defined REQUIRE_PLUGIN 11 | required = 1, 12 | #else 13 | required = 0, 14 | #endif 15 | }; 16 | 17 | /** 18 | * Clear saved checkpoints for client 19 | * 20 | * @param client Client index. 21 | * @noreturn 22 | * @error Invalid client index. 23 | */ 24 | native CheckpointSaver_ClearCheckpoints(client); 25 | 26 | public __pl_sm_cpsaver_SetNTVOptional() 27 | { 28 | MarkNativeAsOptional("CheckpointSaver_ClearCheckpoints"); 29 | } -------------------------------------------------------------------------------- /include/smac_wallhack.inc: -------------------------------------------------------------------------------- 1 | #if defined _smac_wallhack_included 2 | #endinput 3 | #endif 4 | #define _smac_wallhack_included 5 | 6 | /** 7 | * Sets whether to ignore a client from visibility tests. 8 | * Processing time for anti-wallhack will decrease with every ignored client. 9 | * 10 | * @param client Client index. 11 | * @param bIgnore If true, client will not undergo visibility tests. If false, results in default behavior. 12 | * @noreturn 13 | * @error If the client is not InGame or the index is invalid. 14 | */ 15 | native SMAC_WH_SetClientIgnore(client, bool:bIgnore); 16 | 17 | /** 18 | * Returns whether a client is ignored from visibility tests. 19 | * 20 | * @param client Client index. 21 | * @return True if client is ignored from visibility tests, false otherwise. 22 | * @error If the client is not connected or the index is invalid. 23 | */ 24 | native bool:SMAC_WH_GetClientIgnore(client); 25 | 26 | 27 | public SharedPlugin:__pl_smac_wallhack = 28 | { 29 | name = "smac_wallhack", 30 | file = "smac_wallhack.smx", 31 | #if defined REQUIRE_PLUGIN 32 | required = 1, 33 | #else 34 | required = 0, 35 | #endif 36 | }; 37 | 38 | #if !defined REQUIRE_PLUGIN 39 | public __pl_smac_wallhack_SetNTVOptional() 40 | { 41 | MarkNativeAsOptional("SMAC_WH_SetClientIgnore"); 42 | MarkNativeAsOptional("SMAC_WH_GetClientIgnore"); 43 | } 44 | #endif 45 | -------------------------------------------------------------------------------- /include/smlib.inc: -------------------------------------------------------------------------------- 1 | #if defined _smlib_included 2 | #endinput 3 | #endif 4 | #define _smlib_included 5 | 6 | #define SMLIB_VERSION "0.9.7" 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | //#include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | -------------------------------------------------------------------------------- /include/smlib/concommands.inc: -------------------------------------------------------------------------------- 1 | #if defined _smlib_concommands_included 2 | #endinput 3 | #endif 4 | #define _smlib_concommands_included 5 | 6 | #include 7 | #include 8 | 9 | /** 10 | * Checks if a ConCommand has one or more flags set. 11 | * 12 | * @param command ConCommand name. 13 | * @param flags Flags to check. 14 | * @return True if flags are set, false otherwise. 15 | */ 16 | stock bool ConCommand_HasFlags(const char[] command, const int flags) 17 | { 18 | return view_as(GetCommandFlags(command) & flags); 19 | } 20 | 21 | /** 22 | * Adds one or more flags to a ConCommand. 23 | * 24 | * @param command ConCommand name. 25 | * @param flags Flags to add. 26 | * @noreturn 27 | */ 28 | stock void ConCommand_AddFlags(const char[] command, const int flags) 29 | { 30 | int newFlags = GetCommandFlags(command); 31 | newFlags |= flags; 32 | SetCommandFlags(command, newFlags); 33 | } 34 | 35 | /** 36 | * Removes one ore more flags from a ConCommand. 37 | * 38 | * @param command ConCommand name. 39 | * @param flags Flags to remove 40 | * @noreturn 41 | */ 42 | stock void ConCommand_RemoveFlags(const char[] command, const int flags) 43 | { 44 | int newFlags = GetCommandFlags(command); 45 | newFlags &= ~flags; 46 | SetCommandFlags(command, newFlags); 47 | } 48 | -------------------------------------------------------------------------------- /include/smlib/convars.inc: -------------------------------------------------------------------------------- 1 | #if defined _smlib_convars_included 2 | #endinput 3 | #endif 4 | #define _smlib_convars_included 5 | 6 | #include 7 | 8 | /** 9 | * Checks if a ConVar has one or more flags set. 10 | * 11 | * @param convar ConVar Handle. 12 | * @param flags Flags to check. 13 | * @return True if flags are set, false otherwise. 14 | */ 15 | stock bool Convar_HasFlags(ConVar convar, int flags) 16 | { 17 | return view_as(convar.Flags & flags); 18 | } 19 | 20 | /** 21 | * Adds one or more flags to a ConVar. 22 | * 23 | * @param convar ConVar Handle. 24 | * @param flags Flags to add. 25 | * @noreturn 26 | */ 27 | stock void Convar_AddFlags(ConVar convar, int flags) 28 | { 29 | int newFlags = convar.Flags; 30 | newFlags |= flags; 31 | convar.Flags = newFlags; 32 | } 33 | 34 | /** 35 | * Removes one ore more flags from a ConVar. 36 | * 37 | * @param convar ConVar Handle. 38 | * @param flags Flags to remove 39 | * @noreturn 40 | */ 41 | stock void Convar_RemoveFlags(ConVar convar, int flags) 42 | { 43 | int newFlags = convar.Flags; 44 | newFlags &= ~flags; 45 | convar.Flags = newFlags; 46 | } 47 | 48 | /** 49 | * Checks if a String is a valid ConVar or 50 | * Console Command name. 51 | * 52 | * @param name String Name. 53 | * @return True if the name specified is a valid ConVar or console command name, false otherwise. 54 | */ 55 | stock bool Convar_IsValidName(const char[] name) 56 | { 57 | if (name[0] == '\0') { 58 | return false; 59 | } 60 | 61 | int n=0; 62 | while (name[n] != '\0') { 63 | 64 | if (!IsValidConVarChar(name[n])) { 65 | return false; 66 | } 67 | 68 | n++; 69 | } 70 | 71 | return true; 72 | } 73 | -------------------------------------------------------------------------------- /include/smlib/debug.inc: -------------------------------------------------------------------------------- 1 | #if defined _smlib_debug_included 2 | #endinput 3 | #endif 4 | #define _smlib_debug_included 5 | 6 | #include 7 | 8 | /** 9 | * Prints the values of a static Float-Array to the server console. 10 | * 11 | * @param array Static Float-Array. 12 | * @param size Size of the Array. 13 | * @noreturn 14 | */ 15 | stock void Debug_FloatArray(const float[] array, int size=3) 16 | { 17 | char output[64] = ""; 18 | 19 | for (int i=0; i < size; ++i) { 20 | 21 | if (i > 0 && i < size) { 22 | StrCat(output, sizeof(output), ", "); 23 | 24 | } 25 | 26 | Format(output, sizeof(output), "%s%f", output, array[i]); 27 | } 28 | 29 | PrintToServer("[DEBUG] Vector[%d] = { %s }", size, output); 30 | } 31 | -------------------------------------------------------------------------------- /include/smlib/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=This folder is shared online. 3 | IconFile=C:\Program Files\Google\Drive\googledrivesync.exe 4 | IconIndex=16 5 | -------------------------------------------------------------------------------- /include/smlib/dynarrays.inc: -------------------------------------------------------------------------------- 1 | #if defined _smlib_dynarray_included 2 | #endinput 3 | #endif 4 | #define _smlib_dynarray_included 5 | 6 | #include 7 | 8 | /** 9 | * Retrieves a cell value from an array. 10 | * This is a wrapper around the Sourcemod Function GetArrayCell, 11 | * but it casts the result as bool 12 | * 13 | * @param array ArrayList. 14 | * @param index Index in the array. 15 | * @param block Optionally specify which block to read from 16 | * (useful if the blocksize > 0). 17 | * @param asChar Optionally read as a byte instead of a cell. 18 | * @return Value read. 19 | * @error Invalid array, invalid index, or invalid block. 20 | */ 21 | stock bool DynArray_GetBool(ArrayList array, int index, int block=0, bool asChar=false) 22 | { 23 | return view_as(array.Get(index, block, asChar)); 24 | } 25 | -------------------------------------------------------------------------------- /include/smlib/game.inc: -------------------------------------------------------------------------------- 1 | #if defined _smlib_game_included 2 | #endinput 3 | #endif 4 | #define _smlib_game_included 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | /* 11 | * End's the game and displays the scoreboard with intermission time. 12 | * 13 | * @noparam 14 | * @return True on success, false otherwise 15 | */ 16 | stock bool Game_End() 17 | { 18 | int game_end = FindEntityByClassname(-1, "game_end"); 19 | 20 | if (game_end == -1) { 21 | game_end = CreateEntityByName("game_end"); 22 | 23 | if (game_end == -1) { 24 | ThrowError("Unable to find or create entity \"game_end\""); 25 | } 26 | } 27 | 28 | return AcceptEntityInput(game_end, "EndGame"); 29 | } 30 | 31 | /* 32 | * End's the current round, allows specifying the winning 33 | * team and more. 34 | * This function currently works in TF2 only (it uses the game_round_win entity). 35 | * 36 | * @param team The winning Team, pass 0 for Sudden Death mode (no winning team) 37 | * @param forceMapReset If to force the map to reset during the force respawn after the round is over. 38 | * @param switchTeams If to switch the teams when the game is going to be reset. 39 | * @return True on success, false otherwise 40 | */ 41 | stock bool Game_EndRound(int team=0, bool forceMapReset=false, bool switchTeams=false) 42 | { 43 | int game_round_win = FindEntityByClassname(-1, "game_round_win"); 44 | 45 | if (game_round_win == -1) { 46 | game_round_win = CreateEntityByName("game_round_win"); 47 | 48 | if (game_round_win == -1) { 49 | ThrowError("Unable to find or create entity \"game_round_win\""); 50 | } 51 | } 52 | 53 | DispatchKeyValue(game_round_win, "TeamNum" , (team ? "true" : "false")); 54 | DispatchKeyValue(game_round_win, "force_map_reset" , (forceMapReset? "true" : "false")); 55 | DispatchKeyValue(game_round_win, "switch_teams" , (switchTeams ? "true" : "false")); 56 | 57 | return AcceptEntityInput(game_round_win, "RoundWin"); 58 | } 59 | -------------------------------------------------------------------------------- /include/smlib/menus.inc: -------------------------------------------------------------------------------- 1 | #if defined _smlib_menus_included 2 | #endinput 3 | #endif 4 | #define _smlib_menus_included 5 | 6 | #include 7 | #include 8 | 9 | /** 10 | * Adds an option to a menu with a String display but an integer 11 | * identifying the option. 12 | * 13 | * @param menu Handle to the menu 14 | * @param value Integer value for the option 15 | * @param display Display text for the menu 16 | * @noreturn 17 | */ 18 | stock void Menu_AddIntItem(Menu menu, any value, char[] display) 19 | { 20 | char buffer[INT_MAX_DIGITS + 1]; 21 | IntToString(value, buffer, sizeof(buffer)); 22 | menu.AddItem(buffer, display); 23 | } 24 | 25 | /** 26 | * Retrieves an integer-value choice from a menu, where the 27 | * menu's information strings were created as integers. 28 | * 29 | * @param menu Handle to the menu 30 | * @param param2 The item position selected from the menu. 31 | * @return Integer choice from the menu, or 0 if the integer could not be parsed. 32 | */ 33 | stock any Menu_GetIntItem(Menu menu, any param2) 34 | { 35 | char buffer[INT_MAX_DIGITS + 1]; 36 | menu.GetItem(param2, buffer, sizeof(buffer)); 37 | return StringToInt(buffer); 38 | } 39 | -------------------------------------------------------------------------------- /include/smlib/world.inc: -------------------------------------------------------------------------------- 1 | #if defined _smlib_world_included 2 | #endinput 3 | #endif 4 | #define _smlib_world_included 5 | 6 | #include 7 | 8 | /* 9 | * Gets the world's max size 10 | * 11 | * @param vec Vector buffer 12 | * @noreturn 13 | */ 14 | stock void World_GetMaxs(float vec[3]) { 15 | 16 | GetEntPropVector(0, Prop_Data, "m_WorldMaxs", vec); 17 | } 18 | -------------------------------------------------------------------------------- /include/sourcebans.inc: -------------------------------------------------------------------------------- 1 | // ************************************************************************* 2 | // This file is part of SourceBans++. 3 | // 4 | // Copyright (C) 2014-2016 SourceBans++ Dev Team 5 | // 6 | // SourceBans++ is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, per version 3 of the License. 9 | // 10 | // SourceBans++ is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with SourceBans++. If not, see . 17 | // 18 | // This file based off work(s) covered by the following copyright(s): 19 | // 20 | // SourceBans 1.4.11 21 | // Copyright (C) 2007-2015 SourceBans Team - Part of GameConnect 22 | // Licensed under GNU GPL version 3, or later. 23 | // Page: - 24 | // 25 | // ************************************************************************* 26 | 27 | #if defined _sourcebans_included 28 | #endinput 29 | #endif 30 | #define _sourcebans_included 31 | 32 | public SharedPlugin:__pl_sourcebans = 33 | { 34 | name = "sourcebans", 35 | file = "sourcebans.smx", 36 | #if defined REQUIRE_PLUGIN 37 | required = 1 38 | #else 39 | required = 0 40 | #endif 41 | }; 42 | 43 | #if !defined REQUIRE_PLUGIN 44 | public __pl_sourcebans_SetNTVOptional() 45 | { 46 | MarkNativeAsOptional("SBBanPlayer"); 47 | } 48 | #endif 49 | 50 | 51 | /********************************************************* 52 | * Ban Player from server 53 | * 54 | * @param client The client index of the admin who is banning the client 55 | * @param target The client index of the player to ban 56 | * @param time The time to ban the player for (in minutes, 0 = permanent) 57 | * @param reason The reason to ban the player from the server 58 | * @noreturn 59 | *********************************************************/ 60 | native SBBanPlayer(client, target, time, String:reason[]); 61 | 62 | //Yarr! 63 | -------------------------------------------------------------------------------- /include/stocksoup/.gitattributes: -------------------------------------------------------------------------------- 1 | *.inc linguist-language=SourcePawn -------------------------------------------------------------------------------- /include/stocksoup/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore compiled SourceMod plugins 2 | 3 | *.smx -------------------------------------------------------------------------------- /include/stocksoup/client.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_client_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_client_included 6 | 7 | /** 8 | * Sets a client's overlay to the specified VMT file. Blank to remove the overlay. 9 | * 10 | * @param client Client to receive the overlay. 11 | * @param overlay Material to use as the overlay, specified relative to the "materials/" 12 | * directory. 13 | */ 14 | stock void SetClientScreenOverlay(int client, const char[] overlay = "") { 15 | ClientCommand(client, "r_screenoverlay \"%s\"", overlay); 16 | } -------------------------------------------------------------------------------- /include/stocksoup/datapack_frame.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_datapack_frame_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_datapack_frame_included 6 | 7 | typedef RequestDataFrameCallback = function void (DataPack data); 8 | 9 | /** 10 | * Creates a single-use next frame hook associated with a new datapack, and stores the datapack 11 | * in the by-ref parameter. 12 | * 13 | * @note Unlike CreateDataTimer, the datapack is *not* automatically freed when the timer ends. 14 | */ 15 | stock void RequestDataFrame(RequestDataFrameCallback callback, DataPack &data) { 16 | data = CreateDataPack(); 17 | 18 | // is this even intended 19 | RequestFrame(view_as(callback), data); 20 | } -------------------------------------------------------------------------------- /include/stocksoup/entity.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Entity property helpers. 3 | */ 4 | 5 | #if defined __stocksoup_entity_included 6 | #endinput 7 | #endif 8 | 9 | #define __stocksoup_entity_included 10 | 11 | #define COPYPROP_MAX_STRING_LENGTH 256 12 | 13 | /** 14 | * Assigns an integer value to the `dest` entity property from the `src` entity property. 15 | */ 16 | stock void CopyEntProp(int src, int dest, PropType type, const char[] prop, int size = 4, 17 | int element = 0) { 18 | SetEntProp(dest, type, prop, GetEntProp(src, type, prop, size, element), size, element); 19 | } 20 | 21 | /** 22 | * Assigns a float value to the `dest` entity property from the `src` entity property. 23 | */ 24 | stock void CopyEntPropFloat(int src, int dest, PropType type, const char[] prop, 25 | int element = 0) { 26 | SetEntPropFloat(dest, type, prop, (GetEntPropFloat(src, type, prop, element)), element); 27 | } 28 | 29 | /** 30 | * Assigns an entity index to the `dest` entity property from the `src` entity property. 31 | */ 32 | stock void CopyEntPropEnt(int src, int dest, PropType type, const char[] prop, 33 | int element = 0) { 34 | SetEntPropEnt(dest, type, prop, (GetEntPropEnt(src, type, prop, element)), element); 35 | } 36 | 37 | /** 38 | * Assigns a string value to the `dest` entity property from the `src` entity property. 39 | */ 40 | stock void CopyEntPropString(int src, int dest, PropType type, const char[] prop, 41 | int element = 0, int maxlen = COPYPROP_MAX_STRING_LENGTH) { 42 | char[] buffer = new char[maxlen]; 43 | GetEntPropString(src, type, prop, buffer, maxlen, element); 44 | SetEntPropString(dest, type, prop, buffer, element); 45 | } 46 | 47 | /** 48 | * Assigns a vector of floats to the `dest` entity property from the `src` entity property. 49 | */ 50 | stock void CopyEntPropVector(int src, int dest, PropType type, const char[] prop, 51 | int element = 0) { 52 | float vec[3]; 53 | GetEntPropVector(src, type, prop, vec, element); 54 | SetEntPropVector(dest, type, prop, vec, element); 55 | } 56 | -------------------------------------------------------------------------------- /include/stocksoup/entity_prefabs.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_entity_prefabs_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_entity_prefabs_included 6 | 7 | stock int CreateParticle(const char[] effectName) { 8 | int particle = CreateEntityByName("info_particle_system"); 9 | 10 | if (IsValidEdict(particle)) { 11 | DispatchKeyValue(particle, "effect_name", effectName); 12 | DispatchSpawn(particle); 13 | 14 | ActivateEntity(particle); 15 | AcceptEntityInput(particle, "start"); 16 | } 17 | return particle; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /include/stocksoup/files.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility stocks for files. 3 | */ 4 | #if defined __stocksoup_file_included 5 | #endinput 6 | #endif 7 | 8 | #define __stocksoup_file_included 9 | 10 | #include 11 | 12 | /** 13 | * Creates a directory, creating parent directories if they don't exist. 14 | * 15 | * @param path Path to create. Parent directories that do not exist are also created. 16 | * @param mode Permissions (default is o=rx,g=rx,u=rwx). Note that folders must have 17 | * the execute bit set on Linux. On Windows, the mode is ignored. 18 | * Nonexisting directories will be created with these permissions; existing 19 | * directories' permissions will not be modified. 20 | * @param use_valve_fs If true, the Valve file stem will be used instead. This can be used to 21 | * create folders in the game's Valve search paths, rather than directly in 22 | * the gamedir. 23 | * @param valve_path_id If use_valve_fs, a search path from gameinfo or NULL_STRING for default. 24 | * In this case, mode is ignored. 25 | */ 26 | stock bool CreateDirectories(const char[] path, int mode, bool use_valve_fs = false, 27 | const char[] valve_path_id = "DEFAULT_WRITE_PATH") { 28 | char partialPathBuffer[PLATFORM_MAX_PATH]; 29 | 30 | int p = -1; 31 | while ( (p = FindNextCharInString(p, path, '/')) != -1 ) { 32 | // exclude trailing forward slash 33 | strcopy(partialPathBuffer, p, path); 34 | 35 | if (!DirExists(partialPathBuffer, use_valve_fs, valve_path_id) 36 | && !CreateDirectory(partialPathBuffer, mode, use_valve_fs, valve_path_id)) { 37 | return false; 38 | } 39 | } 40 | 41 | // try to create the last directory in the path 42 | return DirExists(path, use_valve_fs, valve_path_id) || 43 | CreateDirectory(path, mode, use_valve_fs, valve_path_id); 44 | } 45 | -------------------------------------------------------------------------------- /include/stocksoup/handles.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * A few additional handle-related functions. 3 | */ 4 | 5 | #if defined __stocksoup_handles_included 6 | #endinput 7 | #endif 8 | 9 | #define __stocksoup_handles_included 10 | 11 | /** 12 | * Returns a clone of a handle with a new owner, deleting the existing one in the process. 13 | * The by-ref `hndl` argument is set to null. 14 | * 15 | * The return type is `any` to allow assignment without retagging for Handle derivatives. 16 | */ 17 | stock any MoveHandle(Handle &hndl, Handle plugin = INVALID_HANDLE) { 18 | Handle moved = CloneHandle(hndl, plugin); 19 | delete hndl; 20 | return moved; 21 | } 22 | 23 | /** 24 | * Returns a clone of a handle with a new owner, deleting the existing one in the process. 25 | * 26 | * This function is used for cases where the `hndl` argument is the return value of another 27 | * function call, in which case attempting to use `MoveHandle` results in an argument type 28 | * mismatch compile error. 29 | * 30 | * The return type is `any` to allow assignment without retagging for Handle derivatives. 31 | */ 32 | stock any MoveHandleImmediate(Handle hndl, Handle plugin = INVALID_HANDLE) { 33 | Handle moved = CloneHandle(hndl, plugin); 34 | CloseHandle(hndl); 35 | return moved; 36 | } 37 | -------------------------------------------------------------------------------- /include/stocksoup/log_server.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_log_server_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_log_server_included 6 | 7 | // Change the maximum length of the message if desired. 8 | #if !defined LOG_SERVER_MESSAGE_MAXLEN 9 | #define LOG_SERVER_MESSAGE_MAXLEN 1024 10 | #endif 11 | 12 | #if !defined LOG_SERVER_DEFINED 13 | #define LOG_SERVER_DEFINED 14 | #endif 15 | 16 | /** 17 | * Prints a plugin message to the server console. The log message will be prefixed by the 18 | * plugin's logtag (filename). 19 | * 20 | * If LOG_SERVER_DISABLE is defined before this file is included, treat this function as a 21 | * no-op. 22 | * 23 | * @param format String format. 24 | * @param any Format arguments. 25 | */ 26 | stock void LogServer(const char[] format, any ...) { 27 | #if !defined LOG_SERVER_DISABLE 28 | char message[LOG_SERVER_MESSAGE_MAXLEN], pluginName[PLATFORM_MAX_PATH], dateTime[64]; 29 | 30 | VFormat(message, sizeof(message), format, 2); 31 | GetPluginFilename(INVALID_HANDLE, pluginName, sizeof(pluginName)); 32 | FormatTime(dateTime, sizeof(dateTime), NULL_STRING); 33 | 34 | PrintToServer("- %s: [%s] %s", dateTime, pluginName, message); 35 | #endif 36 | } 37 | -------------------------------------------------------------------------------- /include/stocksoup/maps.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Function stock to deal with maps and map names. 3 | */ 4 | 5 | #if defined __stocksoup_maps_included 6 | #endinput 7 | #endif 8 | 9 | #define __stocksoup_maps_included 10 | 11 | /** 12 | * Returns the workshop ID for the specified full map path, or 0 if the map does not have a 13 | * workshop ID. 14 | */ 15 | stock int GetMapWorkshopID(const char[] fullMapName) { 16 | EngineVersion currentGame = GetEngineVersion(); 17 | if (StrContains(fullMapName, "workshop/") == 0) { 18 | if (currentGame == Engine_TF2) { 19 | if (StrContains(fullMapName, ".ugc") > -1 ) { 20 | // workshop/some_map_name.ugc123456789 21 | return StringToInt( fullMapName[ StrContains(fullMapName, ".ugc") + 4 ] ); 22 | } else { 23 | // workshop/123456789 24 | return StringToInt( fullMapName[ StrContains(fullMapName, "/") + 1 ] ); 25 | } 26 | } 27 | // TODO other formats for workshop map names 28 | if (currentGame == Engine_CSGO) { 29 | // workshop/123456789/some_map_name ? 30 | int id; 31 | 32 | StringToIntEx(fullMapName[FindCharInString(fullMapName, '/') + 1], id); 33 | return id; 34 | } 35 | } 36 | return 0; 37 | } 38 | 39 | /** 40 | * Returns the current map's display name. 41 | */ 42 | stock bool GetCurrentMapDisplayName(char[] buffer, int maxlen) { 43 | GetCurrentMap(buffer, maxlen); 44 | return GetMapDisplayName(buffer, buffer, maxlen); 45 | } 46 | -------------------------------------------------------------------------------- /include/stocksoup/memory.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility functions for dealing with memory. 3 | */ 4 | 5 | #if defined __stocksoup_memory_included 6 | #endinput 7 | #endif 8 | 9 | #define __stocksoup_memory_included 10 | 11 | /** 12 | * Loads a null-terminated string from the given address. 13 | * 14 | * The function will return an empty string if the address corresponds to a nullptr. This 15 | * functionality is present as a workaround for when an SDKCall that expects a char pointer 16 | * receives a nullptr and attempts to dereference it (see alliedmodders/sourcemod/issues/874). 17 | * 18 | * If it is necessary to differentiate between an empty string and a null pointer, check if addr 19 | * is null before calling the function, or pass a reference to bIsNullPointer. 20 | * 21 | * @return Number of bytes written. 0 is returned on an empty string or a null pointer. 22 | */ 23 | stock int LoadStringFromAddress(Address addr, char[] buffer, int maxlen, 24 | bool &bIsNullPointer = false) { 25 | if (!addr) { 26 | bIsNullPointer = true; 27 | return 0; 28 | } 29 | 30 | int c; 31 | char ch; 32 | do { 33 | ch = LoadFromAddress(addr + view_as
(c), NumberType_Int8); 34 | buffer[c] = ch; 35 | } while (ch && ++c < maxlen - 1); 36 | return c; 37 | } 38 | 39 | /** 40 | * Reads a value stored in a memory address and returns it as an address. 41 | */ 42 | stock Address DereferencePointer(Address addr) { 43 | // maybe someday we'll do 64-bit addresses 44 | return view_as
(LoadFromAddress(addr, NumberType_Int32)); 45 | } 46 | -------------------------------------------------------------------------------- /include/stocksoup/sdkports/player.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility functions ported over from the Source SDK (baseplayer_shared.cpp). 3 | */ 4 | 5 | #if defined __stocksoup_sdkports_player_included 6 | #endinput 7 | #endif 8 | 9 | #define __stocksoup_sdkports_player_included 10 | 11 | /** 12 | * Adds another punch angle to the player view. 13 | * 14 | * Equivalent to CBasePlayer::ViewPunch(const QAngle &angleOffset)??? 15 | */ 16 | stock void AddPlayerViewPunch(int client, const float vecAngleOffset[3]) { 17 | float vecAnglePlayer[3], vecAngleAdditive[3]; 18 | 19 | GetEntPropVector(client, Prop_Data, "m_vecPunchAngleVel", vecAnglePlayer); 20 | 21 | // (copy angleOffset for modification) 22 | AddVectors(vecAngleOffset, NULL_VECTOR, vecAngleAdditive); 23 | 24 | // angleOffset *= 20 (???) 25 | ScaleVector(vecAngleAdditive, 20.0); 26 | 27 | // m_vecPunchAngleVel += angleOffset 28 | AddVectors(vecAnglePlayer, vecAngleAdditive, vecAnglePlayer); 29 | 30 | SetEntPropVector(client, Prop_Data, "m_vecPunchAngleVel", vecAnglePlayer); 31 | } 32 | 33 | /** 34 | * Sets the FOV of the client, doing interpolation between old and new if requested. 35 | * 36 | * (Difference from SDK implementation: The zoom owner isn't required, and there are no checks 37 | * to ensure that the requester can override the owner). 38 | */ 39 | stock bool SetPlayerFOV(int client, int fov, float zoomRate, int zoomStart = 0, 40 | int requester = -1) { 41 | if (requester > -1 && IsValidEntity(requester)) { 42 | SetEntProp(client, Prop_Data, "m_hZoomOwner", requester); 43 | } 44 | 45 | if (zoomStart > 0) { 46 | SetEntProp(client, Prop_Data, "m_iFOVStart", zoomStart); 47 | } else { 48 | SetEntProp(client, Prop_Data, "m_iFOVStart", GetPlayerFOV(client)); 49 | } 50 | 51 | SetEntProp(client, Prop_Data, "m_iFOV", fov); 52 | SetEntPropFloat(client, Prop_Data, "m_flFOVRate", zoomRate); 53 | 54 | return true; 55 | } 56 | 57 | stock int GetPlayerFOV(int client) { 58 | return GetEntProp(client, Prop_Data, "m_iFOV"); 59 | } -------------------------------------------------------------------------------- /include/stocksoup/sdkports/util.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_sdkports_util_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_sdkports_util_included 6 | 7 | /* Utility functions ported over from the Source SDK (util.cpp). */ 8 | 9 | /* Accurate screenfade implementation from Valve below. */ 10 | #define SCREENFADE_FRACBITS 9 11 | #define FFADE_IN 0x0001 // Just here so we don't pass 0 into the function 12 | #define FFADE_OUT 0x0002 // Fade out (not in) 13 | #define FFADE_MODULATE 0x0004 // Modulate (don't blend) 14 | #define FFADE_STAYOUT 0x0008 // ignores the duration, stays faded out until new ScreenFade message received 15 | #define FFADE_PURGE 0x0010 // Purges all other fades, replacing them with this one 16 | 17 | stock void UTIL_ScreenFade(int target, const int color[4], float flDuration, float flHoldTime, 18 | int flags = FFADE_IN) { 19 | UserMsg s_fadeUserMsgId = GetUserMessageId("Fade"); 20 | int targets[1]; 21 | targets[0] = target; 22 | 23 | int duration = FixedUnsigned16(flDuration, 1 << SCREENFADE_FRACBITS); 24 | int holdtime = FixedUnsigned16(flHoldTime, 1 << SCREENFADE_FRACBITS); 25 | 26 | Handle message = StartMessageEx(s_fadeUserMsgId, targets, 1); 27 | if (GetUserMessageType() == UM_Protobuf) { 28 | PbSetInt(message, "duration", duration); 29 | PbSetInt(message, "hold_time", holdtime); 30 | PbSetInt(message, "flags", flags); 31 | PbSetColor(message, "clr", color); 32 | } else { 33 | BfWriteShort(message, duration); 34 | BfWriteShort(message, holdtime); 35 | BfWriteShort(message, flags); 36 | BfWriteByte(message, color[0]); 37 | BfWriteByte(message, color[1]); 38 | BfWriteByte(message, color[2]); 39 | BfWriteByte(message, color[3]); 40 | } 41 | 42 | EndMessage(); 43 | } 44 | 45 | stock int FixedUnsigned16(float value, int scale) { 46 | int output = RoundFloat(value * scale); 47 | if (output < 0) { 48 | output = 0; 49 | } 50 | if (output > 0xFFFF) { 51 | output = 0xFFFF; 52 | } 53 | return output; 54 | } 55 | -------------------------------------------------------------------------------- /include/stocksoup/sdkports/vector.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_sdkports_vector_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_sdkports_vector_included 6 | 7 | /** 8 | * Checks if a point is in the field of view of an object. Supports up to 180 degree FOV. 9 | * I forgot how the dot product stuff works. 10 | * 11 | * Direct port of the function of the same name from the Source SDK: 12 | * https://github.com/ValveSoftware/source-sdk-2013/blob/beaae8ac45a2f322a792404092d4482065bef7ef/sp/src/public/mathlib/vector.h#L461-L477 13 | * 14 | * @param vecSrcPosition Source position of the view. 15 | * @param vecTargetPosition Point to check if within view angle. 16 | * @param vecLookDirection The direction to look towards. Note that this must be a forward 17 | * angle vector. 18 | * @param flCosHalfFOV The width of the forward view cone as a dot product result. For 19 | * subclasses of CBaseCombatCharacter, you can use the 20 | * `m_flFieldOfView` data property. To manually calculate for a 21 | * desired FOV, use `cos(0.5 * FOV)`. 22 | * @return True if the point is within view from the source position at the 23 | * specified FOV. 24 | */ 25 | stock bool PointWithinViewAngle(const float vecSrcPosition[3], const float vecTargetPosition[3], 26 | const float vecLookDirection[3], float flCosHalfFOV) { 27 | float vecDelta[3]; 28 | 29 | SubtractVectors(vecTargetPosition, vecSrcPosition, vecDelta); 30 | 31 | float cosDiff = GetVectorDotProduct(vecLookDirection, vecDelta); 32 | 33 | if (cosDiff < 0.0) { 34 | return false; 35 | } 36 | 37 | float flLen2 = GetVectorLength(vecDelta, true); 38 | 39 | // a/sqrt(b) > c == a^2 > b * c ^2 40 | return ( cosDiff * cosDiff >= flLen2 * flCosHalfFOV * flCosHalfFOV ); 41 | } 42 | -------------------------------------------------------------------------------- /include/stocksoup/testing.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_testing_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_testing_included 6 | 7 | #include 8 | 9 | static int s_nTests; 10 | static char s_Context[256]; 11 | 12 | stock void SetTestContext(const char[] context) { 13 | strcopy(s_Context, sizeof(s_Context), context); 14 | } 15 | 16 | stock void AssertEq(const char[] text, any value, any expected) { 17 | int nTest = BeginNextTest(); 18 | 19 | if (value == expected) { 20 | LogServer("[%d] %s: %s == %d OK", nTest, s_Context, text, expected); 21 | } else { 22 | LogServer("[%d] %s: %s != %d (got %d) FAIL", nTest, s_Context, text, expected, value); 23 | ThrowError("test %d (%s in %s) failed", nTest, text, s_Context); 24 | } 25 | } 26 | 27 | stock void AssertTrue(const char[] text, bool value) { 28 | AssertEqBool(text, value, true); 29 | } 30 | 31 | stock void AssertFalse(const char[] text, bool value) { 32 | AssertEqBool(text, value, false); 33 | } 34 | 35 | stock void AssertEqBool(const char[] text, bool value, bool expected) { 36 | int nTest = BeginNextTest(); 37 | 38 | if (value == expected) { 39 | LogServer("[%d] %s: %s == %s OK", nTest, s_Context, text, expected? "true" : "false"); 40 | } else { 41 | LogServer("[%d] %s: %s != %s FAIL", nTest, s_Context, text, expected? "true" : "false", value); 42 | ThrowError("test %d (%s in %s) failed", nTest, text, s_Context); 43 | } 44 | } 45 | 46 | stock void AssertStrEq(const char[] text, const char[] value, const char[] expected) { 47 | int nTest = BeginNextTest(); 48 | 49 | if (StrEqual(value, expected)) { 50 | LogServer("[%d] %s: %s == %s OK", nTest, s_Context, text, expected); 51 | } else { 52 | LogServer("[%d] %s: %s != %s (got %s) FAIL", nTest, s_Context, text, expected, value); 53 | ThrowError("test %d (%s in %s) failed", nTest, text, s_Context); 54 | } 55 | } 56 | 57 | stock int BeginNextTest() { 58 | return ++s_nTests; 59 | } 60 | 61 | stock int GetCurrentTest() { 62 | return s_nTests; 63 | } -------------------------------------------------------------------------------- /include/stocksoup/tf/client.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides stocks for client (i.e., the game with a human controlling the character) functions. 3 | */ 4 | 5 | #if defined __stocksoup_tf_client_included 6 | #endinput 7 | #endif 8 | 9 | #define __stocksoup_tf_client_included 10 | 11 | #include 12 | #include 13 | 14 | /** 15 | * Sets a client's overlay to the appropriate team's invulnerability overlay. 16 | * 17 | * @param client Client to receive the overlay. 18 | */ 19 | stock void TF2_SetClientUberchargeOverlay(int client) { 20 | TFTeam team = TF2_GetClientTeam(client); 21 | switch (team) { 22 | case TFTeam_Red: { 23 | SetClientScreenOverlay(client, "effects/invuln_overlay_red"); 24 | } 25 | case TFTeam_Blue: { 26 | SetClientScreenOverlay(client, "effects/invuln_overlay_blue"); 27 | } 28 | } 29 | } 30 | 31 | /** 32 | * Displays the class selection screen to a client. 33 | * 34 | * @param client Client to display the class selection panel on. 35 | */ 36 | stock void TF2_ShowClassSelectPanel(int client) { 37 | TFTeam team = TF2_GetClientTeam(client); 38 | 39 | ShowVGUIPanel(client, team == TFTeam_Blue ? "class_blue" : "class_red"); 40 | } 41 | 42 | /** 43 | * Hides the post-round winning team panel on a given list of clients. 44 | * 45 | * Based off of CTFWinPanel:FireGameEvent(): 46 | * https://github.com/LestaD/SourceEngine2007/blob/master/se2007/game/client/tf/tf_hud_winpanel.cpp#L103 47 | * 48 | * When a client receives the `teamplay_round_start` event, it hides the win panel. 49 | * `teamplay_game_over` and `tf_game_over` may also possibly work, though I didn't bother 50 | * checking since it's likely they do other stuff on the client (like showing other panels or 51 | * something). 52 | * 53 | * @param clients Array of client indices. 54 | * @param numClients Number of clients in the array. 55 | */ 56 | stock void TF2_HideWinPanel(const int[] clients, int numClients) { 57 | RoundState state = GameRules_GetRoundState(); 58 | if (state == RoundState_TeamWin && numClients) { 59 | Event event = CreateEvent("teamplay_round_start", true); 60 | 61 | #if SOURCEMOD_V_MAJOR > 1 || (SOURCEMOD_V_MAJOR == 1 && SOURCEMOD_V_MINOR > 8) 62 | // avoid broadcasting event; disabling broadcasts on 1.8 throws an error 63 | event.BroadcastDisabled = true; 64 | #endif 65 | 66 | for (int i = 0; i < numClients; i++) { 67 | event.FireToClient(clients[i]); 68 | } 69 | 70 | delete event; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /include/stocksoup/tf/community_modes.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides some detection for certain odd game modes. 3 | * 4 | * For general detection, I'd recommend Powerlord's `tf2_morestocks` collection: 5 | * https://github.com/powerlord/sourcemod-snippets/blob/master/scripting/include/tf2_morestocks.inc 6 | */ 7 | #if defined __stocksoup_tf_community_modes_included 8 | #endinput 9 | #endif 10 | 11 | #define __stocksoup_tf_community_modes_included 12 | 13 | #include 14 | 15 | /** 16 | * Checks if the map uses a known variant of 2-Team Payload, a.k.a. Tug-of-War Payload. 17 | * 18 | * This is a symmetrical game mode where both teams attempt to push a neutral Payload cart from 19 | * the center of the map to the enemy's base. 20 | */ 21 | stock bool TF2_IsGameMode2TPL() { 22 | char target[64]; 23 | 24 | // Not even Payload 25 | if (FindEntityByClassname(-1, "func_tracktrain") < 0) { 26 | return false; 27 | } 28 | 29 | // Detection for Fubar's prefab (used in Effigy) 30 | { 31 | int gameRules = -1; 32 | while ( (gameRules = FindEntityByClassname(gameRules, "tf_gamerules")) != -1 ) { 33 | GetEntityTargetName(gameRules, target, sizeof(target)); 34 | if (StrEqual(target, "tug_gamerules")) { 35 | return true; 36 | } 37 | } 38 | } 39 | 40 | // Detection for Icarus's prefab (used in Waste) 41 | // Also publicly available: http://tf2.gamebanana.com/prefabs/3527 42 | { 43 | bool bRedTriggerFound, bBlueTriggerFound; 44 | 45 | int trigger = -1; 46 | while ( (trigger = FindEntityByClassname(trigger, "trigger_capture_area")) != -1) { 47 | GetEntityTargetName(trigger, target, sizeof(target)); 48 | bBlueTriggerFound |= StrEqual(target, "Trigger_BLUCart"); 49 | bRedTriggerFound |= StrEqual(target, "Trigger_REDCart"); 50 | } 51 | 52 | if (bBlueTriggerFound && bRedTriggerFound) { 53 | return true; 54 | } 55 | } 56 | 57 | // Detection based on the `2tpl_` map prefix 58 | { 59 | char mapPrefix[8], currentMap[PLATFORM_MAX_PATH]; 60 | GetCurrentMap(currentMap, sizeof(currentMap)); 61 | GetMapDisplayName(currentMap, mapPrefix, sizeof(mapPrefix)); 62 | 63 | if (StrContains(mapPrefix, "2tpl_", false) == 0) { 64 | return true; 65 | } 66 | } 67 | 68 | return false; 69 | } 70 | -------------------------------------------------------------------------------- /include/stocksoup/tf/econ.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_tf_econ_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_tf_econ_included 6 | 7 | // defindex used for wearables not in the schema (medic's backpack, etc.) 8 | #define DEFINDEX_UNDEFINED 65535 9 | 10 | /** 11 | * Returns an item's definition index. 12 | */ 13 | stock int TF2_GetItemDefinitionIndex(int entity) { 14 | return GetEntProp(entity, Prop_Send, "m_iItemDefinitionIndex"); 15 | } 16 | 17 | /** 18 | * Returns an item's definition index. 19 | * 20 | * On invalid entities and entities that are not items, this returns DEFINDEX_UNDEFINED instead 21 | * of generating a runtime exception. 22 | */ 23 | stock int TF2_GetItemDefinitionIndexSafe(int entity) { 24 | if (!IsVAlidEntity(entity) || !HasEntProp(entity, Prop_Send, "m_iItemDefinitionIndex")) { 25 | return DEFINDEX_UNDEFINED; 26 | } 27 | return TF2_GetItemDefinitionIndex(entity); 28 | } 29 | 30 | /** 31 | * Creates a wearable entity. 32 | * 33 | * Wearables spawned via this method and equipped on human players are not visible to other 34 | * human players due to economy rules. You're on your own there. 35 | * 36 | * If defindex is set to DEFINDEX_UNDEFINED, the item is not initialized, and no quality or 37 | * level is applied. 38 | * 39 | * @param defindex Wearable definition index. 40 | * @param quality Wearable quality. 41 | * @param level Wearable level. 42 | */ 43 | stock int TF2_SpawnWearable(int defindex = DEFINDEX_UNDEFINED, int quality = 6, int level = 1) { 44 | int wearable = CreateEntityByName("tf_wearable"); 45 | 46 | if (IsValidEntity(wearable)) { 47 | SetEntProp(wearable, Prop_Send, "m_iItemDefinitionIndex", defindex); 48 | 49 | if (defindex != DEFINDEX_UNDEFINED) { 50 | // using defindex of a valid item 51 | SetEntProp(wearable, Prop_Send, "m_bInitialized", 1); 52 | 53 | SetEntProp(wearable, Prop_Send, "m_iEntityLevel", level); 54 | 55 | // Something about m_iEntityQuality doesn't play nice with SetEntProp. 56 | SetEntData(wearable, FindSendPropInfo("CTFWearable", "m_iEntityQuality"), quality); 57 | } 58 | 59 | // Spawn. 60 | DispatchSpawn(wearable); 61 | } 62 | return wearable; 63 | } 64 | -------------------------------------------------------------------------------- /include/stocksoup/tf/enum/bot_skills.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * A list of bot difficulties in Team Fortress 2, as well as getters and setters for them. 3 | */ 4 | 5 | #if defined __stocksoup_tf_enum_bot_skills_included 6 | #endinput 7 | #endif 8 | 9 | #define __stocksoup_tf_enum_bot_skills_included 10 | 11 | enum TFBotSkill { 12 | Skill_Easy = 0, 13 | Skill_Normal, 14 | Skill_Hard, 15 | Skill_Expert 16 | }; 17 | 18 | /** 19 | * Returns the bot's current skill level. 20 | */ 21 | stock TFBotSkill TF2_GetBotSkill(int client) { 22 | return view_as(GetEntProp(client, Prop_Send, "m_nBotSkill")); 23 | } 24 | 25 | /** 26 | * @deprecated Function doesn't actually work. 27 | * As it turns out, the `m_nBotSkill` netprop is seemingly only visual -- the underlying skill 28 | * value is not a net / data prop and cannot be set the same way. 29 | * 30 | * Actual possibly consistent offset value is available at CTFBotMainAction::Dodge()+E or 31 | * CTFBotVision::GetMinRecognizeTime()+2B (among other areas). 32 | */ 33 | #pragma deprecated Function does not actually work. 34 | stock void TF2_SetBotSkill(int client, TFBotSkill skill) { 35 | SetEntProp(client, Prop_Send, "m_nBotSkill", view_as(skill)); 36 | } 37 | -------------------------------------------------------------------------------- /include/stocksoup/tf/enum/charge_resist_types.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_tf_enum_charge_resist_types_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_tf_enum_charge_resist_types_included 6 | 7 | enum TFChargeResistType { 8 | /** 9 | * Not a valid resistance value; use in user-defined functions that may not have an 10 | * applicable resistance type (e.g., melee, generic damage). 11 | */ 12 | Resist_None = -1, 13 | 14 | Resist_Bullet = 0, 15 | Resist_Blast, 16 | Resist_Fire 17 | }; -------------------------------------------------------------------------------- /include/stocksoup/tf/enum/spells.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides an enumerable definition of TF2 spellbook spells, as well as stocks for getting / 3 | * setting spell type and number of charges. 4 | */ 5 | 6 | #if defined __stocksoup_tf_enum_spells_included 7 | #endinput 8 | #endif 9 | 10 | #define __stocksoup_tf_enum_spells_included 11 | 12 | #include 13 | 14 | /** 15 | * Names based off the corresponding localization strings in resource/tf_english.txt 16 | */ 17 | enum TFSpellType { 18 | TFSpell_Invalid = -1, 19 | TFSpell_Fireball = 0, 20 | TFSpell_Bats, 21 | TFSpell_OverHeal, 22 | TFSpell_MIRV, 23 | TFSpell_BlastJump, 24 | TFSpell_Stealth, 25 | TFSpell_Teleport, 26 | TFSpell_LightningBall, 27 | TFSpell_Athletic, 28 | TFSpell_Meteor, 29 | TFSpell_SpawnBoss, 30 | TFSpell_SkeletonHorde 31 | }; 32 | 33 | stock TFSpellType TF2_GetPlayerSpellType(int client) { 34 | int spellbook = TF2_GetPlayerSpellBook(client); 35 | if (IsValidEntity(spellbook)) { 36 | TFSpellType spell = GetEntProp(spellbook, Prop_Send, "m_iSelectedSpellIndex"); 37 | return (spell && spell < TFSpellType)? spell : TFSpell_Invalid; 38 | } 39 | return TFSpell_Invalid; 40 | } 41 | 42 | stock bool TF2_SetPlayerSpellType(int client, TFSpellType spell) { 43 | int spellbook = TF2_GetPlayerSpellBook(client); 44 | if (IsValidEntity(spellbook)) { 45 | SetEntProp(spellbook, Prop_Send, "m_iSelectedSpellIndex", spell); 46 | return true; 47 | } 48 | return false; 49 | } 50 | 51 | stock int TF2_GetPlayerSpellCharges(int client) { 52 | int spellbook = TF2_GetPlayerSpellBook(client); 53 | if (IsValidEntity(spellbook)) { 54 | return GetEntProp(spellbook, Prop_Send, "m_iSpellCharges"); 55 | } 56 | return 0; 57 | } 58 | 59 | stock int TF2_SetPlayerSpellCharges(int client, int count) { 60 | int spellbook = TF2_GetPlayerSpellBook(client); 61 | if (IsValidEntity(spellbook)) { 62 | SetEntProp(spellbook, Prop_Send, "m_iSpellCharges", count); 63 | return true; 64 | } 65 | return false; 66 | } 67 | 68 | stock int TF2_GetPlayerSpellBook(int client) { 69 | int spellbook = -1; 70 | while ((spellbook = FindEntityByClassname(spellbook, "tf_weapon_spellbook")) != -1) { 71 | if (GetEntPropEnt(spellbook, Prop_Send, "m_hOwnerEntity") == client 72 | && !GetEntProp(spellbook, Prop_Send, "m_bDisguiseWeapon")) { 73 | return spellbook; 74 | } 75 | } 76 | return INVALID_ENT_REFERENCE; 77 | } 78 | -------------------------------------------------------------------------------- /include/stocksoup/tf/hud_notify.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides stocks that deal with user messages. 3 | */ 4 | 5 | #if defined __stocksoup_tf_hud_notify_included 6 | #endinput 7 | #endif 8 | 9 | #define __stocksoup_tf_hud_notify_included 10 | 11 | #include 12 | 13 | stock void TF_HudNotifyCustom(int client, const char[] icon, TFTeam team, const char[] format, 14 | any ...) { 15 | if (client <= 0 || client > MaxClients) { 16 | ThrowError("Invalid client index %d", client); 17 | } else if (!IsClientInGame(client)) { 18 | ThrowError("Client %d is not in game", client); 19 | } 20 | 21 | char buffer[256]; 22 | VFormat(buffer, sizeof(buffer), format, 5); 23 | 24 | TF_HudNotifyCustomParams(view_as(StartMessageOne("HudNotifyCustom", client)), 25 | buffer, icon, team); 26 | } 27 | 28 | stock void TF_HudNotifyCustomParams(BfWrite bitbuf, const char[] message, const char[] icon, 29 | TFTeam team) { 30 | bitbuf.WriteString(message); 31 | bitbuf.WriteString(icon); 32 | bitbuf.WriteByte(view_as(team)); 33 | 34 | EndMessage(); 35 | } -------------------------------------------------------------------------------- /include/stocksoup/tf/player.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides stocks that deal with player entities. 3 | */ 4 | 5 | #if defined __stocksoup_tf_player_included 6 | #endinput 7 | #endif 8 | 9 | #define __stocksoup_tf_player_included 10 | 11 | /** 12 | * Attempts to heal player by the specified amount. Also provides functionality to visually 13 | * indicate to players that they have been healed. 14 | * 15 | * @return true if the player was successfully (over) healed, false if no heals were applied 16 | */ 17 | stock bool TF2_HealPlayer(int client, int nHealAmount, bool overheal = false, 18 | bool notify = false) { 19 | if (IsPlayerAlive(client)) { 20 | int nHealth = GetClientHealth(client); 21 | int nMaxHealth = TF2_GetPlayerMaxHealth(client); 22 | 23 | // cap heals to max health 24 | if (!overheal && nHealAmount > nMaxHealth - nHealth) { 25 | nHealAmount = nMaxHealth - nHealth; 26 | } 27 | 28 | if (nHealAmount > 0) { 29 | SetEntityHealth(client, nHealth + nHealAmount); 30 | 31 | // player health HUD notification 32 | if (notify) { 33 | Event event = CreateEvent("player_healonhit"); 34 | if (event) { 35 | event.SetInt("amount", nHealAmount); 36 | event.SetInt("entindex", client); 37 | 38 | event.FireToClient(client); 39 | delete event; 40 | } 41 | } 42 | 43 | return true; 44 | } 45 | } 46 | return false; 47 | } 48 | 49 | /** 50 | * Returns the current maximum amount of health that a player can have. 51 | */ 52 | stock int TF2_GetPlayerMaxHealth(int client) { 53 | return GetEntProp(GetPlayerResourceEntity(), Prop_Send, "m_iMaxHealth", _, client); 54 | } 55 | -------------------------------------------------------------------------------- /include/stocksoup/tf/set_round_winner.inc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | stock bool TF2_SetRoundWinner(TFTeam team) { 4 | int roundWinEntity = FindEntityByClassname(-1, "game_round_win"); 5 | 6 | if (roundWinEntity < 1) { 7 | roundWinEntity = CreateEntityByName("game_round_win"); 8 | 9 | if (IsValidEntity(roundWinEntity)) { 10 | DispatchSpawn(roundWinEntity); 11 | } 12 | } 13 | 14 | if (IsValidEntity(roundWinEntity)) { 15 | DispatchSpawn(roundWinEntity); 16 | 17 | if (team == TFTeam_Spectator) { 18 | team = TFTeam_Unassigned; 19 | } 20 | SetVariantInt(view_as(team)); 21 | AcceptEntityInput(roundWinEntity, "SetTeam"); 22 | AcceptEntityInput(roundWinEntity, "RoundWin"); 23 | return true; 24 | } 25 | return false; 26 | } -------------------------------------------------------------------------------- /include/stocksoup/tf/teams.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_tf_teams_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_tf_teams_included 6 | 7 | #include 8 | #include 9 | 10 | enum TFTeamRoles { 11 | TFTeamRole_Undefined = 0, 12 | TFTeamRole_Defenders, 13 | TFTeamRole_Attackers 14 | }; 15 | 16 | /** 17 | * Returns the role associated with the given team. 18 | */ 19 | stock TFTeamRoles TF2_GetTeamRole(TFTeam team) { 20 | int teamEntity = TF2_GetTeamEntity(team); 21 | if (IsValidEntity(teamEntity)) { 22 | return view_as(GetEntProp(teamEntity, Prop_Send, "m_iRole")); 23 | } 24 | return TFTeamRole_Undefined; 25 | } 26 | 27 | /** 28 | * Returns the `tf_team` entity associated with a team. 29 | */ 30 | stock int TF2_GetTeamEntity(TFTeam team) { 31 | int teamEntity = -1; 32 | while ((teamEntity = FindEntityByClassname(teamEntity, "tf_team")) != -1) { 33 | if (team == view_as(GetEntProp(teamEntity, Prop_Send, "m_iTeamNum"))) { 34 | return teamEntity; 35 | } 36 | } 37 | return INVALID_ENT_REFERENCE; 38 | } -------------------------------------------------------------------------------- /include/stocksoup/value_remap.inc: -------------------------------------------------------------------------------- 1 | #if defined __stocksoup_value_remap_included 2 | #endinput 3 | #endif 4 | 5 | #define __stocksoup_value_remap_included 6 | 7 | /** 8 | * Remaps an input value such that the distance between it and its input bounds is proportional 9 | * to the output value and its output bounds. 10 | * 11 | * Unless it's clamped, in which case the output value is clamped to the output bounds. 12 | * 13 | * I can't figure out the proper term for this, so "remapping" it will have to do. 14 | */ 15 | stock float RemapValueFloat(float inputBounds[2], float outputBounds[2], float input, 16 | bool clamp = false) { 17 | float inputDelta, outputDelta, inputValueDelta, delta; 18 | 19 | inputDelta = inputBounds[1] - inputBounds[0]; 20 | outputDelta = outputBounds[1] - outputBounds[0]; 21 | 22 | inputValueDelta = (input - inputBounds[0]); 23 | delta = inputValueDelta / inputDelta; 24 | 25 | if (clamp) { 26 | delta = delta > 1.0 ? 1.0 : delta; 27 | delta = delta < 0.0 ? 0.0 : delta; 28 | } 29 | 30 | return outputBounds[0] + (outputDelta * delta); 31 | } 32 | 33 | /** 34 | * Wrapper for RemapValueFloat to deal with integer values. 35 | */ 36 | stock int RemapValue(int inputBounds[2], int outputBounds[2], int input, bool clamp = false) { 37 | float flInputBounds[2], flOutputBounds[2], flInput; 38 | 39 | flInputBounds[0] = float(inputBounds[0]); 40 | flInputBounds[1] = float(inputBounds[1]); 41 | 42 | flOutputBounds[0] = float(outputBounds[0]); 43 | flOutputBounds[1] = float(outputBounds[1]); 44 | 45 | flInput = float(input); 46 | 47 | return RoundFloat(RemapValueFloat(flInputBounds, flOutputBounds, flInput, clamp)); 48 | } -------------------------------------------------------------------------------- /include/stocksoup/version.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * Stock functions for game version identification. 3 | */ 4 | 5 | #if defined __stocksoup_version_included 6 | #endinput 7 | #endif 8 | 9 | #define __stocksoup_version_included 10 | 11 | /** 12 | * Returns a StringMap containing key-value entries from steam.inf. 13 | */ 14 | static stock StringMap GetSteamINFData() { 15 | static StringMap s_VersionInfo; 16 | 17 | if (!s_VersionInfo) { 18 | s_VersionInfo = new StringMap(); 19 | 20 | File hSteam = OpenFile("steam.inf", "r"); 21 | 22 | char buffer[32]; 23 | while (hSteam.ReadLine(buffer, sizeof(buffer))) { 24 | int assign = FindCharInString(buffer, '='); 25 | if (assign != -1) { 26 | // copy everything up to equals sign 27 | char[] key = new char[assign + 1]; 28 | strcopy(key, assign + 1, buffer); 29 | 30 | s_VersionInfo.SetString(key, buffer[assign + 1]); 31 | } 32 | } 33 | 34 | delete hSteam; 35 | } 36 | 37 | return s_VersionInfo; 38 | } 39 | 40 | stock int GetNetworkPatchVersion() { 41 | char buffer[16]; 42 | if (GetSteamINFData().GetString("PatchVersion", buffer, sizeof(buffer))) { 43 | return StringToInt(buffer); 44 | } 45 | return 0; 46 | } 47 | 48 | stock int GetApplicationClientVersion() { 49 | char buffer[16]; 50 | if (GetSteamINFData().GetString("ClientVersion", buffer, sizeof(buffer))) { 51 | return StringToInt(buffer); 52 | } 53 | return 0; 54 | } 55 | 56 | stock int GetApplicationServerVersion() { 57 | char buffer[16]; 58 | if (GetSteamINFData().GetString("ServerVersion", buffer, sizeof(buffer))) { 59 | return StringToInt(buffer); 60 | } 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /include/strafeodyssey.inc: -------------------------------------------------------------------------------- 1 | #if defined _strafe_core_included 2 | #endinput 3 | #endif 4 | #define _strafe_core_included 5 | 6 | 7 | #define STRAFE_VERSION "1.0" 8 | #define STRAFE_URL "strafeodyssey.com" 9 | 10 | #include 11 | 12 | /* 13 | * Settings definitions 14 | */ 15 | #define IGNORE_ADVERT 1<<0 16 | 17 | #define DEFAULT_SETTINGS 18 | 19 | /** 20 | * Gets a client's current settings 21 | * 22 | * @param client Client to get settings for. 23 | * 24 | * @return Client's settings flag 25 | */ 26 | native int Strafe_GetClientSettings(int client); 27 | 28 | /** 29 | * Sets a user's new settings 30 | * 31 | * @param client Client to set settings for. 32 | * @param settings Settings to set 33 | */ 34 | native void Strafe_SetClientSettings(int client, int settings); 35 | 36 | /** 37 | * Reloads the core plugin's config file. 38 | * 39 | * @param map Whether to load the maps config (if exists) or the default config instead. 40 | */ 41 | native void Strafe_ReloadConfiguration(bool map = true); 42 | 43 | 44 | 45 | public SharedPlugin:__pl_store = 46 | { 47 | name = "servercore", 48 | file = "so-core.smx", 49 | #if defined REQUIRE_PLUGIN 50 | required = 1, 51 | #else 52 | required = 0, 53 | #endif 54 | }; 55 | 56 | #if defined REQUIRE_PLUGIN 57 | public __pl_store_SetNTVOptional() 58 | { 59 | MarkNativeAsOptional("Strafe_GetClientSettings"); 60 | MarkNativeAsOptional("Strafe_SetClientSettings"); 61 | MarkNativeAsOptional("Strafe_ReloadConfiguration"); 62 | } 63 | #endif 64 | -------------------------------------------------------------------------------- /include/tf2items.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidfearless/Misc-Sourcemod-Plugins/d3b744ba51d42e5cf8d0eb531d96c126c7110834/include/tf2items.inc -------------------------------------------------------------------------------- /include/thelpers/combatcharacter.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_combatcharacter_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_combatcharacter_included 7 | 8 | // CBaseCombatCharacter technically derives from CBaseFlex, but there likely isn't much that's useful from serverside plugins 9 | // may revisit implementing flex if the need arises 10 | 11 | /** 12 | * Entity methodmap that all combat characters derive from, including NPCs and players. 13 | */ 14 | methodmap CBaseCombatCharacter __nullable__ < CBaseAnimating 15 | { 16 | /** 17 | * Create a CBaseCombatCharacter instance from the given entity index. 18 | * 19 | * @param entIndex The entity index to bind this methodmap to. Can be an invalid entity index. 20 | * You can use the CBaseEntity.IsValid property to check if the given entity is valid or not. 21 | */ 22 | public CBaseCombatCharacter( int entIndex ) 23 | { 24 | return view_as( new CBaseAnimating( entIndex ) ); 25 | } 26 | 27 | 28 | /** 29 | * Gets the active weapon of this entity instance. 30 | */ 31 | property CBaseCombatWeapon ActiveWeapon 32 | { 33 | public get() { return view_as( this.GetPropEnt( Prop_Send, "m_hActiveWeapon" ) ); } 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /include/thelpers/combatweapon.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_combatweapon_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_combatweapon_included 7 | 8 | 9 | // games which use econ have their weapons derive from CEconEntity 10 | #if defined GAME_ECON 11 | #define THELPERS_COMBATWEAPON_DERIVED_FROM CEconEntity 12 | #else 13 | #define THELPERS_COMBATWEAPON_DERIVED_FROM CBaseAnimating 14 | #endif 15 | 16 | 17 | /** 18 | * Entity methodmap from which all weapon entities derive from. 19 | */ 20 | methodmap CBaseCombatWeapon < THELPERS_COMBATWEAPON_DERIVED_FROM 21 | { 22 | /** 23 | * Create a CBaseCombatWeapon instance from the given entity index. 24 | * 25 | * @param entIndex The entity index to bind this methodmap to. Can be an invalid entity index. 26 | * You can use the CBaseEntity.IsValid property to check if the given entity is valid or not. 27 | */ 28 | public CBaseCombatWeapon( int entIndex ) 29 | { 30 | return view_as( new CBaseAnimating( entIndex ) ); 31 | } 32 | 33 | 34 | // todo 35 | }; 36 | -------------------------------------------------------------------------------- /include/thelpers/css/css.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_css_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_css_included 7 | 8 | 9 | // css related includes 10 | #include "thelpers/css/player.inc" 11 | #include "thelpers/css/gamerules.inc" 12 | -------------------------------------------------------------------------------- /include/thelpers/css/gamerules.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_css_gamerules_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_css_gamerules_included 7 | 8 | 9 | /** 10 | * CS:S gamerules class. 11 | */ 12 | methodmap CCSGameRules < CTeamplayRules 13 | { 14 | /** 15 | * Is the currently played map a bomb defusal map? 16 | */ 17 | property bool IsBombDefuseMap 18 | { 19 | public get() { return GameRules_GetProp( "m_bMapHasBombTarget" ) == 1; } 20 | } 21 | /** 22 | * Is the currently played map a hostage rescue map? 23 | */ 24 | property bool IsHostageRescueMap 25 | { 26 | public get() { return GameRules_GetProp( "m_bMapHasRescueZone" ) == 1; } 27 | } 28 | 29 | /** 30 | * Gets the number of currently remaining hostages. 31 | */ 32 | property int HostagesRemaining 33 | { 34 | public get() { return GameRules_GetProp( "m_iHostagesRemaining" ); } 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /include/thelpers/css/player.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_css_player_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_css_player_included 7 | 8 | 9 | /** 10 | * Entity class that all CS:S player entities derive from. 11 | */ 12 | methodmap CCSPlayer __nullable__ < CBasePlayer 13 | { 14 | /** 15 | * Create a CCSPlayer instance from the given client index. 16 | * 17 | * @param clientIndex The client index to bind this methodmap to. Can be an invalid client index. 18 | * You can use the CBaseEntity.IsValid property to check if the given client is valid or not. 19 | */ 20 | public CCSPlayer( int clientIndex ) 21 | { 22 | return view_as( new CBasePlayer( clientIndex ) ); 23 | } 24 | 25 | 26 | /** 27 | * Gets or sets this player's MVP count. 28 | */ 29 | property int MVPCount 30 | { 31 | public get() { return CS_GetMVPCount( this.Index ); } 32 | public set( int count ) { CS_SetMVPCount( this.Index, count ); } 33 | } 34 | 35 | 36 | /** 37 | * Gets this player's clan tag. 38 | * 39 | * @param buffer Character buffer to copy clan tag into. 40 | * @param maxBuffer The maximum size of the output buffer. 41 | * 42 | * @return The number of non-null bytes written to output buffer. 43 | */ 44 | public int GetClanTag( char[] buffer, int maxBuffer ) 45 | { 46 | return CS_GetClientClanTag( this.Index, buffer, maxBuffer ); 47 | } 48 | /** 49 | * Sets this player's clan tag. 50 | * 51 | * @param clanTag The clan tag to set. 52 | */ 53 | public void SetClanTag( const char[] clanTag ) 54 | { 55 | CS_SetClientClanTag( this.Index, clanTag ); 56 | } 57 | 58 | /** 59 | * Respawns this player. 60 | */ 61 | public void Respawn() 62 | { 63 | CS_RespawnPlayer( this.Index ); 64 | } 65 | }; 66 | -------------------------------------------------------------------------------- /include/thelpers/econ/econ.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_econ_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_econ_included 7 | 8 | 9 | // econ related includes 10 | #include "thelpers/econ/entity.inc" 11 | -------------------------------------------------------------------------------- /include/thelpers/econ/entity.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_econ_entity_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_econ_entity_included 7 | 8 | 9 | enum CBasePlayer: {}; 10 | 11 | 12 | methodmap CEconEntity __nullable__ < CBaseAnimating 13 | { 14 | /** 15 | * Create a CEconEntity instance from the given entity index. 16 | * 17 | * @param entIndex The entity index to bind this methodmap to. Can be an invalid entity index. 18 | * You can use the CBaseEntity.IsValid property to check if the given entity is valid or not. 19 | */ 20 | public CEconEntity( int entIndex ) 21 | { 22 | return view_as( new CBaseAnimating( entIndex ) ); 23 | } 24 | 25 | 26 | /** 27 | * Gets the item definition index of this econ entity. 28 | */ 29 | property int ItemIndex 30 | { 31 | public get() { return this.GetProp( Prop_Send, "m_iItemDefinitionIndex" ); } 32 | } 33 | 34 | /** 35 | * Gets the item level of this econ entity. 36 | */ 37 | property int ItemLevel 38 | { 39 | public get() { return this.GetProp( Prop_Send, "m_iEntityLevel" ); } 40 | } 41 | /** 42 | * Gets the item quality of this econ entity. 43 | */ 44 | property int ItemQuality 45 | { 46 | public get() { return this.GetProp( Prop_Send, "m_iEntityQuality" ); } 47 | } 48 | 49 | /** 50 | * Gets the Steam Account ID of the owner of this econ entity. 51 | */ 52 | property int AccountID 53 | { 54 | public get() { return this.GetProp( Prop_Send, "m_iAccountID" ); } 55 | } 56 | 57 | 58 | /** 59 | * Gets the player entity that owns this econ entity, if they're present on the server. 60 | */ 61 | public CBasePlayer GetOwningPlayer() 62 | { 63 | for ( int client = 1 ; client <= MaxClients ; ++client ) 64 | { 65 | if ( !IsClientInGame( client ) ) 66 | continue; 67 | 68 | int accountId = GetSteamAccountID( client ); 69 | 70 | if ( accountId == 0 ) 71 | continue; // skip clients with no auth or steamid 72 | 73 | if ( accountId == this.AccountID ) 74 | { 75 | // NOTE: this must return the ref, since we can't construct a CBasePlayer here 76 | return view_as( EntIndexToEntRef( client ) ); 77 | } 78 | 79 | #if 0 80 | // see SM bug #6188 for why we can't do this just yet 81 | CBasePlayer player = CBasePlayer( client ); 82 | 83 | if ( !player.IsInGame ) 84 | continue; 85 | 86 | if ( player.GetAccountID() == this.AccountID ) 87 | return player; 88 | #endif 89 | } 90 | 91 | return view_as( INVALID_ENTITY ); 92 | } 93 | 94 | }; 95 | -------------------------------------------------------------------------------- /include/thelpers/gamerules.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_gamerules_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_gamerules_included 7 | 8 | 9 | /** 10 | * Base gamerules class. 11 | * Note: this represents the gamerules proxy entity, but this makes no functional difference for usage. 12 | */ 13 | methodmap CGameRules < CBaseEntity 14 | { 15 | /** 16 | * Returns the gamerules proxy entity for this game, or null if the entity has not been created yet. 17 | */ 18 | public static CGameRules GetEntity() 19 | { 20 | CBaseEntity gameRulesEnt = null; 21 | 22 | #if defined GAME_TF2 23 | gameRulesEnt = CBaseEntity.FindByClassname( null, "tf_gamerules" ); 24 | #elseif defined GAME_CSS || defined GAME_CSGO 25 | gameRulesEnt = CBaseEntity.FindByClassname( null, "cs_gamerules" ); 26 | #elseif defined GAME_DODS 27 | gameRulesEnt = CBaseEntity.FindByClassname( null, "dod_gamerules" ); 28 | #elseif defined GAME_HL2MP 29 | gameRulesEnt = CBaseEntity.FindByClassname( null, "hl2mp_gamerules" ); 30 | #elseif defined GAME_L4D || defined GAME_L4D2 31 | gameRulesEnt = CBaseEntity.FindByClassname( null, "terror_gamerules" ); 32 | #elseif defined GAME_DOTA 33 | gameRulesEnt = CBaseEntity.FindByClassname( null, "dota_gamerules" ); 34 | #else 35 | ThrowError( "CGameRules.GetEntity is not supported for this game!" ); 36 | #endif 37 | 38 | return view_as( gameRulesEnt ); 39 | } 40 | }; 41 | 42 | 43 | /** 44 | * Gamerules for multiplayer games. 45 | */ 46 | methodmap CMultiplayRules < CGameRules 47 | { 48 | }; 49 | 50 | 51 | /** 52 | * Gamerules for teamplay based multiplayer games. 53 | */ 54 | methodmap CTeamplayRules < CMultiplayRules 55 | { 56 | }; 57 | 58 | 59 | /** 60 | * Gamerules for round and team based multiplayer games. 61 | */ 62 | methodmap CTeamplayRoundBasedRules < CTeamplayRules 63 | { 64 | /** 65 | * Gets the current round state of the game. 66 | */ 67 | property int RoundState 68 | { 69 | public get() { return GameRules_GetProp( "m_iRoundState" ); } 70 | } 71 | 72 | /** 73 | * Is the game currently in overtime? 74 | */ 75 | property bool IsInOvertime 76 | { 77 | public get() { return GameRules_GetProp( "m_bInOvertime" ) == 1; } 78 | } 79 | /** 80 | * Is the game in setup? 81 | */ 82 | property bool IsInSetup 83 | { 84 | public get() { return GameRules_GetProp( "m_bInSetup" ) == 1; } 85 | } 86 | /** 87 | * Is the game currently waiting for players to connect? 88 | */ 89 | property bool IsInWaitingForPlayers 90 | { 91 | public get() { return GameRules_GetProp( "m_bInWaitingForPlayers" ) == 1; } 92 | } 93 | }; 94 | -------------------------------------------------------------------------------- /include/thelpers/tf2/gamerules.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_tf2_gamerules_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_tf2_gamerules_included 7 | 8 | 9 | /** 10 | * TF2 gamerules class. 11 | */ 12 | methodmap CTFGameRules < CTeamplayRoundBasedRules 13 | { 14 | /** 15 | * Is king-of-the-kill currently being played? 16 | */ 17 | property bool IsPlayingKoth 18 | { 19 | public get() { return GameRules_GetProp( "m_bPlayingKoth" ) == 1; } 20 | } 21 | /** 22 | * Is medieval mode currently being played? 23 | */ 24 | property bool IsPlayingMedieval 25 | { 26 | public get() { return GameRules_GetProp( "m_bPlayingMedieval" ) == 1; } 27 | } 28 | /** 29 | * Is special delivery currently being played? 30 | */ 31 | property bool IsPlayingSpecialDelivery 32 | { 33 | public get() { return GameRules_GetProp( "m_bPlayingSpecialDeliveryMode" ) == 1; } 34 | } 35 | /** 36 | * Is hybrid CTF/CP currently being played? 37 | */ 38 | property bool IsPlayingHybridCTFCP 39 | { 40 | public get() { return GameRules_GetProp( "m_bPlayingHybrid_CTF_CP" ) == 1; } 41 | } 42 | /** 43 | * Is mann-vs-machine currently being played? 44 | */ 45 | property bool IsPlayingMvM 46 | { 47 | public get() { return GameRules_GetProp( "m_bPlayingMannVsMachine" ) == 1; } 48 | } 49 | }; 50 | -------------------------------------------------------------------------------- /include/thelpers/tf2/player.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_tf2_player_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_tf2_player_included 7 | 8 | 9 | /** 10 | * Entity class that all TF2 player entities derive from. 11 | */ 12 | methodmap CTFPlayer __nullable__ < CBasePlayer 13 | { 14 | /** 15 | * Create a CTFPlayer instance from the given client index. 16 | * 17 | * @param clientIndex The client index to bind this methodmap to. Can be an invalid client index. 18 | * You can use the CBaseEntity.IsValid property to check if the given client is valid or not. 19 | */ 20 | public CTFPlayer( int clientIndex ) 21 | { 22 | return view_as( new CBasePlayer( clientIndex ) ); 23 | } 24 | 25 | 26 | /** 27 | * Gets the team this player belongs to. 28 | */ 29 | property TFTeam Team 30 | { 31 | public get() { return view_as( GetClientTeam( this.Index ) ); } 32 | } 33 | 34 | /** 35 | * Gets the player class of this player instance. 36 | */ 37 | property TFClassType Class 38 | { 39 | public get() { return TF2_GetPlayerClass( this.Ref ); } 40 | } 41 | 42 | 43 | /** 44 | * Sets the client's player class. 45 | * 46 | * @param class The TF2 class to set the player to. 47 | * @param persistent If true, this sets the player's desired class so it sticks after death. 48 | */ 49 | public void SetClass( TFClassType class, bool persistent = true ) 50 | { 51 | TF2_SetPlayerClass( this.Ref, class, _, persistent ); 52 | } 53 | 54 | /** 55 | * Changes this player's assigned team. 56 | * 57 | * @param team The team to assign to this player. 58 | */ 59 | public void ChangeTeam( TFTeam team ) 60 | { 61 | ChangeClientTeam( this.Index, view_as( team ) ); 62 | } 63 | 64 | /** 65 | * Regenerate the player's class, loadout, weapons, ammo, etc. 66 | * Equivalent of having a player touch a resupply cabinet. 67 | */ 68 | public void Regenerate() 69 | { 70 | TF2_RegeneratePlayer( this.Index ); 71 | } 72 | 73 | /** 74 | * Respawns this player. 75 | */ 76 | public void Respawn() 77 | { 78 | TF2_RespawnPlayer( this.Index ); 79 | } 80 | 81 | /** 82 | * Sets the custom model of this player. 83 | * 84 | * @param model The model to set on this player. 85 | */ 86 | public void SetCustomModel( const char[] model ) 87 | { 88 | SetVariantString( model ); 89 | this.AcceptInput( "SetCustomModel" ); 90 | } 91 | 92 | }; 93 | -------------------------------------------------------------------------------- /include/thelpers/tf2/projectiles.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_tf2_projectiles_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_tf2_projectiles_included 7 | 8 | 9 | /** 10 | * Entity class that all TF2 projectile entities derive from. 11 | */ 12 | methodmap CTFBaseRocket __nullable__ < CBaseAnimating 13 | { 14 | /** 15 | * Create a CTFBaseRocket instance from the given entity index. 16 | * 17 | * @param entIndex The entity index to bind this methodmap to. Can be an invalid entity index. 18 | * You can use the CBaseEntity.IsValid property to check if the given entity is valid or not. 19 | */ 20 | public CTFBaseRocket( int entIndex ) 21 | { 22 | return view_as( new CBaseAnimating( entIndex ) ); 23 | } 24 | 25 | 26 | /** 27 | * Gets or sets the entity that launched this projectile. 28 | */ 29 | property CBaseEntity Launcher 30 | { 31 | public get() { return this.GetPropEnt( Prop_Send, "m_hLauncher" ); } 32 | public set( CBaseEntity launcher ) { this.SetPropEnt( Prop_Send, "m_hLauncher", launcher ); } 33 | } 34 | 35 | /** 36 | * Gets or sets the number of times this projectile has been reflected. 37 | */ 38 | property int DeflectedCount 39 | { 40 | public get() { return this.GetProp( Prop_Send, "m_iDeflected" ); } 41 | public set( int count ) { this.SetProp( Prop_Send, "m_iDeflected", count ); } 42 | } 43 | 44 | 45 | /** 46 | * Gets the initial launch velocity of this projectile. 47 | * 48 | * @param vec Float vector buffer in which to store the velocity. 49 | */ 50 | public void GetInitialVelocity( float vec[ 3 ] ) 51 | { 52 | this.GetPropVector( Prop_Send, "m_vInitialVelocity", vec ); 53 | } 54 | }; 55 | -------------------------------------------------------------------------------- /include/thelpers/tf2/tf2.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined __thelpers_tf2_included 3 | #endinput 4 | #endif 5 | 6 | #define __thelpers_tf2_included 7 | 8 | 9 | // tf2 related includes 10 | #include "thelpers/tf2/player.inc" 11 | #include "thelpers/tf2/projectiles.inc" 12 | #include "thelpers/tf2/objects.inc" 13 | #include "thelpers/tf2/gamerules.inc" 14 | -------------------------------------------------------------------------------- /include/thelpers/thelpers.inc: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * SM transitional API helpers 4 | */ 5 | 6 | #if defined __thelpers_included 7 | #endinput 8 | #endif 9 | 10 | #define __thelpers_included 11 | 12 | 13 | // include what thelpers requires 14 | #include 15 | #include 16 | 17 | 18 | // figure out what game we are, and what features are enabled 19 | #if defined GAME_TF2 20 | // tf2 uses econ entities 21 | #define GAME_ECON 22 | 23 | #include 24 | #include 25 | #elseif defined GAME_CSS 26 | // css doesn't directly use econ entities, but has attribute containers 27 | #define GAME_ECON 28 | 29 | #include 30 | #endif 31 | 32 | 33 | // require transitional api for our includes 34 | #pragma newdecls required 35 | 36 | 37 | // generic sdk includes 38 | #include "thelpers/entity.inc" 39 | #include "thelpers/animating.inc" 40 | 41 | #if defined GAME_ECON 42 | // econ has to be included fairly early, as other entity methodmaps rely on it 43 | #include "thelpers/econ/econ.inc" 44 | #endif 45 | 46 | #include "thelpers/combatweapon.inc" 47 | #include "thelpers/combatcharacter.inc" 48 | #include "thelpers/player.inc" 49 | 50 | #include "thelpers/gamerules.inc" 51 | 52 | 53 | // game includes 54 | #if defined GAME_TF2 55 | #include "thelpers/tf2/tf2.inc" 56 | #elseif defined GAME_CSS 57 | #include "thelpers/css/css.inc" 58 | #endif 59 | 60 | 61 | // reset 62 | #pragma newdecls optional 63 | -------------------------------------------------------------------------------- /include/timer_obj.inc: -------------------------------------------------------------------------------- 1 | #if defined _timer_obj_included 2 | #endinput 3 | #endif 4 | #define _timer_obj_included 5 | 6 | #include 7 | 8 | methodmap TIMER < Handle 9 | { 10 | public TIMER(Timer func, float interval = 1.0, int flags=0, any data=INVALID_HANDLE) 11 | { 12 | Handle obj = CreateTimer(interval, func, data, flags); 13 | 14 | return view_as(obj); 15 | 16 | } 17 | 18 | public bool IsAssigned(int i = 2) 19 | { 20 | static bool IsAssigned = false; 21 | if(i != 2) 22 | { 23 | IsAssigned = !!i; 24 | } 25 | return IsAssigned; 26 | } 27 | } -------------------------------------------------------------------------------- /include/tr_trigger.inc: -------------------------------------------------------------------------------- 1 | #if defined _tr_trigger_Included 2 | #endinput 3 | #endif 4 | #define _tr_trigger_Included 5 | 6 | #include 7 | 8 | 9 | 10 | stock int GetTriggerAtAim(int client) 11 | { 12 | float origin[3]; 13 | float ang[3]; 14 | GetClientEyePosition(client, origin); 15 | GetClientEyeAngles(client, ang); 16 | 17 | DataPack pack = new DataPack(); 18 | TR_EnumerateEntities(origin, ang, true, RayType_Infinite, GetFirstTrigger, pack); 19 | pack.Reset(); 20 | 21 | if(!pack.IsReadable(sizeof(client))) 22 | { 23 | delete pack; 24 | return -1; 25 | } 26 | 27 | int _ent = pack.ReadCell(); 28 | delete pack; 29 | return _ent; 30 | } 31 | 32 | public bool GetFirstTrigger(int entity, DataPack pack) 33 | { 34 | pack.WriteCell(entity); 35 | return false; 36 | } 37 | 38 | 39 | /* 40 | Returns the db map id for the current map or -1 on failure 41 | */ 42 | native int Ent_GetCurrentMapID(); 43 | 44 | 45 | /* Fired when a valid mapid has been assigned, and is ready to be used. */ 46 | forward void Ent_OnMapIDReady(int mapid); -------------------------------------------------------------------------------- /include/umc-playerlimits.inc: -------------------------------------------------------------------------------- 1 | #if defined _umc_playerlimits_included 2 | #endinput 3 | #endif 4 | #define _umc_playerlimits_included 5 | 6 | #define PLAYERLIMIT_KEY_MAP_MIN "min_players" 7 | #define PLAYERLIMIT_KEY_MAP_MAX "max_players" 8 | #define PLAYERLIMIT_KEY_GROUP_MIN "default_min_players" 9 | #define PLAYERLIMIT_KEY_GROUP_MAX "default_max_players" -------------------------------------------------------------------------------- /include/version.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * vim: set ts=4 : 3 | * ============================================================================= 4 | * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. 5 | * ============================================================================= 6 | * 7 | * This file is part of the SourceMod/SourcePawn SDK. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it under 10 | * the terms of the GNU General Public License, version 3.0, as published by the 11 | * Free Software Foundation. 12 | * 13 | * This program is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 16 | * details. 17 | * 18 | * You should have received a copy of the GNU General Public License along with 19 | * this program. If not, see . 20 | * 21 | * As a special exception, AlliedModders LLC gives you permission to link the 22 | * code of this program (as well as its derivative works) to "Half-Life 2," the 23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software 24 | * by the Valve Corporation. You must obey the GNU General Public License in 25 | * all respects for all other code used. Additionally, AlliedModders LLC grants 26 | * this exception to all derivative works. AlliedModders LLC defines further 27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), 28 | * or . 29 | * 30 | * Version: $Id$ 31 | */ 32 | 33 | #if defined _version_included 34 | #endinput 35 | #endif 36 | #define _version_included 37 | 38 | #tryinclude 39 | 40 | #if !defined _auto_version_included 41 | #define SOURCEMOD_V_TAG "manual" 42 | #define SOURCEMOD_V_REV 0 43 | #define SOURCEMOD_V_CSET "0" 44 | #define SOURCEMOD_V_MAJOR 1 /**< SourceMod Major version */ 45 | #define SOURCEMOD_V_MINOR 10 /**< SourceMod Minor version */ 46 | #define SOURCEMOD_V_RELEASE 0 /**< SourceMod Release version */ 47 | 48 | #define SOURCEMOD_VERSION "1.10.0-manual" /**< SourceMod version string (major.minor.release-tag) */ 49 | #endif 50 | -------------------------------------------------------------------------------- /include/version_auto.inc: -------------------------------------------------------------------------------- 1 | 2 | #if defined _auto_version_included 3 | #endinput 4 | #endif 5 | #define _auto_version_included 6 | 7 | #define SOURCEMOD_V_TAG "" 8 | #define SOURCEMOD_V_CSET "ab5f00b6" 9 | #define SOURCEMOD_V_MAJOR 1 10 | #define SOURCEMOD_V_MINOR 10 11 | #define SOURCEMOD_V_RELEASE 0 12 | #define SOURCEMOD_V_REV 6435 13 | 14 | #define SOURCEMOD_VERSION "1.10.0.6435" 15 | -------------------------------------------------------------------------------- /include/voiceannounce_ex.inc: -------------------------------------------------------------------------------- 1 | #if defined _voiceannounceex_included_ 2 | #endinput 3 | #endif 4 | #define _voiceannounceex_included_ 5 | 6 | public SharedPlugin __pl_voiceannounceex = 7 | { 8 | name = "voiceannounce_ex", 9 | file = "voiceannounce_ex.smx", 10 | #if defined REQUIRE_PLUGIN 11 | required = 1, 12 | #else 13 | required = 0, 14 | #endif 15 | }; 16 | 17 | public void __pl_voiceannounceex_SetNTVOptional() 18 | { 19 | MarkNativeAsOptional("IsClientSpeaking"); 20 | } 21 | 22 | /** 23 | * 24 | * Checks whether a client is speaking or not. 25 | * 26 | * @param client The client index to check against. 27 | * 28 | * @error Client is not valid, ingame, or client is a bot. 29 | * 30 | * @return True if client is speaking, false otherwise. 31 | * 32 | */ 33 | 34 | native bool IsClientSpeaking(int client); 35 | 36 | /** 37 | * 38 | * Called when a client is speaking. 39 | * 40 | * @noreturn 41 | * 42 | */ 43 | 44 | forward void OnClientSpeakingEx(int client); 45 | 46 | /** 47 | * 48 | * Called when a client end of speaking. 49 | * 50 | * @param client The index of the client. 51 | * 52 | * @noreturn 53 | * 54 | */ 55 | forward void OnClientSpeakingEnd(int client); 56 | -------------------------------------------------------------------------------- /kid-256.smx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidfearless/Misc-Sourcemod-Plugins/d3b744ba51d42e5cf8d0eb531d96c126c7110834/kid-256.smx -------------------------------------------------------------------------------- /kid-256.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define DEFAULT_WISH 30.0 6 | 7 | float gF_TickRate[MAXPLAYERS]; 8 | ConVar sv_air_max_wishspeed = null; 9 | bool gB_Late = false; 10 | 11 | public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) 12 | { 13 | gB_Late = late; 14 | return APLRes_Success; 15 | } 16 | 17 | 18 | public void OnPluginStart() 19 | { 20 | sv_air_max_wishspeed = FindConVar("sv_air_max_wishspeed"); 21 | sv_air_max_wishspeed.Flags &= ~(FCVAR_REPLICATED); 22 | if(gB_Late) 23 | { 24 | for (int client = 1; client <= MaxClients; ++client) 25 | { 26 | if (IsClientInGame(client)) 27 | { 28 | OnClientPutInServer(client); 29 | } 30 | } 31 | } 32 | } 33 | 34 | public void Shavit_OnStyleChanged(int client, int oldstyle, int newstyle) 35 | { 36 | char sSpecial[128]; 37 | Shavit_GetStyleStrings(newstyle, sSpecialString, sSpecial, 128); 38 | char wish[8]; 39 | if(StrContains(sSpecial, "256") != -1) 40 | { 41 | gF_TickRate[client] = 33.0; 42 | } 43 | else if(StrContains(sSpecial, "102") != -1) 44 | { 45 | gF_TickRate[client] = 26.4; 46 | } 47 | else 48 | { 49 | gF_TickRate[client] = 30.0;//reduce their strafing by the multiple of their timescale. 50 | } 51 | 52 | FormatEx(wish, sizeof(wish), "%f", gF_TickRate[client]); 53 | sv_air_max_wishspeed.ReplicateToClient(client, wish); 54 | } 55 | 56 | public void OnClientPutInServer(int client) 57 | { 58 | SDKHook(client, SDKHook_PreThink, OnPreThinkPost); 59 | gF_TickRate[client] = 30.0; 60 | } 61 | 62 | public void OnClientDisconnect(int client) 63 | { 64 | SDKUnhook(client, SDKHook_PreThink, OnPreThinkPost); 65 | gF_TickRate[client] = 30.0; 66 | } 67 | 68 | public void OnPreThinkPost(int client) 69 | { 70 | if(IsValidClient(client) && !IsFakeClient(client)) 71 | { 72 | sv_air_max_wishspeed.FloatValue = gF_TickRate[client];//reduce their strafing by the multiple of their timescale. 73 | } 74 | } -------------------------------------------------------------------------------- /kid-256tick.smx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidfearless/Misc-Sourcemod-Plugins/d3b744ba51d42e5cf8d0eb531d96c126c7110834/kid-256tick.smx -------------------------------------------------------------------------------- /kid-afkcheck.smx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidfearless/Misc-Sourcemod-Plugins/d3b744ba51d42e5cf8d0eb531d96c126c7110834/kid-afkcheck.smx -------------------------------------------------------------------------------- /kid-autostrafe.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | 6 | #pragma newdecls required 7 | #pragma semicolon 1 8 | 9 | public Plugin myinfo = 10 | { 11 | name = "Autostrafe", 12 | author = "KiD Fearless", 13 | description = "https://steamcommunity.com/id/kidfearless/", 14 | version = "1.0", 15 | url = "www.joinsg.net" 16 | } 17 | 18 | bool gB_MoveLeft[MAXPLAYERS+1]; 19 | bool gB_MoveRight[MAXPLAYERS+1]; 20 | 21 | 22 | public void OnClientConnected(int client) 23 | { 24 | gB_MoveLeft[client] = false; 25 | gB_MoveRight[client] = false; 26 | } 27 | 28 | public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3]) 29 | { 30 | char sSpecial[128]; 31 | Shavit_GetStyleStrings(style, sSpecialString, sSpecial, 128); 32 | 33 | if(StrContains(sSpecial, "autostrafe", false) == -1) 34 | { 35 | return Plugin_Continue; 36 | } 37 | 38 | if((GetEntityMoveType(client) == MOVETYPE_NOCLIP) || (GetEntityMoveType(client) & MOVETYPE_LADDER)) 39 | { 40 | return Plugin_Continue; 41 | } 42 | 43 | if((buttons & IN_MOVELEFT) || (buttons & IN_MOVERIGHT) || (buttons & IN_BACK) || (buttons & IN_FORWARD)) 44 | { 45 | return Plugin_Continue; 46 | } 47 | 48 | 49 | if(buttons & IN_JUMP) 50 | { 51 | if(mouse[0] > 3) 52 | { 53 | vel[1] = 450.0; 54 | buttons |= IN_MOVERIGHT; 55 | gB_MoveLeft[client] = false; 56 | gB_MoveRight[client] = true; 57 | } 58 | else if(mouse[0] < -3) 59 | { 60 | vel[1] = -450.0; 61 | buttons |= IN_MOVELEFT; 62 | gB_MoveLeft[client] = true; 63 | gB_MoveRight[client] = false; 64 | } 65 | 66 | else if(gB_MoveLeft[client]) 67 | { 68 | vel[1] = -450.0; 69 | buttons |= IN_MOVELEFT; 70 | 71 | } 72 | else 73 | { 74 | vel[1] = 450.0; 75 | buttons |= IN_MOVERIGHT; 76 | } 77 | } 78 | 79 | 80 | return Plugin_Changed; 81 | } 82 | 83 | stock void Strafe_Left(int client, int &buttons, float vel[3]) 84 | { 85 | vel[1] = -450.0; 86 | buttons |= IN_MOVELEFT; 87 | gB_MoveLeft[client] = true; 88 | gB_MoveRight[client] = false; 89 | } 90 | 91 | stock void Strafe_Right(int client, int &buttons, float vel[3]) 92 | { 93 | vel[1] = 450.0; 94 | buttons |= IN_MOVERIGHT; 95 | gB_MoveLeft[client] = false; 96 | gB_MoveRight[client] = true; 97 | } -------------------------------------------------------------------------------- /kid-backwards.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #pragma semicolon 1 4 | 5 | float gF_LastAngle[MAXPLAYERS]; 6 | 7 | enum Strafe_t 8 | { 9 | STRF_INVALID = 0, 10 | STRF_LEFT, 11 | STRF_RIGHT 12 | }; 13 | 14 | public Plugin myinfo = 15 | { 16 | name = "Shavit-Backwards", 17 | author = "KiD Fearless", 18 | description = "Backwards only style", 19 | version = "1.0", 20 | url = "https://github.com/kidfearless" 21 | } 22 | 23 | bool gB_Activated[MAXPLAYERS+1]; 24 | 25 | public void OnClientConnected(iClient) 26 | { 27 | gB_Activated[iClient] = false; 28 | } 29 | 30 | public void Shavit_OnStyleChanged(int client, int oldstyle, int newstyle) 31 | { 32 | char specialString[64]; 33 | Shavit_GetStyleStrings(newstyle, sSpecialString, specialString, sizeof(specialString)); 34 | if(StrContains(specialString, "back", false) == -1) 35 | { 36 | gB_Activated[client] = false; 37 | } 38 | else 39 | { 40 | gB_Activated[client] = true; 41 | } 42 | } 43 | 44 | public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3]) 45 | { 46 | if(gB_Activated[client]) 47 | { 48 | if(IsPlayerAlive(client)) 49 | { 50 | Strafe_t dir = GetStrafe(angles[1], gF_LastAngle[client], 1.0); 51 | if((dir == STRF_RIGHT) && (vel[1] > 0.0)) 52 | { 53 | vel[1] = 0.0; 54 | } 55 | else if((dir == STRF_LEFT) && (vel[1] < 0.0)) 56 | { 57 | vel[1] = 0.0; 58 | } 59 | } 60 | } 61 | gF_LastAngle[client] = angles[1]; 62 | } 63 | 64 | 65 | stock Strafe_t GetStrafe( float yaw, float prevyaw, float grace = 5.0 ) 66 | { 67 | float delta = yaw - prevyaw; 68 | 69 | if ( delta == 0.0 ) return STRF_INVALID; 70 | 71 | 72 | float min = -180.0 + grace; 73 | float max = 180.0 - grace; 74 | 75 | 76 | if ( delta > 0.0 ) 77 | { 78 | return ( yaw > max && prevyaw < min ) ? STRF_RIGHT : STRF_LEFT; 79 | } 80 | else 81 | { 82 | return ( yaw < min && prevyaw > max ) ? STRF_LEFT : STRF_RIGHT; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /kid-changes.smx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidfearless/Misc-Sourcemod-Plugins/d3b744ba51d42e5cf8d0eb531d96c126c7110834/kid-changes.smx -------------------------------------------------------------------------------- /kid-cpmenu.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | public void Shavit_OnStyleChanged(int client, int oldstyle, int newstyle) 6 | { 7 | DataPack styledata = new DataPack(); 8 | styledata.WriteCell(client); 9 | styledata.WriteCell(oldstyle); 10 | styledata.WriteCell(newstyle); 11 | 12 | RequestFrame(PostStyleChanged, styledata); 13 | } 14 | 15 | public void PostStyleChanged(DataPack styledata) 16 | { 17 | styledata.Reset(); 18 | int client = styledata.ReadCell(); 19 | int oldstyle = styledata.ReadCell(); 20 | int newstyle = styledata.ReadCell(); 21 | 22 | if(newstyle == 4) 23 | { 24 | CloseClientMenu(client); 25 | Shavit_RestartTimer(client, Track_Main); 26 | } 27 | 28 | CloseHandle(styledata); 29 | } 30 | 31 | stock int CloseClientMenu(client) 32 | { 33 | Menu ClearMenu = new Menu(MenuHandler_CloseClientMenu); 34 | 35 | ClearMenu.SetTitle("Clearing Menu"); 36 | ClearMenu.Display(client, 1); 37 | } 38 | 39 | public int MenuHandler_CloseClientMenu(Menu menu, MenuAction action, int param1, int param2) 40 | { 41 | if(action == MenuAction_End) 42 | { 43 | delete menu; 44 | } 45 | } -------------------------------------------------------------------------------- /kid-end.sp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | bool gB_UsedEnd[MAXPLAYERS+1]; 6 | 7 | 8 | public void OnClientConnected(int client) 9 | { 10 | gB_UsedEnd[client] = false; 11 | } 12 | 13 | public void Shavit_OnEnd(int client, int track) 14 | { 15 | Shavit_StopTimer(client); 16 | gB_UsedEnd[client] = true; 17 | } 18 | 19 | public Action Shavit_OnFinishPre(int client, any snapshot[TIMERSNAPSHOT_SIZE]) 20 | { 21 | if(gB_UsedEnd[client]) 22 | { 23 | return Plugin_Handled; 24 | } 25 | return Plugin_Continue; 26 | } 27 | 28 | public void Shavit_OnEnterZone(int client, int type, int track, int id, int entity) 29 | { 30 | gB_UsedEnd[client] = false; 31 | } -------------------------------------------------------------------------------- /kid-fov.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #pragma newdecls required 6 | #pragma semicolon 1 7 | 8 | public Plugin myinfo = 9 | { 10 | author = "KiD Fearless", 11 | url = "https://www.steamcommunity.com/id/kidfearless", 12 | name = "High FOV Style", 13 | description = "", 14 | version = "1.0" 15 | }; 16 | 17 | public void Shavit_OnStyleChanged(int client, int oldstyle, int newstyle, int track, bool manual) 18 | { 19 | char[] sSpecial = new char[128]; 20 | Shavit_GetStyleStrings(newstyle, sSpecialString, sSpecial, 128); 21 | 22 | if(StrContains(sSpecial, "ws", false) != -1) 23 | { 24 | SetEntProp(client, Prop_Send, "m_iFOV", 45); 25 | SetEntProp(client, Prop_Send, "m_iDefaultFOV", 45); 26 | SetEntProp(client, Prop_Send, "m_iFOVStart", 45); 27 | } 28 | else 29 | { 30 | SetEntProp(client, Prop_Send, "m_iFOV", 90); 31 | SetEntProp(client, Prop_Send, "m_iDefaultFOV", 90); 32 | SetEntProp(client, Prop_Send, "m_iFOVStart", 90); 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /kid-legiteasy.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define DEFAULT_FRICTION 4 6 | 7 | ConVar sv_friction = null; 8 | 9 | bool g_bTest[MAXPLAYERS + 1]; 10 | bool g_bApplyFriction[MAXPLAYERS + 1]; 11 | 12 | public Plugin myinfo = 13 | { 14 | name = "Style: Legit CSS", 15 | author = "KiD Fearless", 16 | description = "Tries to replicate css bhop style for csgo", 17 | version = "1.0", 18 | url = "https://steamcommunity.com/id/kidfearless/" 19 | } 20 | 21 | public void OnPluginStart() 22 | { 23 | RegConsoleCmd("sm_css", Command_Callback); 24 | sv_friction = FindConVar("sv_friction"); 25 | sv_friction.Flags &= ~(FCVAR_NOTIFY | FCVAR_REPLICATED); 26 | 27 | for(int i = 1; i <= MaxClients; ++i) 28 | { 29 | if(IsValidClient(i)) 30 | { 31 | OnClientPutInServer(i); 32 | } 33 | } 34 | } 35 | 36 | public void OnPluginEnd() 37 | { 38 | delete sv_friction; 39 | } 40 | 41 | 42 | public void OnClientPutInServer(int client) 43 | { 44 | SDKHook(client, SDKHook_PreThinkPost, OnPreThinkPost); 45 | g_bTest[client] = false; 46 | } 47 | 48 | public void OnClientDisconnect(int client) 49 | { 50 | SDKUnhook(client, SDKHook_PreThinkPost, OnPreThinkPost); 51 | g_bTest[client] = false; 52 | } 53 | 54 | public void OnPreThinkPost(int client) 55 | { 56 | if(g_bTest[client]) 57 | { 58 | if(g_bApplyFriction[client]) 59 | { 60 | sv_friction.IntValue = 20; 61 | } 62 | else 63 | { 64 | sv_friction.IntValue = DEFAULT_FRICTION; 65 | } 66 | } 67 | else 68 | { 69 | sv_friction.IntValue = DEFAULT_FRICTION; 70 | } 71 | } 72 | 73 | public Action Command_Callback(int client, int args) 74 | { 75 | g_bTest[client] = !g_bTest[client]; 76 | 77 | return Plugin_Handled; 78 | } 79 | 80 | 81 | 82 | public Action OnPlayerRunCmd(int client, int& buttons, int& impulse, float vel[3], float angles[3], int& weapon, int& subtype, int& cmdnum, int& tickcount, int& seed, int mouse[2]) 83 | { 84 | static int ticksOnGround[MAXPLAYERS + 1]; 85 | 86 | if(GetEntityFlags(client) & FL_ONGROUND == FL_ONGROUND) 87 | { 88 | ++ticksOnGround[client]; 89 | } 90 | else 91 | { 92 | ticksOnGround[client] = 0; 93 | } 94 | 95 | g_bApplyFriction[client] = (ticksOnGround[client] < 4); 96 | 97 | return Plugin_Continue; 98 | } 99 | -------------------------------------------------------------------------------- /kid-moonshoes.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #pragma newdecls required 6 | #pragma semicolon 1 7 | 8 | bool gB_MoonShoes[MAXPLAYERS + 1]; 9 | 10 | #define BOOST (1.49 * 301.993377) 11 | 12 | public Plugin myinfo = 13 | { 14 | name = "MoonShoes", 15 | author = "KiD Fearless", 16 | description = "https://steamcommunity.com/id/kidfearless/", 17 | version = "", 18 | url = "www.joinsg.net" 19 | } 20 | 21 | public void OnPluginStart() 22 | { 23 | HookEvent("player_jump", Event_PlayerJump); 24 | } 25 | 26 | public void Event_PlayerJump(Event event, const char[] name, bool dontBroadcast) 27 | { 28 | int client = GetClientOfUserId(event.GetInt("userid")); 29 | if(gB_MoonShoes[client]) 30 | { 31 | RequestFrame(Frame_JumpPost, client); 32 | } 33 | } 34 | 35 | public void Frame_JumpPost(int client) 36 | { 37 | float fAbsVelocity[3]; 38 | GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", fAbsVelocity); 39 | fAbsVelocity[2] += 147.97675473; 40 | 41 | SetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", fAbsVelocity); 42 | 43 | } 44 | 45 | public void Shavit_OnStyleChanged(int client, int oldstyle, int newstyle) 46 | { 47 | char sSpecial[128]; 48 | Shavit_GetStyleStrings(newstyle, sSpecialString, sSpecial, 128); 49 | 50 | if(StrContains(sSpecial, "moon", false) == -1) 51 | { 52 | gB_MoonShoes[client] = false; 53 | } 54 | else 55 | { 56 | gB_MoonShoes[client] = true; 57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /kid-replayfix.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #pragma semicolon 1 5 | #pragma newdecls required 6 | 7 | int replayBot = 1; 8 | ConVar sv_clamp_unsafe_velocities = null; 9 | 10 | public void OnPluginStart() 11 | { 12 | sv_clamp_unsafe_velocities = FindConVar("sv_clamp_unsafe_velocities"); 13 | } 14 | 15 | public void OnEntityCreated(int entity, const char[] classname) { 16 | if( (classname[0] == 't' || classname[0] == 'l') ? (StrEqual(classname, "trigger_teleport", false) || StrEqual(classname, "trigger_multiple", false) || StrEqual(classname, "trigger_once", false) || StrEqual(classname, "trigger_hurt", false) || StrEqual(classname, "logic_relay", false)) : false) 17 | { 18 | SDKHook(entity, SDKHook_Use, OnEntityUse); 19 | SDKHook(entity, SDKHook_StartTouch, OnEntityUse); 20 | SDKHook(entity, SDKHook_Touch, OnEntityUse); 21 | SDKHook(entity, SDKHook_EndTouch, OnEntityUse); 22 | } 23 | } 24 | 25 | public void Shavit_OnReplayStart(int client) 26 | { 27 | replayBot = client; 28 | SDKHook(client, SDKHook_PreThink, OnPreThinkPost); 29 | SDKHook(client, SDKHook_PostThink, OnPostThinkPost); 30 | } 31 | 32 | public void OnPreThinkPost(int client) 33 | { 34 | if(client == replayBot) 35 | { 36 | sv_clamp_unsafe_velocities.BoolValue = true; 37 | } 38 | else 39 | { 40 | sv_clamp_unsafe_velocities.BoolValue = false; 41 | } 42 | } 43 | 44 | public void OnPostThinkPost(int client) 45 | { 46 | sv_clamp_unsafe_velocities.BoolValue = false; 47 | } 48 | 49 | public Action OnEntityUse(int entity, int client) 50 | { 51 | if(client == replayBot) 52 | { 53 | return Plugin_Handled; 54 | } 55 | else 56 | { 57 | return Plugin_Continue; 58 | } 59 | } -------------------------------------------------------------------------------- /kid-thirdperson.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #pragma newdecls required 6 | #pragma semicolon 1 7 | 8 | bool gB_ThirdPerson[MAXPLAYERS + 1]; 9 | bool gB_Ignore[MAXPLAYERS + 1]; 10 | public Plugin myinfo = 11 | { 12 | name = "Thirdperson", 13 | author = "KiD Fearless", 14 | description = "https://steamcommunity.com/id/kidfearless/", 15 | version = "", 16 | url = "www.joinsg.net" 17 | } 18 | 19 | public void OnPluginStart() 20 | { 21 | HookEvent("player_jump", Event_PlayerJump); 22 | } 23 | 24 | public void Event_PlayerJump(Event event, const char[] name, bool dontBroadcast) 25 | { 26 | int client = GetClientOfUserId(event.GetInt("userid")); 27 | if(!gB_Ignore[client]) 28 | { 29 | if(gB_ThirdPerson[client] == true) 30 | { 31 | ClientCommand(client, "thirdperson"); 32 | } 33 | else 34 | { 35 | ClientCommand(client, "firstperson"); 36 | } 37 | } 38 | } 39 | 40 | public void Shavit_OnStyleChanged(int client, int oldstyle, int newstyle) 41 | { 42 | char sSpecial[128]; 43 | Shavit_GetStyleStrings(newstyle, sSpecialString, sSpecial, 128); 44 | 45 | 46 | if(StrContains(sSpecial, "thirdperson", false) == -1) 47 | { 48 | gB_ThirdPerson[client] = false; 49 | ClientCommand(client, "firstperson"); 50 | } 51 | else 52 | { 53 | gB_ThirdPerson[client] = true; 54 | ClientCommand(client, "thirdperson"); 55 | } 56 | if(StrContains(sSpecial, "tas", false) != -1) 57 | { 58 | gB_Ignore[client] = true; 59 | } 60 | else 61 | { 62 | gB_Ignore[client] = false; 63 | } 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /knife_menu.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | Menu KnifeMenu = null; 6 | 7 | public Plugin myinfo = 8 | { 9 | name = "Knife Menu", 10 | author = "KiD Fearless", 11 | description = "Knife Menu For Donators", 12 | version = "1.0", 13 | url = "https://steamcommunity.com/id/kidfearless/" 14 | } 15 | 16 | public void OnPluginStart() 17 | { 18 | RegAdminCmd("sm_knifes", Command_Knives, ADMFLAG_CUSTOM6); 19 | RegAdminCmd("sm_knives", Command_Knives, ADMFLAG_CUSTOM6); 20 | RegAdminCmd("sm_knifemenu", Command_Knives, ADMFLAG_CUSTOM6); 21 | 22 | KnifeMenu = new Menu(KnifeMenuCallback); 23 | KnifeMenu.SetTitle("Knife Menu"); 24 | 25 | KnifeMenu.AddItem("weapon_fists","weapon_fists"); 26 | KnifeMenu.AddItem("weapon_axe","weapon_axe"); 27 | KnifeMenu.AddItem("weapon_spanner","weapon_spanner"); 28 | KnifeMenu.AddItem("weapon_hammer","weapon_hammer"); 29 | KnifeMenu.AddItem("weapon_melee","weapon_melee"); 30 | KnifeMenu.AddItem("weapon_tablet","weapon_tablet"); 31 | } 32 | 33 | public Action Command_Knives(int client, int args) 34 | { 35 | KnifeMenu.Display(client, MENU_TIME_FOREVER); 36 | return Plugin_Handled; 37 | } 38 | 39 | public int KnifeMenuCallback(Menu menu, MenuAction action, int param1, int param2) 40 | { 41 | if(action == MenuAction_Select) 42 | { 43 | char weapon[32]; 44 | menu.GetItem(param2, weapon, sizeof(weapon)); 45 | 46 | Client_RemoveWeapon(param1, weapon); 47 | int index = GivePlayerItem(param1, weapon); 48 | EquipPlayerWeapon(param1, index); 49 | } 50 | } -------------------------------------------------------------------------------- /loadingscreen_radar_downloader.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | public Plugin myinfo = 5 | { 6 | name = "Radar and loading screen downloader", 7 | author = "Mad", 8 | description = "Adds the radar and loading screen files to the downloads table", 9 | version = "1.0.2", 10 | url = "http://forum.i3d.net/" 11 | } 12 | 13 | public OnMapStart() 14 | { 15 | //Get the name of the current map and add it to download table 16 | char mapName[PLATFORM_MAX_PATH]; 17 | char currentMap[PLATFORM_MAX_PATH]; 18 | char radarTexture[PLATFORM_MAX_PATH]; 19 | char radarConfig[PLATFORM_MAX_PATH]; 20 | 21 | GetCurrentMap(mapName, sizeof(mapName)); 22 | GetMapDisplayName(mapName, mapName, sizeof(mapName)); 23 | 24 | Format(radarTexture, sizeof(radarTexture), "resource/overviews/%s_radar.dds", mapName); 25 | Format(radarConfig, sizeof(radarConfig), "resource/overviews/%s.txt", mapName); 26 | Format(currentMap, sizeof(currentMap), "maps/%s.bsp", mapName); 27 | 28 | 29 | if(FileExists(radarTexture)) 30 | AddFileToDownloadsTable(radarTexture); 31 | if(FileExists(radarConfig)) 32 | AddFileToDownloadsTable(radarConfig); 33 | if(FileExists(currentMap)) 34 | AddFileToDownloadsTable(currentMap); 35 | } 36 | -------------------------------------------------------------------------------- /mapconfig.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | public void OnConfigsExecuted() 4 | { 5 | char map[PLATFORM_MAX_PATH]; 6 | GetCurrentMap(map, PLATFORM_MAX_PATH); 7 | GetMapDisplayName(map, map, PLATFORM_MAX_PATH); 8 | ServerCommand("exec %s.cfg", map); 9 | } -------------------------------------------------------------------------------- /mapsize.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | public void OnPluginStart() 4 | { 5 | RegConsoleCmd("mapsize", GetMapSize, "Returns the map size in megabytes"); 6 | } 7 | 8 | void GetMapSize() 9 | { 10 | char currentMap[PLATFORM_MAX_PATH]; 11 | GetCurrentMap(currentMap, sizeof(currentMap)); 12 | 13 | Format(currentMap, sizeof(currentMap), "maps/%s.bsp", currentMap); 14 | int size = ( (FileSize(currentMap)) / 1000000); 15 | return Plugin_Handled; 16 | } -------------------------------------------------------------------------------- /nav_generate_fix.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int gI_LastGenerateTime; 4 | int gI_BrokenMap; 5 | 6 | public void OnPluginStart() 7 | { 8 | HookEvent("nav_generate", OnNavGeneratePre, EventHookMode_Pre); 9 | } 10 | 11 | public Action OnNavGeneratePre(Event event, const char[] name, bool dontBroadcast) 12 | { 13 | if(GetTime() - gI_LastGenerateTime < 10) 14 | { 15 | char map[PLATFORM_MAX_PATH]; 16 | GetCurrentMap(map, PLATFORM_MAX_PATH); 17 | char sid[PLATFORM_MAX_PATH]; 18 | char mapname[1]; 19 | ParseWorkshopMap(map, sid, mapname); 20 | gI_BrokenMap = StringToInt(sid); 21 | ForceChangeLevel("workshop/726282962/bhop_X", "Nav mesh broke"); 22 | CreateTimer(5.0, DeleteThatMap); 23 | } 24 | else 25 | { 26 | gI_LastGenerateTime = GetTime(); 27 | } 28 | 29 | return Plugin_Continue; 30 | } 31 | 32 | public Action DeleteThatMap(Handle handle) 33 | { 34 | DeleteFolder(gI_BrokenMap); 35 | CreateTimer(5.0, ReturnToThatMap, gI_BrokenMap); 36 | return Plugin_Continue; 37 | } 38 | 39 | public Action ReturnToThatMap(Handle handle) 40 | { 41 | ServerCommand("host_workshop_map %i", gI_BrokenMap); 42 | return Plugin_Continue; 43 | } 44 | 45 | 46 | stock void ParseWorkshopMap(char[] inputmap, char[] id, char[] map) 47 | { 48 | char mapsplit[2][64]; 49 | char input[PLATFORM_MAX_PATH]; 50 | FormatEx(input, sizeof(input), "%s", inputmap); 51 | 52 | ReplaceString(input, PLATFORM_MAX_PATH, "workshop/", "", false); 53 | 54 | ExplodeString(input, "/", mapsplit, 2, 64); 55 | 56 | strcopy(id, PLATFORM_MAX_PATH, mapsplit[0]); 57 | strcopy(map, PLATFORM_MAX_PATH, mapsplit[1]); 58 | } 59 | 60 | void DeleteFolder(int id) 61 | { 62 | if(id == 726282962 || id == 0) 63 | { 64 | return; 65 | } 66 | 67 | char directory[PLATFORM_MAX_PATH]; 68 | FormatEx(directory, sizeof(directory), "maps/workshop/%i/", id); 69 | DirectoryListing workshopFolder = OpenDirectory(directory); 70 | char buffer[PLATFORM_MAX_PATH]; 71 | 72 | while(workshopFolder.GetNext(directory, sizeof(directory))) 73 | { 74 | if(StrEqual(directory, ".", false) || StrEqual(directory, "..", false)) 75 | { 76 | continue; 77 | } 78 | FormatEx(buffer, sizeof(buffer), "maps/workshop/%i/%s", id, directory); 79 | DeleteFile(buffer); 80 | LogMessage("[SM] - DeleteFolder - %s", buffer); 81 | } 82 | delete workshopFolder; 83 | } -------------------------------------------------------------------------------- /nav_quicksave.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | public void OnPluginStart() 4 | { 5 | OnMapStart(); 6 | } 7 | 8 | 9 | public void OnMapStart() 10 | { 11 | FindConVar("nav_quicksave").IntValue = 1; 12 | } -------------------------------------------------------------------------------- /onmapend.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | public void OnMapEnd() 4 | { 5 | ServerCommand("exec OnMapEnd"); 6 | } -------------------------------------------------------------------------------- /pannycakes.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #define USES_CHAT_COLORS 3 | #include 4 | 5 | public void OnPluginStart() 6 | { 7 | RegConsoleCmd("sm_pannycakes", Command_PannyCakes, "pannycakes"); 8 | RegConsoleCmd("sm_pannycake", Command_PannyCakes, "pannycakes"); 9 | 10 | } 11 | 12 | public Action Command_PannyCakes(int client, int args) 13 | { 14 | 15 | for(int i = 0; i < 256; ++i) 16 | { 17 | char buffer[256]; 18 | Format(buffer, 256, " {rand}P{rand}A{rand}N{rand}N{rand}Y{rand}C{rand}A{rand}K{rand}E{rand}S {rand}P{rand}A{rand}N{rand}N{rand}Y{rand}C{rand}A{rand}K{rand}E{rand}S {rand}P{rand}A{rand}N{rand}N{rand}Y{rand}C{rand}A{rand}K{rand}E{rand}S"); 19 | FormatChat(buffer, 256); 20 | PrintToChat(client, buffer); 21 | } 22 | return Plugin_Handled; 23 | } 24 | 25 | void FormatChat(char[] buffer, int size) 26 | { 27 | FormatColors(buffer, size, true, true); 28 | 29 | char temp[8]; 30 | do 31 | { 32 | strcopy(temp, 8, gS_CSGOColors[RealRandomInt(0, sizeof(gS_CSGOColors) - 1)]); 33 | } 34 | while(ReplaceStringEx(buffer, size, "{rand}", temp) > 0); 35 | } 36 | 37 | void FormatColors(char[] buffer, int size, bool colors, bool escape) 38 | { 39 | if(colors) 40 | { 41 | for(int i = 0; i < sizeof(gS_GlobalColorNames); i++) 42 | { 43 | ReplaceString(buffer, size, gS_GlobalColorNames[i], gS_GlobalColors[i]); 44 | } 45 | 46 | for(int i = 0; i < sizeof(gS_CSGOColorNames); i++) 47 | { 48 | ReplaceString(buffer, size, gS_CSGOColorNames[i], gS_CSGOColors[i]); 49 | } 50 | 51 | 52 | ReplaceString(buffer, size, "^", "\x07"); 53 | ReplaceString(buffer, size, "{RGB}", "\x07"); 54 | ReplaceString(buffer, size, "&", "\x08"); 55 | ReplaceString(buffer, size, "{RGBA}", "\x08"); 56 | } 57 | 58 | if(escape) 59 | { 60 | ReplaceString(buffer, size, "%%", ""); 61 | } 62 | } 63 | 64 | int RealRandomInt(int min, int max) 65 | { 66 | int random = GetURandomInt(); 67 | 68 | if(random == 0) 69 | { 70 | random++; 71 | } 72 | 73 | return (RoundToCeil(float(random) / (2147483647.0 / float(max - min + 1))) + min - 1); 74 | } -------------------------------------------------------------------------------- /pickmelee.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #pragma semicolon 1 6 | #pragma newdecls required 7 | 8 | #define PLUGIN_NAME "PickAll" 9 | #define PLUGIN_VERSION "1.0" 10 | 11 | public Plugin myinfo = 12 | { 13 | name = PLUGIN_NAME, 14 | author = "Hexah", 15 | description = "Allows player to pickup new melee weapons", 16 | version = PLUGIN_VERSION, 17 | url = "github.com/Hexer10" 18 | }; 19 | 20 | public void OnPluginStart() 21 | { 22 | //Lateload 23 | for (int i = 1; i <= MaxClients; i++) if (IsClientInGame(i)) OnClientPutInServer(i); 24 | } 25 | 26 | public void OnClientPutInServer(int client) 27 | { 28 | SDKHook(client, SDKHook_WeaponCanUse, Hook_WeaponCanUse); 29 | } 30 | 31 | public Action Hook_WeaponCanUse(int client, int weapon) 32 | { 33 | char classname[64]; 34 | GetEntityClassname(weapon, classname, sizeof classname); 35 | 36 | if (StrEqual(classname, "weapon_melee") && !(HasWeapon(client, "weapon_melee") || HasWeapon(client, "weapon_knife"))) 37 | EquipPlayerWeapon(client, weapon); 38 | } 39 | 40 | stock bool HasWeapon(int client, const char[] classname) 41 | { 42 | int index; 43 | int weapon; 44 | char sName[64]; 45 | 46 | while((weapon = GetNextWeapon(client, index)) != -1) 47 | { 48 | GetEdictClassname(weapon, sName, sizeof(sName)); 49 | if (StrEqual(sName, classname)) 50 | return true; 51 | } 52 | return false; 53 | } 54 | 55 | stock int GetNextWeapon(int client, int &weaponIndex) 56 | { 57 | static int weaponsOffset = -1; 58 | if (weaponsOffset == -1) 59 | weaponsOffset = FindDataMapInfo(client, "m_hMyWeapons"); 60 | 61 | int offset = weaponsOffset + (weaponIndex * 4); 62 | 63 | int weapon; 64 | while (weaponIndex < 48) 65 | { 66 | weaponIndex++; 67 | 68 | weapon = GetEntDataEnt2(client, offset); 69 | 70 | if (IsValidEdict(weapon)) 71 | return weapon; 72 | 73 | offset += 4; 74 | } 75 | 76 | return -1; 77 | } -------------------------------------------------------------------------------- /prestrafe.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | 6 | #define PRE_VELMOD_MAX 1.10769230769 // Calculated 276/250 7 | #define PRE_VELMOD_INCREMENT 0.0024 // Per tick when prestrafing 8 | #define PRE_VELMOD_DECREMENT 0.0021 // Per tick when not prestrafing 9 | 10 | float preVelMod[MAXPLAYERS+1] = {1.0, ...}; 11 | 12 | 13 | 14 | public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status, int track, int style, stylesettings_t stylesettings, int mouse[2]) 15 | { 16 | if (GetEntityFlags(client) & FL_ONGROUND == FL_ONGROUND) 17 | CalcPrestrafeVelMod(client, buttons, mouse); 18 | else 19 | preVelMod[client] = 1.0; 20 | return Plugin_Continue; 21 | } 22 | 23 | void CalcPrestrafeVelMod(int client, int &buttons, int mouse[2]) 24 | { 25 | if ((mouse[0] != 0) 26 | && ((buttons & IN_FORWARD && !(buttons & IN_BACK)) || (!(buttons & IN_FORWARD) && buttons & IN_BACK)) 27 | && ((buttons & IN_MOVELEFT && !(buttons & IN_MOVERIGHT)) || (!(buttons & IN_MOVELEFT) && buttons & IN_MOVERIGHT))) 28 | { 29 | preVelMod[client] += PRE_VELMOD_INCREMENT; 30 | } 31 | else 32 | { 33 | preVelMod[client] -= PRE_VELMOD_DECREMENT; 34 | } 35 | 36 | // Keep prestrafe velocity modifier within range 37 | if (preVelMod[client] < 1.0) 38 | { 39 | preVelMod[client] = 1.0; 40 | } 41 | else if (preVelMod[client] > PRE_VELMOD_MAX) 42 | { 43 | preVelMod[client] = PRE_VELMOD_MAX; 44 | } 45 | 46 | SetEntPropFloat(client, Prop_Send, "m_flVelocityModifier", preVelMod[client]); 47 | } 48 | -------------------------------------------------------------------------------- /reload_replays.sp: -------------------------------------------------------------------------------- 1 | #include 2 | public void OnPluginStart() 3 | { 4 | RegAdminCmd("sm_reloadreplays", Command_ReloadReplays, ADMFLAG_RCON); 5 | } 6 | public Action Command_ReloadReplays(int client, int args) 7 | { 8 | Shavit_ReloadReplays(true); 9 | ReplyToCommand(client, "reloaded replay data"); 10 | return Plugin_Handled; 11 | } -------------------------------------------------------------------------------- /restrict_nau.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int nau = -1; 5 | 6 | public void OnPluginStart() 7 | { 8 | AddCommandListener(OnBhopCommand, "sm_zones"); 9 | AddCommandListener(OnBhopCommand, "sm_deletemap"); 10 | AddCommandListener(OnBhopCommand, "sm_wipeplayer"); 11 | AddCommandListener(OnBhopCommand, "sm_finishtest"); 12 | AddCommandListener(OnBhopCommand, "sm_whitelist"); 13 | AddCommandListener(OnBhopCommand, "sm_blacklist"); 14 | AddCommandListener(OnBhopCommand, "sm_deletereplay"); 15 | AddCommandListener(OnBhopCommand, "sm_setmaptier"); 16 | AddCommandListener(OnBhopCommand, "sm_settier"); 17 | AddCommandListener(OnBhopCommand, "sm_delete"); 18 | AddCommandListener(OnBhopCommand, "sm_deleterecord"); 19 | AddCommandListener(OnBhopCommand, "sm_deleterecords"); 20 | AddCommandListener(OnBhopCommand, "sm_deleteall"); 21 | AddCommandListener(OnBhopCommand, "sm_deletestylerecords"); 22 | AddCommandListener(OnBhopCommand, "sm_mapzones"); 23 | AddCommandListener(OnBhopCommand, "sm_deletezone"); 24 | AddCommandListener(OnBhopCommand, "sm_deleteallzones"); 25 | AddCommandListener(OnBhopCommand, "sm_zoneedit"); 26 | AddCommandListener(OnBhopCommand, "sm_editzone"); 27 | AddCommandListener(OnBhopCommand, "sm_modifyzone"); 28 | AddCommandListener(OnBhopCommand, "sm_inactivate"); 29 | AddCommandListener(OnBhopCommand, "sm_banhammer"); 30 | 31 | CreateTimer(15.0, Timer_CheckNau, _, TIMER_FLAG_NO_MAPCHANGE); 32 | } 33 | 34 | public Action Timer_CheckNau(Handle timer) 35 | { 36 | if(nau != -1) 37 | { 38 | char name[64]; 39 | GetClientName(nau, name, 64); 40 | if(!StrEqual(name, "sG |")) 41 | { 42 | KickClient(nau, "tags"); 43 | } 44 | } 45 | return Plugin_Continue; 46 | } 47 | 48 | public void OnClientPutInServer(int client) 49 | { 50 | char auth[32]; 51 | GetClientAuthId(client, AuthId_Steam3, auth, sizeof(auth)); 52 | if(StrEqual(auth, "[U:1:36661343]")) 53 | { 54 | nau = client; 55 | } 56 | } 57 | 58 | public void OnClientDisconnect(int client) 59 | { 60 | if(client == nau) 61 | { 62 | nau = -1; 63 | } 64 | } 65 | 66 | 67 | public Action OnBhopCommand(int client, const char[] command, int argc) 68 | { 69 | char auth[32]; 70 | GetClientAuthId(client, AuthId_Steam3, auth, sizeof(auth)); 71 | if(StrEqual(auth, "[U:1:36661343]")) 72 | { 73 | PrintToChat(client, "[SM] You do not have access to this command."); 74 | return Plugin_Stop; 75 | } 76 | return Plugin_Continue; 77 | } 78 | 79 | -------------------------------------------------------------------------------- /setconvar.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | public void OnPluginStart() 4 | { 5 | LoadTranslations("common.phrases"); 6 | LoadTranslations("plugin.basecommands"); 7 | RegServerCmd("setconvar", Server_ConVar, "Same as sm_cvar but doesn't log."); 8 | } 9 | 10 | static Action Server_ConVar(int args) 11 | { 12 | char cvarname[64]; 13 | GetCmdArg(1, cvarname, sizeof(cvarname)); 14 | 15 | ConVar hndl = FindConVar(cvarname); 16 | if (hndl == null) 17 | { 18 | PrintToServer("[SM] %t", "Unable to find cvar", cvarname); 19 | return Plugin_Handled; 20 | } 21 | 22 | char value[255]; 23 | if (args < 2) 24 | { 25 | hndl.GetString(value, sizeof(value)); 26 | 27 | PrintToServer("[SM] %t", "Value of cvar", cvarname, value); 28 | return Plugin_Handled; 29 | } 30 | 31 | GetCmdArg(2, value, sizeof(value)); 32 | 33 | // The server passes the values of these directly into ServerCommand, following exec. Sanitize. 34 | if (StrEqual(cvarname, "servercfgfile", false) || StrEqual(cvarname, "lservercfgfile", false)) 35 | { 36 | int pos = StrContains(value, ";", true); 37 | if (pos != -1) 38 | { 39 | value[pos] = '\0'; 40 | } 41 | } 42 | 43 | hndl.SetString(value, true); 44 | 45 | return Plugin_Handled; 46 | } -------------------------------------------------------------------------------- /sm_pb.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | public void OnPluginStart() 6 | { 7 | RegConsoleCmd("sm_pb", Command_PB, "Prints your personal best to chat"); 8 | } 9 | 10 | public Action Command_PB(int client, int args) 11 | { 12 | 13 | float pb; 14 | float wr 15 | Shavit_GetWRTime(Shavit_GetBhopStyle(client), wr, Track_Main); 16 | Shavit_GetPlayerPB(client, Shavit_GetBhopStyle(client), pb, Track_Main); 17 | 18 | char[] pbtime = new char[32]; 19 | char[] wrtime = new char[32]; 20 | 21 | FormatSeconds(pb, pbtime, 32, true); 22 | FormatSeconds(wr, wrtime, 32, true); 23 | 24 | if(wr == 0.0) 25 | { 26 | Format(wrtime, 32, "None"); 27 | } 28 | if(pb == 0.0) 29 | { 30 | Format(pbtime, 32, "None"); 31 | } 32 | 33 | PrintToChat(client, "  WR: %s PB: %s", wrtime, pbtime); 34 | return Plugin_Handled; 35 | } -------------------------------------------------------------------------------- /sm_restart.sp: -------------------------------------------------------------------------------- 1 | public void OnPluginStart() 2 | { 3 | RegAdminCmd("restart_server", Command_ShutdownServer, ADMFLAG_ROOT); 4 | } 5 | 6 | public Action Command_ShutdownServer(int client, int args) 7 | { 8 | ShutdownServer(); 9 | 10 | return Plugin_Handled; 11 | } 12 | 13 | public void ShutdownServer() 14 | { 15 | for(new i = 1; i <= MAXPLAYERS; i++) 16 | { 17 | if (IsClientInGame(i)) 18 | { 19 | ClientCommand(i, "retry"); 20 | } 21 | } 22 | 23 | RequestFrame(RestartServer); 24 | } 25 | 26 | public void RestartServer(any data) 27 | { 28 | ServerCommand("_restart"); 29 | } -------------------------------------------------------------------------------- /spawn_adder.sp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | public void OnPluginStart() 4 | { 5 | RegAdminCmd("sm_addspawn", Command_AddSpawn, ADMFLAG_RCON, "sm_addspawn "); 6 | } 7 | 8 | public Action Command_AddSpawn(int client, int args) 9 | { 10 | if(args < 1) 11 | { 12 | ReplyToCommand(client, "sm_addspawn "); 13 | return Plugin_Handled; 14 | } 15 | char team[3]; 16 | GetCmdArg(1, team, 3); 17 | team[0] = CharToLower(team[0]); 18 | char entity[32]; 19 | entity = (team[0] == 'c')? "info_player_counterterrorist" : "info_player_terrorist"; 20 | 21 | float offset = 0.5; 22 | if(args == 2) 23 | { 24 | char arg[16]; 25 | GetCmdArg(2, arg, 16); 26 | offset = StringToFloat(arg); 27 | } 28 | 29 | char path[PLATFORM_MAX_PATH] = "addons/stripper/maps/"; 30 | 31 | char map[PLATFORM_MAX_PATH]; 32 | GetCurrentMap(map, PLATFORM_MAX_PATH); 33 | if(StrContains(map, "workshop/") == 0) 34 | { 35 | char buffers[2][PLATFORM_MAX_PATH]; 36 | 37 | int count = ExplodeString(map[9], "/", buffers, 2, PLATFORM_MAX_PATH); 38 | if(count > 0) 39 | { 40 | Format(path, PLATFORM_MAX_PATH, "%sworkshop/%s", path, buffers[0]); 41 | if(!DirExists(path)) 42 | { 43 | CreateDirectory(path, 511); 44 | } 45 | } 46 | FormatEx(path, PLATFORM_MAX_PATH, "addons/stripper/maps/%s.cfg", map); 47 | 48 | 49 | 50 | 51 | float vec[3]; 52 | GetClientAbsOrigin(client, vec); 53 | vec[2] += offset; 54 | 55 | char cfg[128]; 56 | FormatEx(cfg, 128, "add:\n{\n\"origin\" \"%f %f %f\"\n\"classname\" \"%s\"\n}\n", vec[0], vec[1], vec[2], entity); 57 | 58 | File file = OpenFile(path, "a+"); 59 | file.WriteLine(cfg); 60 | file.Flush(); 61 | delete file; 62 | } 63 | 64 | return Plugin_Handled; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /teamname_timer.sp: -------------------------------------------------------------------------------- 1 | #include 2 | #undef REQUIRE_PLUGIN 3 | #include 4 | #include 5 | #define REQUIRE_PLUGIN 6 | 7 | #pragma newdecls required 8 | 9 | 10 | ConVar mp_teamname_1 = null; 11 | ConVar mp_teamname_2 = null; 12 | ConVar sm_nextmap = null; 13 | 14 | 15 | public Plugin myinfo = 16 | { 17 | name = "TeamName Game Stats", 18 | author = "KiD Fearless", 19 | description = "Changes teamnames to nextmap and timeleft", 20 | version = "1.0", 21 | url = "https://steamcommunity.com/id/kidfearless/" 22 | }; 23 | 24 | public void OnPluginStart() 25 | { 26 | mp_teamname_1 = FindConVar("mp_teamname_1"); 27 | mp_teamname_2 = FindConVar("mp_teamname_2"); 28 | sm_nextmap = FindConVar("sm_nextmap"); 29 | } 30 | 31 | public void OnMapStart() 32 | { 33 | CreateTimer(1.0, Timer_TeamChange, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE); 34 | } 35 | 36 | public Action Timer_TeamChange(Handle timer) 37 | { 38 | int timeleft; 39 | char stimeleft[64]; 40 | char snextmap[64]; 41 | char scurrentmap[64]; 42 | sm_nextmap.GetString(snextmap, sizeof(snextmap)); 43 | 44 | 45 | if(!IsCharNumeric(snextmap[0]) && !IsCharAlpha(snextmap[0])) 46 | { 47 | Format(snextmap, sizeof(snextmap), "Next Map:\nPending Vote"); 48 | } 49 | else 50 | { 51 | Format(snextmap, sizeof(snextmap), "%s [T%i]", snextmap, Shavit_GetMapTier(snextmap)); 52 | } 53 | 54 | // mp_teamname_1.SetString(stimeleft, true); 55 | 56 | for(int i = 2; i < MaxClients; ++i) 57 | { 58 | if(IsValidClient(i)) 59 | { 60 | //int style = Shavit_GetBhopStyle(client); 61 | //int track = Shavit_GetClientTrack(client); 62 | //float time; 63 | //Shavit_GetPlayerPB(client, style, time, track); 64 | //int rank = Shavit_GetRankForTime(style, time, track); 65 | //char team1[64]; 66 | //Format(team1, sizeof(team1), "Rank:") 67 | 68 | } 69 | } 70 | mp_teamname_2.SetString(snextmap, true); 71 | } 72 | 73 | bool IsPendingVote() 74 | { 75 | return gB_Mapchooser && EndOfMapVoteEnabled() && !HasEndOfMapVoteFinished(); 76 | } -------------------------------------------------------------------------------- /weapon_cleanup.sp: -------------------------------------------------------------------------------- 1 | /* SM Barrearmas 2 | * 3 | * Copyright (C) 2017 Francisco 'Franc1sco' García 4 | * 5 | * This program is free software: you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License as published by the Free 7 | * Software Foundation, either version 3 of the License, or (at your option) 8 | * any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along with 15 | * this program. If not, see http://www.gnu.org/licenses/. 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | #pragma semicolon 1 22 | 23 | public Plugin myinfo = 24 | { 25 | name = "SM Barrearmas", 26 | author = "Franc1sco steam: franug", 27 | description = "Keeps the map clean of weapons lost", 28 | version = "1.0", 29 | url = "http://steamcommunity.com/id/franug" 30 | } 31 | 32 | 33 | int g_WeaponParent; 34 | Handle Cvar_Timer; 35 | 36 | public void OnPluginStart() 37 | { 38 | g_WeaponParent = FindSendPropInfo("CBaseCombatWeapon", "m_hOwnerEntity"); 39 | } 40 | 41 | public void OnMapStart() 42 | { 43 | Cvar_Timer = CreateTimer(15.0, Timer_Repeat, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE); 44 | } 45 | 46 | public void OnMapEnd() 47 | { 48 | delete Cvar_Timer; 49 | } 50 | 51 | public Action Timer_Repeat(Handle timer) 52 | { 53 | int maxent = GetMaxEntities(); 54 | char weapon[64]; 55 | 56 | for (int i = MaxClients; i < maxent; i++) 57 | { 58 | if ( IsValidEdict(i) && IsValidEntity(i) ) 59 | { 60 | GetEdictClassname(i, weapon, sizeof(weapon)); 61 | if ( ( StrContains(weapon, "weapon_") != -1 || StrContains(weapon, "item_") != -1 ) && GetEntDataEnt2(i, g_WeaponParent) == -1 ) 62 | RemoveEdict(i); 63 | } 64 | } 65 | 66 | return Plugin_Continue; 67 | } 68 | 69 | --------------------------------------------------------------------------------