... Where'd the thread go for bindable keys .dll? ....

Posts 1–8 of 8 · Page 1 of 1
... Where'd the thread go for bindable keys .dll? ....
I don't care the reason, (unless i'm blind) But good content thread removed (unless virus) is retarded. Back on topic w/ that thread

How do I add an on/off script for this (off in main script, on in secondary script)
Code:
function TimerGui:_set_jamming_values() return end
function TimerGui:start( timer )
        timer = 0.01
        if self._jammed then
                self:_set_jammed( false )
                return
        end
       
        if not self._powered then
                self:_set_powered( true )
                return
        end
       
        if self._started then
                return
        end
       
        self:_start( timer )
        if managers.network:session() then
                managers.network:session():send_to_peers_synched( "start_timer_gui", self._unit, timer )
        end
end
Also, which of these are actually necessary for infinite equipment (host/non-host)

also I don't remember how to even make on/off code for single line scripts because the tut aspect of it was posted in that thread... ffs!

Code:
function PlayerManager:remove_equipment( equipment_id ) end
function PlayerManager:remove_equipment_possession( peer_id, equipment ) end
function PlayerManager:clear_equipment() end
function PlayerManager:from_server_equipment_place_result( selected_index, unit ) end
function HUDManager:remove_special_equipment( equipment ) end
because infinite equipment is needed to use
Code:
-- BaseInteractionExt._has_required_deployable = function(self) return true end -- TURN OFF FOR MP******************

-- Allow interaction with anything (ECM jammers, picking locks, deploying shaped charges, etc)
function BaseInteractionExt:_has_required_deployable() return true end
without the equipment equipped

thx for the help guys.
The mods keep deleting my DLL because it contains "advertising" for other forums. I give proper credits to those who helped create the DLL and the mods don't like that. I might post the DLL here some other time. For now, just obtain the DLL from other forums, you can find my post on other forums by googling:
"[RELEASE] iphlpapi.dll with error logging and allows configurable hotkeys transcend".

Here is the guide you are referring to:
Quote Originally Posted by RabidFubar View Post
The scripts generally declare new functions to overwrite existing functions. If you want to be able to disable your scripts, you need add code so when you enable the script it backs up the original function to a new name. To disable your script, you need to then restore the original function. For my drill code, I used more than one line because I couldn't just have the new function return true, false, or zero. It is still one function (well, 2 if you count jamming).

Enable drilling:
Code:
if not _oldJamming then _oldJamming = TimerGui._set_jamming_values end
function TimerGui:_set_jamming_values() return end

if not _oldStart then _oldStart = TimerGui.start end
function TimerGui:start( timer )
        timer = 0.01
        if self._jammed then
                self:_set_jammed( false )
                return
        end
       
        if not self._powered then
                self:_set_powered( true )
                return
        end
       
        if self._started then
                return
        end
       
        self:_start( timer )
        if managers.network:session() then
                managers.network:session():send_to_peers_synched( "start_timer_gui", self._unit, timer )
        end
end
Disable drilling:
Code:
if _oldJamming then 
	TimerGui._set_jamming_values = _oldJamming 
	_oldJamming = nil
end

if _oldStart then 
	TimerGui.start = _oldStart
	_oldStart = nil
end
As you can see above, I copy the old jamming and timer functions to the placeholders named _oldJamming and _oldStart before I replace the original functions. The disable code checks to see if the script is enabled (if a placeholder exists the script is enabled), copies the placeholder back to the original function, and deletes the placeholder.

For scripts with more sweeping changes, such as invisibility, you need to do this with each function.
thanks alot man, gonna use this to set more enable/disable on scripts
I'm doing something wrong =/

Enable:
Code:
if not _Rem1 then _Rem1 = PlayerManager:remove_equipment end
function PlayerManager:remove_equipment( equipment_id ) end

if not _Rem2 then _Rem2 = PlayerManager:remove_equipment_possession end
function PlayerManager:remove_equipment_possession( peer_id, equipment ) end

if not _Rem3 then _Rem3 = PlayerManager:clear_equipment end
function PlayerManager:clear_equipment() end

