Raised This Month: $ Target: $400
 0% 

[Any] EntHax - 0.08 - 2016/12/1


Post New Thread Reply   
 
Thread Tools Display Modes
Author
cheddar
Member
Join Date: Sep 2015
Plugin ID:
5432
Plugin Version:
0.08
Plugin Category:
Technical/Development
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Gets/Sets Entity Properties in Game
    Old 11-30-2016 , 01:55   [Any] EntHax - 0.08 - 2016/12/1
    Reply With Quote #1


    [Any] EntHax
    Version 0.08

    Description:
    Small plugin designed for server admins and developers that want to peek into what a maps entities are and change their values in game. Get/Set Float/Int property values for entities from your console.
    Features:
    1. Gets Entity Indices based on Classname
      -- If you want to find the entity index for a player, func_physbox, or a func_tanktrain this will find it.
    2. Gets property value for a given Entity Index
      -- This gets the CURRENT value for any property for a given entity index.
    3. Sets property value for a given Entity Index
      -- This sets the CURRENT value for any property for a given entity index.
    4. Respawns Entities
      -- This is sometimes needed for the set values to take effect.

    Commands:
    • getentindex <classname> | Gets ALL Entity Indexes based on Classname | Example: getentindex player
    • entpropint <index> <property> | GETS int VALUE of PROPERTY for given ENTITY INDEX | Example: entpropint 1 m_iHealth
    • entpropint <index> <property> <int> | SETS int VALUE of PROPERTY for given ENTITY INDEX | Example: entpropint 1 m_iHealth 3000
    • entpropfloat <index> <property> | GETS float VALUE of PROPERTY for given ENTITY INDEX | Example: entpropfloat 1 m_flModelScale
    • entpropfloat <index> <property> <float> | SETS float VALUE of PROPERTY for given ENTITY INDEX | Example: entpropfloat 1 m_flModelScale 0.3
    • entpropstring <index> <property> | SETS string VALUE of PROPERTY for given ENTITY INDEX | Example: entpropstring 1 m_iName
    • entpropstring <index> <property> <string> | GETS string VALUE of PROPERTY for given ENTITY INDEX | Example: entpropstring 1 m_iName "This is a new targetname"
    • entrespawn <index> | Respawns Entity at given Index | Example: entrespawn 1
    • sv_clear | Clears the console

    Changelog:
    Spoiler


    Installation:
    1. Just place EntHax.smx into /tf/addonds/sourcemod/plugins folder
      Need SM1.8_stable to compile

    Final Thoughts:
    I'm not really sure if others are going to use this. It's a very advanced / developer oriented plugin. But I did the work to create it so thought I'd share it.
    Attached Files
    File Type: sp Get Plugin or Get Source (EntHax.sp - 174 views - 6.4 KB)
    File Type: smx EntHax.smx (6.7 KB, 249 views)

    Last edited by cheddar; 12-01-2016 at 01:37.
    cheddar is offline
    cheddar
    Member
    Join Date: Sep 2015
    Old 11-30-2016 , 01:56   Re: [Any] EntHax - 0.05d - 2016/11/30
    Reply With Quote #2

    Where do you get the entity properties from?
    The entity properties such as "m_iHealth" are all available from running the following command.
    sm_dump_netprops netprops_example.txt
    You'll then find the netprops file containing a multitude of properties you can try out. Look in the root tf2 directory for the neprops.txt file.
    NOTE: The plugin only supports getting/setting int and float at this time
    You could also dig around here:
    http://www.bailopan.net/tf_netprops.txt

    Last edited by cheddar; 11-30-2016 at 03:21.
    cheddar is offline
    Grey83
    Veteran Member
    Join Date: Dec 2014
    Location: Ukraine
    Old 11-30-2016 , 04:13   [Any] EntHax - 0.7.0 - 2016/11/30
    Reply With Quote #3

    I don't undestand what do command respawnent <index>, But the plugin written in such a way will work better.
    Changes:
    • Reduced the number of commands without reducing the functionality of the plugin
      • getentindex - Gets ALL Entity Indexes based on Classname
      • entpropint - Gets/Sets int VALUE of PROPERTY for given ENTITY INDEX*
      • entpropfloat - Gets/Sets float VALUE of PROPERTY for given ENTITY INDEX*
      • respawnent - Respawns Entity at given Index
      • sv_clear - Clears the console
    • Added validation of data entered
    • Rewritten using the new syntax (1.7+)
      Need SM1.8_stable to compile
    *if the number of arguments equal 2, then You can GET value of choosed property
    if the number of arguments equal or more than 3, then You can SET value of choosed property

    Name:  EntHax 0.7.0.jpg
