Variables - GamingMad101/GmodPowerAPI GitHub Wiki

Variables:

Listed Below is a list of all the shared variables on all the entitys. These are all configurable, however, I can recommend only changing the ones with a dingbat (¶) next to them, and the rest should be set by code, rather than in the file when configuring.


Sockets:

ENT.PowerAPI_Plug

This variable points to the plug entity that is currently plugged into it. If no plug is currently in it, it defaults to nil.

ENT.PowerAPI_Watts ¶

This variable is the power rating of the socket, defaults to 2 donkeypower (500 watts), currently here so appliences can refer to it to check if enough power is being supplied.


Plugs:

ENT.PowerAPI_IsAPlug

This variable is used for checking if the object is a plug in the socket code. This is purely here incase someone wants to use their own propietary plug types. Setting this to false will stop it being able to plug into sockets.

ENT.PowerAPI_Appliance

This variable points to the entity that the plug is connected to. An example of this could be the computer on a computer plug.

ENT.PowerAPI_Socket

This variable points to the socket entity it is plugged into.

ENT.PowerAPI_DespawnDelay ¶

Defaults to 0.2, this is the time in seconds between checking if the appliance has been deleted, and if it is, removing the plug.