if not _Rem4 then _Rem4 = PlayerManager:from_server_equipment_place_result end
function PlayerManager:from_server_equipment_place_result( selected_index, unit ) end

if not _Rem5 then _Rem5 = HUDManager:remove_special_equipment end
function HUDManager:remove_special_equipment( equipment ) end

if not _Base1 then _Base1 = BaseInteractionExt._has_required_deployable end -- TURN OFF FOR MP************************************
BaseInteractionExt._has_required_deployable = function(self) return true end
Disable:
Code:
if _Rem1 then 
	PlayerManager:remove_equipment = _Rem1
	_Rem1 = nil
end

if _Rem2 then
	PlayerManager:remove_equipment_possession = _Rem2
	_Rem2 = nil
end

if _Rem3 then
	PlayerManager:clear_equipment = _Rem3
	_Rem3 = nil
end

if _Rem4 then
	PlayerManager:from_server_equipment_place_result = _Rem4
	_Rem4 = nil
end

if _Rem5 then
	HUDManager:remove_special_equipment = _Rem5
	_Rem5 = nil
end

-- Allow interaction with anything (ECM jammers, picking locks, deploying shaped charges, etc)
-- if _Base2 then BaseInteractionExt:_has_required_deployable() return true end
if _Base1 then
	BaseInteractionExt._has_required_deployable = _Base1
	_Base1 = nil
end
Quote Originally Posted by Rampant_uterus View Post
I'm doing something wrong =/

Enable:
Code:
if not _Rem1 then _Rem1 = PlayerManager:remove_equipment end
function PlayerManager:remove_equipment( equipment_id ) end

if not _Rem2 then _Rem2 = PlayerManager:remove_equipment_possession end
function PlayerManager:remove_equipment_possession( peer_id, equipment ) end

if not _Rem3 then _Rem3 = PlayerManager:clear_equipment end
function PlayerManager:clear_equipment() end

if not _Rem4 then _Rem4 = PlayerManager:from_server_equipment_place_result end
function PlayerManager:from_server_equipment_place_result( selected_index, unit ) end

if not _Rem5 then _Rem5 = HUDManager:remove_special_equipment end
function HUDManager:remove_special_equipment( equipment ) end

if not _Base1 then _Base1 = BaseInteractionExt._has_required_deployable end -- TURN OFF FOR MP************************************
BaseInteractionExt._has_required_deployable = function(self) return true end
Disable:
Code:
if _Rem1 then 
	PlayerManager:remove_equipment = _Rem1
	_Rem1 = nil
end

if _Rem2 then
	PlayerManager:remove_equipment_possession = _Rem2
	_Rem2 = nil
end

if _Rem3 then
	PlayerManager:clear_equipment = _Rem3
	_Rem3 = nil
end

if _Rem4 then
	PlayerManager:from_server_equipment_place_result = _Rem4
	_Rem4 = nil
end

if _Rem5 then
	HUDManager:remove_special_equipment = _Rem5
	_Rem5 = nil
end

-- Allow interaction with anything (ECM jammers, picking locks, deploying shaped charges, etc)
-- if _Base2 then BaseInteractionExt:_has_required_deployable() return true end
if _Base1 then
	BaseInteractionExt._has_required_deployable = _Base1
	_Base1 = nil
end
Close.. you need to understand the difference between : and .

<class>:<function>(<params>) is shorthand for <class>.<function>(self, <params>)

So when you are storing a function in a variable.. you want to do this:
Code:
if not _Rem1 then _Rem1 = PlayerManager.remove_equipment end
And when restoring:
Code:
if _Rem1 then 
	PlayerManager.remove_equipment = _Rem1
	_Rem1 = nil
end
If you are calling the functions, you use the :

Let me know if it needs more explaining.
do i need to keep the params when I'm setting a name for it? like:

_Rem1 Code( param ) end

if it has equipment or peerid in the params
Quote Originally Posted by Rampant_uterus View Post
do i need to keep the params when I'm setting a name for it? like:

_Rem1 Code( param ) end

if it has equipment or peerid in the params
No, just do it like I showed.
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?