T7nowhere Posted April 10, 2005 Share Posted April 10, 2005 What I'm trying to do is add conditions to parts of a script based on global numbers. So if the conditions for the global numbers are met then only that section of the script will fire and ignore the rest of the code where the conditions are not met. So I think what I need to know is how to encapsulate the parts of the code that I only want to fire if the globals specified return as being true. Link to comment Share on other sites More sharing options...
envida Posted April 10, 2005 Share Posted April 10, 2005 Something like this you are looking for? void main() { //Get this from a dialog use: GetScriptStringParameter(); string sGlobalName = "your_globalnumber_name"; //global number to check for int iGlobaNumber1 = 1; //Get it from dialog use: GetScriptParameter(1); int iGlobaNumber2 = 2; //Get it from dialog use: GetScriptParameter(2); int iGlobaNumber3 = 3; //Get it from dialog use: GetScriptParameter(3); if(GetGlobalNumber(sGlobalName) == iGlobaNumber1) { //do your stuff } else if(GetGlobalNumber(sGlobalName) == iGlobaNumber2) { //do your stuff } else if(GetGlobalNumber(sGlobalName) == iGlobaNumber2) { //do your stuff } else { //if no condition is met do this } } Link to comment Share on other sites More sharing options...
Shadow Blaze Posted April 10, 2005 Share Posted April 10, 2005 Still scripting like crazy huh T7? Good luck and I am sure it will work out fine in the end. Now I am going to go hide in a corner away from scripts. Link to comment Share on other sites More sharing options...
T7nowhere Posted April 10, 2005 Author Share Posted April 10, 2005 Thank you so much envida. That was the last bit of information I needed to make this crazy script work. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.