Call Function on Variable Change
I'm working on a custom server tool for a game I'm trying to trigger an event when a variable in the memory changes a certain way.
Example of what I'm trying to do in a timer
int client0alivevalue = memory.ReadByte((IntPtr)address + (clientsize * 0));
if (client0alivevalue == 0 then changes from 0 to 1)
{ do something }
So when client0alivevalue = 0 the client is dead and when it's 1 the client is alive. When the client dies and then respawns I want to trigger a function hence the example: if (client0alivevalue == 0 then changes from 0 to 1). I only want to trigger said function when the client0alivevalue changes from 0 to 1.
I hope this makes sense.
Example of what I'm trying to do in a timer
Code
int client0alivevalue = memory.ReadByte((IntPtr)address + (clientsize * 0));
if (client0alivevalue == 0 then changes from 0 to 1)
{ do something }
So when client0alivevalue = 0 the client is dead and when it's 1 the client is alive. When the client dies and then respawns I want to trigger a function hence the example: if (client0alivevalue == 0 then changes from 0 to 1). I only want to trigger said function when the client0alivevalue changes from 0 to 1.
I hope this makes sense.
