Jump to content

is there a shorter way to do this?


Cindy Kraai
 Share

You are about to reply to a thread that has been inactive for 1808 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

integer level;

default
{
     state_entry()
    {   
        if(level != "50 to 100")
		{
			//don't allow command
		}
		else
		{
			//allow command
		}
    }
}

i'm trying to create a level limit sort of, before making a certain command that will be available only if they are in that level. I was thinking of using "list" then llGetListLength  but making those numbers are too long and i'm not sure if there is a limit on making those list.

integer level;
list level_list = ["50","51","52", so on and so forth up to "100" ];

default
{
     state_entry()
    {
		integer length = llGetListLength(level_list);
        if(level != (string)length)
		{
			//don't allow command
		}
		else
		{
			//allow command
		}
    }
}

is there any way i can make this easier and shorter, please help me and thank you in advance for giving some samples that are understandable. :D

Link to comment
Share on other sites

Did you consider the following ?

integer level;

default
{
     state_entry()
    {   
        if(level > 50 && level < 100) // If level is larger than 50 AND level is 99 or less...
		{
			//allow command
		}
    }
}

You don't need an else-condition, unless you want it to say something like "Not allowed" or so.

Edited by Fritigern Gothly
  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1808 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...