View previous topic :: View next topic |
Author |
Message |
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Wed Jun 22, 2016 1:56 pm Post subject: If and else with value |
|
|
I want a function that would so something like this: check if value is 7, if value is 7 change it to 9. if it is 11 instead of 7 or 9 change it to 13, uncheck = set value to 7. I hope i made myself understood, however i dont understand how i could add this into a freezebox function.
This is the code i use for the checkbox right now.
Code: | function CETrainerCheckbox1Change(sender)
if (CETrainer.CECheckbox1.State==cbChecked)then
writeFloat("[[[[[game.exe+0084E4BC]+38]+184]+480]+cc]+32c", 9)
else
writeFloat("[[[[[game.exe+0084E4BC]+38]+184]+480]+cc]+32c", 7)
end
end |
all help apprechiated! |
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Wed Jun 22, 2016 4:31 pm Post subject: |
|
|
Try~
Code: | function CETrainerCheckbox1Change(sender)
local addr = "[[[[[game.exe+0084E4BC]+38]+184]+480]+cc]+32c"
local function set(value)writeFloat(addr,value)end
local function test(value)return value==readFloat(addr)end
if sender.State==cbChecked then -- checked action
if test(7.0) then
set(9.0)
elseif test(11.0) then
set(13.0)
end
else -- unchecked action
set(7.0)
end
end |
_________________
- Retarded. |
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Sat Jun 25, 2016 7:17 am Post subject: |
|
|
panraven wrote: | Try~
Code: | function CETrainerCheckbox1Change(sender)
local addr = "[[[[[game.exe+0084E4BC]+38]+184]+480]+cc]+32c"
local function set(value)writeFloat(addr,value)end
local function test(value)return value==readFloat(addr)end
if sender.State==cbChecked then -- checked action
if test(7.0) then
set(9.0)
elseif test(11.0) then
set(13.0)
end
else -- unchecked action
set(7.0)
end
end |
|
thx |
|
Back to top |
|
|
|