AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Dev Cmds (1.50) [05-Mar-2024] (https://forums.alliedmods.net/showthread.php?t=187566)

Silvers 06-15-2012 00:51

[ANY] Dev Cmds (1.50) [05-Mar-2024]
 
62 Attachment(s)
Thanks:
  • Dont Fear The Reaper - Helped testing and slay code for L4D2.
  • disawar1 - Testing and smlib code for sm_box.
  • Dragokas - Providing code for several vector commands.
  • bubbabyte



Commands: (require "z" root admin flag)
  • Plugins:
PHP Code:

sm_refresh // Refresh plugins (same as "sm plugins refresh").
sm_renew // Unload and Refresh plugins (same as "sm plugins unload_all; sm plugins refresh").
sm_unload // Unload all plugins (same as "sm plugins unload_all"). 

  • General:
PHP Code:

sm_round // Executes 'mp_restartgame 1' to restart round
sm_cheats // Toggles sv_cheats.
sm_logit <text// Logs specified text to "sourcemod/logs/sm_logit.txt".
sm_gametime // Displays the GetGameTime() float.
sm_uptime // Displays how long the server has been up. Maybe inaccurate if server hibernation is active.
sm_playtime // Displays how long players have been playing on the server.
sm_changes // Displays how many map changes have occurred.
sm_createent <classname// Creates and removes the entity classname, reports success. 

  • Cvars / Commands / Fake Client Command:
PHP Code:

sm_cv <cvar> [value// Get/Set cvar value without the notify flag.
cv <cvar> [value// Get/Set cvar value without the notify flag.
sm_e <command> [args// Executes a cheat command.
<command> [args// Executes a cheat command.
sm_ccmd <#userid|name> <command> [args] // Executes a client command on the target you specify.
sm_fcmd <#userid|name> <command> [args] // Executes a fake client command on the target you specify.
sm_scmd // Executes a server command.
sm_rngc <0-100> <command string// chance out of 100 to execute the command string, client command.
sm_rngf <0-100> <command string// chance out of 100 to execute the command string, fake client command.
sm_rngs <0-100> <command string// chance out of 100 to execute the command string, server command. 

  • In-game View/Position stuff:
PHP Code:

sm_views // Saves your current position and eye angles.
sm_viewr // Teleports you to the saved position and eye angles.
sm_pos // Displays your position vector.
sm_aimpos // Displays the position vector where your crosshair is aiming.
sm_setang <#userid|name> <vector ang> // Teleport someone to the x y z angle vector specified.
sm_setpos <#userid|name> <vector ang> // Teleport someone to the x y z angle vector specified.
sm_bringents <classname> [distance: (default 50)] // Teleport specified entities by classname to around the player. E.G. sm_bringents weapon_rifle.
sm_tel <vector pos> [vector ang// Teleport yourself to the x y z vector specified.
sm_tele <#userid|name> [x y z vecctor pos] // Teleport specified targets to aim location or to the x y z origin vector specified.
sm_range [entity// Shows how far away an object is that you're aiming at, or optional arg to specify an entity index.
sm_near // Lists all nearby entities within the specified range. Usage sm_near: [range].
sm_dist // Enter twice to measure distance between the origins you stand on.
sm_distdir // Get distance between you and end point of direction you are looking at (considering collision).
sm_distfloor // Get distance between you and floor below you (considering collision).
sm_distroof // Get distance between you and roof above your head (considering collision).
sm_size // Get sizes (Width, Length, Heigth) of your player.
sm_sizee // Get sizes (Width, Length, Heigth) of the entity you are looking at. 

  • Entity Info / Delete / Entity and Model Lists etc:
PHP Code:

sm_del // Deletes the entity your crosshair is over.
sm_dele <entity// Deletes the entity you specify.
sm_delents // <classname> Delete all the entities of a specific classname.
sm_ent // Displays info about the entity your crosshair is over.
sm_ente <entity// Displays info about the entity you specify.
sm_vertex [entity// Displays vMaxs and vMins bounding box about the specified entity or aimed at entity.
sm_box [entity// Displays a beam box around the specified entity or aimed at entity for 10 seconds.
sm_find <classname> <maxdist// List entity indexes from the given classname.
sm_findname <targetname// List entity indexes from a partial targetname.
sm_count // Displays a list of all spawned entity classnames and count. Optional sm_count <classname>
sm_modlist // Saves a list of all the models used on the current map to "sourcemod/logs/models_<MAPNAME>.txt".
sm_collision [entity// Toggles collision on the aimed entity or specified entity index.
sm_anim [sequence// Show aimed entities animation sequence number until toggled again or your own if not aimed at entity. Optionally, it can set sequence. Checks every frame and reports changes.
sm_weapons [client index// Lists players weapons and indexes. Either yourself, or aim target or optional index via cmd args.
sm_wearables [client index// Lists players cosmetics indexes and definitions. Either yourself, or aim target or optional index via cmd args.
sm_attachments [#userid|name] or [entity index] // Displays a list of attachments on the specified clients. No args = self.
sm_viewmodel [#userid|name] // Returns a clients viewmodel entity index, or no args = self.
sm_delweps <#userid|name> // delete weapons from targeted clients, or no args = self.
sm_getspeed <#userid|name> // Get the speed of the specified clients.
sm_clients // Lists client indexes/userids and some other data.");s client indexes/userids and some other data.
sm_users // Prints the total amount of bots and clients who had connected and the last UserID to have connected.
sm_ice [entity// Freeze / unfreeze aim target or specified entity.
sm_damage <client index// to track damage info dealt to this client or by this client. Use -1 or empty to track everybody.
sm_solid <flags// Returns the SolidType_t flags from a flag value.
sm_solidf <flags// Returns the SolidFlags_t flags from a flag value.
sm_dmg <flags// Returns the SDKHooks DamageType from a flag value.
sm_val <bit value// E.g: sm_val 1<<20. Returns: 1048576
sm_bit <bit value// E.g: sm_bit 1048577. Returns: (1<<0); (1<<20)
sm_adm // Toggles between ROOT and BAN admin flags, for testing stuff without ROOT access. Or specified flags e.g. Usage: sm_adm BAN KICK
sm_hexcols // Print a list of hex colors to chat. 

  • Entity Properties - Prop_Data (sm_dump_datamaps) and Prop_Send (sm_dump_netprops):
PHP Code:

// You can also use "m_iAmmo.004" for example to get the 4th member index of "m_iAmmo".
sm_gamerules <prop> [value// Affects the gamerules proxy.
sm_prop <prop> [value// Affects the entity you aim at.
sm_propent <entity> or <#userid|name> <prop> // Affects the specified entity.
sm_propself <prop> [value// Affects yourself.
sm_propi <prop> [value// Affects yourself. 

  • Entity Inputs and Outputs:
PHP Code:

sm_input <input> [param] [activator] [caller// Makes the entity you're aiming at accept an Input. Optionally give a param, e.g. sm_input color "255 0 0".
sm_inputent <entity|targetname> <input> [param] [activator] [caller// Makes the specified entity accept an Input. Optionally give a param, e.g. sm_inputent 5 color "255 0 0".
sm_inputme <input> [param] [activator] [caller// Makes you accept an entity Input. Optionally give a param, e.g. sm_inputme color "255 0 0".
sm_output <output// Watches the specified output on the entity aimed at.
sm_outputent <entity> <output// Watches the specified entity and specified output.
sm_outputme <output// Watches the specified output on yourself.
sm_outputstop // Stops watching all entity outputs.
sm_emit // <sound path and filename> Plays a sound from your client. For testing sounds.
sm_listens // Toggle to start/stop listening to sounds being played. Displays messages in chat to everyone.
sm_newbot // Create new bot client. 

  • Particles:
PHP Code:

sm_part <name// Displays a particle you specify. Automatically removed after 5 seconds.
sm_parti <name// Displays a particle where you are pointing. Automatically removed after 5 seconds. 

  • L4D / L4D2 Specific:
PHP Code:

sm_lobby // Calls a vote (public command access).
sm_ledge // Enables/Disables ledge hanging.
sm_spit [#userid|name] // Toggles spitter goo dribble on self (with no args) or specified targets.

sm_alloff // Toggles - AI director on/off, z_common_limit, sb_hold.
sm_director // Toggles - AI director on/off.
sm_hold // Toggles sb_hold - Stop the survivor bots moving but allows them to shoot.
sm_halt // Toggles sb_stop - Stops the survivor bots from moving and shooting.
sm_nb // Toggles nb_stop - Stops all survivors/specifial infected from moving.

sm_nospawn // Prevents all types of infected from spawning
sm_zspawnv // SSpawn infected and special infected specifying pos and ang. Usage sm_zspawnv <boomer|hunter|smoker|spitter|jockey|charger|tank|witch|infected> <pos X> <pos Y> <pos Z>  ( [modelname] [skin] || [ang X] [ang Y] [ang Z] [modelname] [skin] ).
sm_bots // Creates a new Survivor bot
sm_slayall // Slays all common and special infected and witches
sm_slaycommon // Slays all common infected.
sm_slaywitches // Slays all witches.
sm_stopang // Freeze current angle of all survivor bot players.

sm_c // Sets the game mode to Coop.
sm_r // Sets the game mode to Realism.
sm_s // Sets the game mode to Survival.
sm_v // Sets the game mode to Versus. 

  • CSS / L4D / L4D2 Specific:
PHP Code:

sm_nv [#userid|name] // Toggles nightvision. 

  • CSS Specific:
PHP Code:

sm_bots // Opens a menu to spawn bots.
sm_money // Opens a menu of players, sets 16000 money. 




Changes:
Code:

1.50 (05-Mar-2024)
    - Added a few more "m_h*" variables to read the entity index instead of reference number. Probably only for L4D/2 series.

1.49 (22-Nov-2023)
    - Added command "sm_delents" to delete entities of a certain classnames. Allows using * wildcard to match various entities for example "weapon_*" can be used.
    - Changed command "sm_near" to also show the targetname.

1.48 (19-Feb-2023)
    - Added command "sm_hexcols" to print a list of hex colors to chat. Requested by "Marttt".

1.47 (10-Jan-2023)
    - Added command "sm_gamerules" to read/write to the gamerules proxy.
    - Added support for reading/writing to GameRules. Thanks to "Marttt" for the initial code. Requested by "caxanga334".
    - Plugin now requires SourceMod 1.11 or newer. Using some natives that only appear in SM 1.11.

1.46 (28-Oct-2022)
    - Added command "sm_vertex" to display the vecMins and vecMaxs of an entity.
    - Fixed command "sm_listens" to displaying full details.
    - L4D1/2: Fixed "sm_zspawnv" not pre-caching Special Infected models, also validates model paths and attempts to cache unknown ones. Thanks to "Tonblader" for reporting.

1.45 (10-Aug-2022)
    - Changed command "sm_del" to no longer delete clients.

1.44 (17-Jul-2022)
    - Fixed compile warnings on SM 1.11 when using SMLib.

1.43 (16-Jul-2022)
    - Changed "sm_prop*" commands to allow editing members elements for example "m_iAmmo.005" to modify element array 005. Requested by "Sreaper".
    - Added list of known entity property keys to better get or set their values.

1.42 (01-Aug-2022)
    - Fixed command "sm_clients" throwing an error if a client was not in game.

1.41 (24-Jun-2022)
    - Fixed command "sm_playtime" not showing playtime when the server is empty.

1.40 (24-Jun-2022)
    - Fixed command "sm_playtime" sometimes breaking and not showing any playtime.

1.39 (20-Jun-2022)
    - Added command "sm_playtime" to show how long players have been playing.
    - Changed command "sm_clients" formatting to be clearer.

1.38 (09-Jun-2022)
    - Added command "sm_changes" to show how many map changes have occurred.

1.37 (03-Jun-2022)
    - Fixed command "sm_uptime" not displaying the correct time.

1.36 (03-Jun-2022)
    - Changed the method for the command "sm_uptime" to show since the plugin was loaded since GetGameTime() resets to 0.0 on map change.

1.35 (01-Jun-2022)
    - Added command "sm_aimpos" to get the vector position where the crosshair is aiming.
    - Added command "sm_uptime" to display how long the server has been up. Thanks to "Impact123" for the code: https://forums.alliedmods.net/showthread.php?t=182012

1.34 (10-May-2022)
    - Reverted command "sm_prop*" to before last update, removing the "m_h" check in the keynames, due to breaking non-entity fields.

1.33 (25-Apr-2022)
    - Changed commands "sm_prop*" to get or set entity indexes which contain "m_h" in the keyname. Requested by "Sreaper".
    - Changed command "sm_users" to count the last UserID better.

1.32 (10-Apr-2022)
    - Changed command "sm_ent" to allow aiming at clients. Requested by "Sreaper".
    - Changed command "sm_weapons" to include the currently held object/item/weapon.

1.31 (14-Dec-2021)
    - Added command "sm_users" to report total bots and clients that connected and the last UserID index.
    - Changed command "sm_listens" to output more information about sounds. Thanks to "Marttt" for writing.

1.30 (23-Nov-2021)
    - Blocked various in-game commands from being used on the server.
    - Changed various commands to use "ReplyToCommand". Requested by "Dragokas".

1.29 (10-Nov-2021)
    - Added command "sm_viewmodel" to return a clients viewmodel entity index.
    - Changed command "sm_attachments" to display attachments on entities. Requested by "Marttt".
    - Fixed command "sm_dele" crashing the server when no entity was provided. Thanks to "Marttt" for reporting.

1.28 (06-Nov-2021)
    - Fixed possible invalid entity when using "sm_propent". Thanks to "Shku" for reporting.

1.27 (04-Nov-2021)
    - Added command "sm_rngc" to randomly execute specified commands if the chance is met, client command. Requested by "Tonblader".
    - Added command "sm_rngf" to randomly execute specified commands if the chance is met, fake client command. Requested by "Tonblader".
    - Added command "sm_rngs" to randomly execute specified commands if the chance is met, server command. Requested by "Tonblader".
    - Added command "sm_wearables" for TF2 to list a players cosmetic items. Requested by "Shku".
    - Changed "sm_propent" to accept target filters. Thanks to "Maliwolf" for coding.

1.26 (27-Oct-2021)
    - Added command "sm_tele" to teleport clients to aim position or specific vector. Requested by "Dragokas".
    - Added command "sm_collision" to toggle collision on a specified entity. Requested by "canadianjeff". Thanks to "Dragokas" for the stock.
    - Added commands "sm_solid" and "sm_solidf" to return the solid type and solid flags from a value.
    - L4D1 & L4D2: Changed command "sm_nospawn" to block common spawning. Thanks to "Dragokas" for reporting.

1.25 (13-Sep-2021)
    - Added command "sm_getspeed" to return a players current speed value.
    - Added command "sm_listens" to toggle printing all sounds being played.
    - Added command "sm_delweps" to delete weapons from yourself or the targeted clients.
    - Added command "sm_bringents" to teleport specified entities by classname to around the player.
    - L4D2: Added command "sm_sc" to change the gamemode to Scavenge.

1.24 (06-Sep-2021)
    - Added command "sm_attachments" to display all attachments on a specific client.
    - Added command "sm_emit" to play a sound from your client.

1.23 (11-Aug-2021)
    - Added commands "sm_bit" and "sm_val" to get and return values from: "1<<20" to "1048576" and "1048577" to "(1<<0); (1<<20)" for example.
    - Added command "sm_dmg" to return SDKHooks damage flags from a value. For example "sm_dmg 9" returns "DMG_CRUSH (1<<0); DMG_BURN (1<<3)".
    - Added command "sm_adm" to toggle between ROOT and BAN admin flags (or specified target flags). Requires ROOT to work. E.g: "sm_adm BAN KICK".
    - Changed command "sm_anim" to watch sequence numbers on every frame and display only when they change, until toggled off.

1.22 (29-Jul-2021)
    - L4D1 & L4D2: Changed command "sm_zspawnv" to accept a skin parameter for the models.

1.21 (25-Jul-2021)
    - L4D1 & L4D2: Changed command "sm_zspawnv" to accept the modelname. This does not precache the model and a server crash possible for non-cached models. Requested by "Tonblader".
    - Usage: "sm_zspawnv boomer posX posY posZ modelname" or "sm_zspawnv boomer posX posY posZ andX angY andZ modelname". Modelname is optional.

1.20 (22-Jul-2021)
    - L4D1 & L4D2: Fixed command "sm_zspawnv" not spawning in the correct direction. Thanks to "Tonblader" for reporting.

1.19 (05-Jul-2021)
    - L4D1 & L4D2: Added command "sm_bots" to spawn a Survivor bot.

1.18 (04-Jul-2021)
    - Removed requirement of being alive for some commands: "sm_ccmd", "sm_fcmd", "sm_nv", "sm_ledge". Thanks to "noto3" for reporting.

1.17 (01-Jul-2021)
    - L4D1 and L4D2: Added command "sm_zspawnv" to spawn infected and special infected specifying pos and ang. Requested by "Tonblader" and "nataa123".

1.16 (16-Jun-2021)
    - Changed commands "sm_setang", "sm_setpos", "sm_tel" and "sm_viewr" and set speed to 0 on teleport. Requested by "Tonblader".

1.15 (15-Feb-2021)
    - Changed "sm_count" to accept a classname to search for. Requested by "canadianjeff".

1.14 (30-Sep-2020)
    - Fixed compile errors on SM 1.11.

1.13 (20-Sep-2020)
    - Added command "sm_setpos" to set target(s) origin position. Requested by "Tonblader".
    - Fixed command "sm_cheats" not working in all games.
    - Increased model string length for "sm_ent" and "sm_ente" commands.

1.12 (07-Jun-2020)
    - Added command "sm_setang" to set target(s) view angles. Requested by "Tonblader".

1.11 (10-May-2020)
    - Various changes to tidy up code.

1.10 (25-Mar-2020)
    - Changed "sm_range" to add an optional arg for specifying an entity.
    - Fixed command "sm_cheats" not toggling "sv_cheats".
    - Some text changes from previously added commands.

1.9 (19-Mar-2020)
    Update with changes provided by "Dragokas":
    - Added command "sm_ice" to freeze any client/entity from moving.
    - Changed command "sm_anim" to allow getting the sequence for a specified entity.
    - Fixed command "sm_stopang" from not repeating.
    - Fixed commands "sm_halt", "sm_hold" and "sv_cheats" from not accurately detecting the cvar setting being changed.

1.8 (02-Mar-2020)
    Update by "Dragokas":
    - Appended "sm_find" <classname> <maxdist> (2nd argument filters entities located in specified radius).
    - Added command "sm_damage" <client> - to track damage info dealt to this client or by this client. Use -1 or empty to track everybody.
    - (L4D & L4D2) Added command "sm_nospawn" to prevent all types of infected from spawning.
    - (L4D & L4D2) Added command "sm_slayall" to slay all common and special infected and witches.

    Update by "Silvers":
    - Added command "sm_scmd" to execute a server command.
    - Changed command "sm_count" to work better and sort the classnames list.

1.7 (02-Nov-2019)
    - Fixed copy paste error preventing the plugin from compiling. Thanks to "eyal282" for reporting.

1.6 (01-Nov-2019)
    - Changed "sm_input", "sm_inputent" and "sm_inputme" to accept activator and caller params.
    - Fixed commands "sm_ledge", "sm_spit" and "sm_nv" failing with ProcessTargetString. Thanks to "Marttt".

1.5 (30-Oct-2019)
    - Added command "sm_clients" to list client indexes/userids and some other data.
    - Added command "sm_weapons" to list your own weapons or that of the target you're aiming at or specified index by command arg.
    - Added command "sm_range" to find how far away an object is.
    - Added command "sm_near" to list nearby object classnames.
    - Added various vector commands  provided by "Dragokas": "sm_dist", "sm_distdir", "sm_distfloor", "sm_distroof", "sm_size", "sm_sizee".
    - Changed "sm_ent" and "sm_ente" to add more info. Provided by "Marttt".
    - Changed "sm_box" laser outlines to use smlib draw box with correct angles matrix rotation. Provided by "disawar1".
    - The "sm_box" changes work when the smlib include is present, or defaults to old version, no edits required.
    - Various fixes and changes.

1.4.1 (28-Jun-2019)
    - Changed PrecacheParticle method.

1.4 (01-Jun-2019)
    - Added "sm_anim" to show your players animation sequence number (for 6 * 0.5 seconds).
    - Changed "sm_tel" to also accept angles when teleporting.
    - Changed "sm_ente" to work from the server console.

1.3 (05-May-2018)
    - Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.

1.2 (09-Aug-2013)
    - Reverted the change to "sm_alloff".
    - Changed "sm_fcmd" to allow command arguments, Usage: sm_fcmd <#userid|name> <command> [args].

1.1 (22-Jun-2012)
    - Added "sm_findname" to list entities by matching a partial targetname.
    - Changed "sm_modlist" to save the file as "models_mapname.txt".
    - Changed "sm_input", "sm_inputent" and "sm_inputme" to accept parameters.
    - Changed "sm_alloff" to not toggle the director or sb_hold_position.
    - Fixed "sm_find" throwing errors for non-networked entities.

1.0 (15-Jun-2012)
    - Initial release.




Optional Include:
  1. The sm_box command can use SMLib when the <smlib> include is detected on compiling the plugin.
  2. Download SMLib here: for new syntax or old syntax



Requirements:
  • SourceMod 1.11 or newer.


Installation:
  1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.

Visual77 06-15-2012 03:18

Re: [ANY] Dev Cmds (1.0) [15-Jun-2012]
 
Some handy commands. Thanks

Leonardo 06-15-2012 04:48

Re: [ANY] Dev Cmds (1.0) [15-Jun-2012]
 
Quote:

Originally Posted by Silvers (Post 1729015)
Code:
sm_modlist                    // Saves a list of all the models used on the current map to "sourcemod/logs/models.txt".

why not "models_<mapname>.txt"?

Silvers 06-15-2012 04:53

Re: [ANY] Dev Cmds (1.0) [15-Jun-2012]
 
Quote:

Originally Posted by Leonardo (Post 1729099)
why not "models_<mapname>.txt"?

Because I didn't think. I only used that command a few times in the past and never needed again. Will change in a future update.

Leonardo 06-15-2012 06:50

Re: [ANY] Dev Cmds (1.0) [15-Jun-2012]
 
also
are you planning to add command to change gamemode to the some mutation?

Silvers 06-15-2012 07:08

Re: [ANY] Dev Cmds (1.0) [15-Jun-2012]
 
For L4D/2? No, that's what I made Vote Mode for: http://forums.alliedmods.net/showthread.php?t=179279

Leonardo 06-15-2012 08:08

Re: [ANY] Dev Cmds (1.0) [15-Jun-2012]
 
ah ok

Silvers 06-22-2012 03:10

Re: [ANY] Dev Cmds (1.1) [22-Jun-2012]
 
Plugin updated:

1.1 (22-Jun-2012)
- Added "sm_findname" to list entities by matching a partial targetname.
- Changed "sm_modlist" to save the file as "models_mapname.txt".
- Changed "sm_input", "sm_inputent" and "sm_inputme" to accept parameters.
- Changed "sm_alloff" to not toggle the direction or sb_hold_position.
- Fixed "sm_find" throwing errors for non-networked entities.

disawar1 06-22-2012 13:10

Re: [ANY] Dev Cmds (1.1) [22-Jun-2012]
 
Very useful спасибо :)

starstrucktiger 06-11-2014 09:44

Re: [ANY] Dev Cmds (1.2) [09-Aug-2013]
 
How exactly do you use the createent command? I create an entity, and it says success. But it doesn't really let me set a model or anything.


All times are GMT -4. The time now is 00:09.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.