0

Alright guys, I've got a issue. I want to loop through this function at a specefic interval, lets say per 300ms. (It's the SigOnState function that I want to loop). The problem is that you can't loop through a function without returning a type and If I returned the 2 line in the SigOnState it would give me a error saying pEnginePointer is not found(Image: Check Problem).. Please help me out!

Public Function SigOnState() As Integer
    Dim pEnginePointer = Mem.ReadInt(bEngine + oEngine, 4)
    Return Mem.ReadInt(pEnginePointer + &H100, 4)
End Function

Public Function IsInGame() As Boolean
    Return SigOnState() = 6 'If player is connected to a server.
End Function
Randomizers
  • 71
  • 1
  • 1
  • 7
  • 3
    You have it declared inside the while-loop. You would have to declare it outside the while-loop. How you escape your loop is a mystery. – LarsTech Jun 03 '16 at 18:43
  • The `While` in the image (which is different than the code posted) creates a block scope; since `pEnginePointer` is declared there, it only exists there not outside where the `Return` is – Ňɏssa Pøngjǣrdenlarp Jun 03 '16 at 18:44
  • Yes I know it has to be outside, but I want to loop through the function somehow and how would I do that? – Randomizers Jun 03 '16 at 19:03
  • If you want to loop the function every 300ms you cannot declare the loop inside it. You gotta call the function itself from a loop declared outside it, in a thread for example. – Visual Vincent Jun 03 '16 at 19:27

0 Answers0