07-22-2012, 12:53 PM
07-22-2012, 01:07 PM
Here's one example from my mod:
if(GetLocalVarInt("Book1Pulled") == 1 and GetLocalVarInt("Book3Pulled") == 0){
SetLocalVarInt("Book1and2PulledInRightOrder", 1);
}
I guess this should get you started.
if(GetLocalVarInt("Book1Pulled") == 1 and GetLocalVarInt("Book3Pulled") == 0){
SetLocalVarInt("Book1and2PulledInRightOrder", 1);
}
I guess this should get you started.
07-22-2012, 01:13 PM
(07-22-2012, 01:07 PM)JMFStorm Wrote: [ -> ]Here's one example from my mod:
if(GetLocalVarInt("Book1Pulled") == 1 and GetLocalVarInt("Book3Pulled") == 0){
SetLocalVarInt("Book1and2PulledInRightOrder", 1);
}
I guess this should get you started.
Thanks alot this will get me started as u said :p
(when I first read it I was like "omg this is the guy tht made followed by death!!!?!")
07-22-2012, 05:07 PM
(07-22-2012, 01:07 PM)JMFStorm Wrote: [ -> ]Here's one example from my mod:should you really write and? don't you need to write &&?
if(GetLocalVarInt("Book1Pulled") == 1 and GetLocalVarInt("Book3Pulled") == 0){
SetLocalVarInt("Book1and2PulledInRightOrder", 1);
}
I guess this should get you started.
07-22-2012, 05:59 PM
(07-22-2012, 05:07 PM)SilentStriker Wrote: [ -> ]should you really write and? don't you need to write &&?
Yeah. I'm not certain about this but it also might be possible. Just have a try out.
07-22-2012, 09:49 PM
You should use &&.
Alternatively, you can put an if inside an if.
Alternatively, you can put an if inside an if.
07-23-2012, 12:15 AM
(07-22-2012, 05:07 PM)SilentStriker Wrote: [ -> ]should you really write and? don't you need to write &&?
and is a reserved keyword and would work the same way as &&. For those who want a more human-readable source code, and would be more desirable than &&.
07-23-2012, 10:02 AM
ya, thing is I tried to do this but I'm probably doing it wrong besides that I still have no idea how if/else statements work (it's a miracle that the 1st one worked)