Views: 1212
Size:  28.9 KB
    Attached Files
    File Type: sp Get Plugin or Get Source (EntHax 0.7.0.sp - 629 views - 4.6 KB)
    File Type: smx EntHax 0.7.0.smx (6.2 KB, 261 views)
    __________________

    Last edited by Grey83; 11-30-2016 at 04:30. Reason: Added screenshot
    Grey83 is offline
    cheddar
    Member
    Join Date: Sep 2015
    Old 11-30-2016 , 04:56   Re: [Any] EntHax - 0.7.0 - 2016/11/30
    Reply With Quote #4

    Quote:
    Originally Posted by Grey83 View Post
    Reduced the number of commands without reducing the functionality of the plugin
    Very nice improvements! I'm implementing these features into the main plugin and I'll keep credit mentioning your contributions. Thank you!

    By the way, I'm nearly done with get/set string which will help when getting/setting targetnames etc.

    Quote:
    Originally Posted by Grey83 View Post
    I don't undestand what do command respawnent <index>, But the plugin written in such a way will work better.
    You may find that certain values dont apply until an entity is respawned. The other day I observed this while editing the collision group of a spinning entity. You may never need this command, but I found it useful in my testing. Fun fact: if you respawn a player, they actually respawn as if they just died.

    Quote:
    Originally Posted by Grey83 View Post
    [*]Rewritten using the new syntax (1.7+)
    What part of your rewrite is new syntax?.... answered it myself... HasEntProp hmm...

    But really man, thanks for the help. You improved a ton.

    Last edited by cheddar; 11-30-2016 at 05:01.
    cheddar is offline
    Grey83
    Veteran Member
    Join Date: Dec 2014
    Location: Ukraine
    Old 11-30-2016 , 06:02   Re: [Any] EntHax - 0.06a - 2016/11/30
    Reply With Quote #5

    Quote:
    What part of your rewrite is new syntax?
    Has completely rewritten.
    Just insert in fist lines #pragma newdecls required and try compile Your plugin. =)

    And now commands are really available only to the admin (You can replace a flag of access having changed value of a constant ACCESS_FLAG).
    __________________

    Last edited by Grey83; 11-30-2016 at 06:06.
    Grey83 is offline
    Grey83
    Veteran Member
    Join Date: Dec 2014
    Location: Ukraine
    Old 11-30-2016 , 06:15   Re: [Any] EntHax - 0.06a - 2016/11/30
    Reply With Quote #6

    I once did for myself a similar pluin. It also able to get/set values of string, handle and vector variables.
    But this worked only for the administrator oneself.
    Quote:
    val <name> <type[d|s][i|f|b|s|h|v]> [<value>]
    for example:
    val m_bDucked si
    __________________

    Last edited by Grey83; 11-30-2016 at 06:17.
    Grey83 is offline
    cheddar
    Member
    Join Date: Sep 2015
    Old 12-01-2016 , 01:39   Re: [Any] EntHax - 0.08 - 2016/12/1
    Reply With Quote #7

    Grey83 I figured out why you were confused about entrespawn.
    It's because you had "if(args < 2)" when it needs "if(args < 1)". You're only supposed to pass a single argument to that command.

    Last edited by cheddar; 12-01-2016 at 01:42.
    cheddar is offline
    Grey83
    Veteran Member
    Join Date: Dec 2014
    Location: Ukraine
    Old 12-01-2016 , 09:41   Re: [Any] EntHax - 0.08 - 2016/12/1
    Reply With Quote #8

    Quote:
    you had "if(args < 2)" when it needs "if(args < 1)"
    just CTRL+C, CTRL+V from previous callback =)

    I did not understand what effect gives DispatchSpawn() for existing entities.
    __________________
    Grey83 is offline
    cheddar
    Member
    Join Date: Sep 2015
    Old 12-01-2016 , 13:41   Re: [Any] EntHax - 0.08 - 2016/12/1
    Reply With Quote #9

    Quote:
    Originally Posted by Grey83 View Post
    just CTRL+C, CTRL+V from previous callback =)
    Ahh I got you.

    Quote:
    Originally Posted by Grey83 View Post
    I did not understand what effect gives DispatchSpawn() for existing entities.
    Well just try it you dingus!
    Try it on a player, it re spawns them!

    Last edited by cheddar; 12-01-2016 at 13:44.
    cheddar is offline
    whtevrwt
    AlliedModders Donor
    Join Date: Apr 2015
    Old 12-01-2016 , 17:27   Re: [Any] EntHax - 0.08 - 2016/12/1
    Reply With Quote #10

    This is really good. Thanks for this. You guys really are savvy with SourceMod.
    __________________
    whtevrwt is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 13:16.


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