ThalonMook Posted October 27, 2018 Posted October 27, 2018 Hi, I have a problem how to call a function right.Heres the script I wana use.Function SetMuni() global Bool acComp = 0 Debug.Notification("Ammo Anz Start!") int AnzMuni = MCM.GetModSettingInt("ThalonCompAmmo", "iSliderAmmo:Main") Debug.Notification("Anzahl: " + AnzMuni) ;Debug.Trace("Anzahl: " + AnzMuni) Actor[] playerFollowers = Game.GetPlayerFollowers() Actor akActor = playerFollowers[4] acComp = CompEnabled(akActor) Debug.Messagebox(akActor.GetDisplayName() + "<br>Aktiv: " + acComp) EndFunction Bool Function CompEnabled(Actor coActor) If (MCM.GetModSettingInt("ThalonCompAmmo", "bEnabledDeacon:Main") && coActor.GetFormID() == 0x50976) return true ElseIf (MCM.GetModSettingInt("ThalonCompAmmo", "bEnabledVex:Main") && coActor.GetFormID() == 0x49002e1a) return true ElseIf (MCM.GetModSettingInt("ThalonCompAmmo", "bEnabledPiper:Main") && coActor.GetFormID() == 0x49002e1a) return true ElseIf (MCM.GetModSettingInt("ThalonCompAmmo", "bEnabledCait:Main") && coActor.GetFormID() == 0x79305) return true ElseIf (MCM.GetModSettingInt("ThalonCompAmmo", "bEnabledMcCready:Main") && coActor.GetFormID() == 0x2a8a7) return true Endif return false EndFunctionThis error I got from compiler: cannot call member function CompEnabled in global function setmuni without a variable to call it on How I have to call the function? The 'SetMuni' function I have to declare as global cause I want to start it via hotkey 'cgf "myscript.SetMuni"If there is an other way to start it then I need to know how :-) ThxThalon
ThalonMook Posted October 27, 2018 Author Posted October 27, 2018 Ok nobody has an answer :D I found a solution by my self ;-) I moved the CompEnabled script in front of the SetMuni func and set it to global.Now it compiled and work as I want to. ThxThalon
preezerk Posted March 25, 2019 Posted March 25, 2019 You came back and answered the question, not just "Nevermind I fixed it". Bless you.
Recommended Posts