Garry's Mod

Garry's Mod

Control Map Entities - Entity:fire() E2 Function (Wiremod / ent_fire)
 This topic has been pinned, so it's probably important
LibertyForce  [developer] 13 Aug, 2014 @ 5:00am
Example E2 Codes
Get Entity IDs and names

Here is a little but very useful E2 code, that will give you information about every entity you right-click on. Uses custom functions that depend on this addon. Simple spawn the chip anywhere, then right-click on any entity and look in the console for the information.

@name Get Entity IDs # How to use: # Place the E2 chip, then right-click on any entity # to get it's ID, class, unique name and owner. runOnTick(1) M2 = owner():keyAttack2() if(changed(M2) & M2) { print("ID: " + owner():aimEntity():id()) print("MapCreationID: " + owner():aimEntity():getMapID()) print("Class: " + owner():aimEntity():type()) print("Name: " + owner():aimEntity():getEntityName()) }
Last edited by LibertyForce; 21 Feb, 2017 @ 9:53am
< >
Showing 1-5 of 5 comments
GHOST_ECHO 18 Feb, 2017 @ 11:28am 
what would be the code to lock a door? i am having serious headaches trying to lock a door in headattackcity.thanks for your time and efforts,this is a nifty tool
LibertyForce  [developer] 19 Feb, 2017 @ 6:55am 
For most doors (func_door*):
Ent = entityMapID(123) Ent:fire("lock")
Of course, replace 123 with the actual ID you got with Easy Entity Inspector
Also read the tutorial!
19 Feb, 2017 @ 11:49am 
@LibertyForce, "Get Entity IDs and names" E2 code is not valid because there is an extra pair of parentheses on line 12.
LibertyForce  [developer] 21 Feb, 2017 @ 9:54am 
Thanks for the info!
It's been forever since I had time to look at this mod...
Intuitive 28 Dec, 2017 @ 6:35pm 
Thank you. Thank you. :-)
< >
Showing 1-5 of 5 comments
Per page: 1530 50