Forum Jump :

Author Message


Posts: 134
Rank:


Level: Member

Country: us
Location: Censored by Chuck Norris
Occupation: Why do you want to know? Stalker.....
Age: 112
In-game name: FuNKo1

 
#1 Posted at 2012-01-16 01:41        
     
I am trying to make a script that allows people to choose what type of weather they want on a mission. the script looks like this:
weathertype = (paramsArray select 6);
weathermodule setvariable ["intensity", 1];
if (weathertype == 0) then 
{
	while {true} do
	{
	_overcast = (random .2);
	0 setovercast _overcast;
	sleep .1;
	0 setrain 0;
	sleep 1;
	}
} else {};

if (weathertype == 1) then 
{
sand = [player, 30] execVM "rollingsand.sqf";
_day = (paramsArray select 1);
_hour = (paramsArray select 2);
_minute = (paramsArray select 3);
setdate [2009, 6, _day, _hour, _minute];
	while {true} do
	{
	_overcast = (random .3);
	0 setovercast _overcast;
	sleep .1;
	0 setrain 0;
	sleep 1;
	}
} else {};

if (weathertype == 2) then 
{
_day = (paramsArray select 1);
_hour = (paramsArray select 2);
_minute = (paramsArray select 3);
setdate [2009, 6, _day, _hour, _minute];
	while {true} do
	{
	_overcast = .6;
	0 setovercast _overcast;
	sleep 1;
	}
} else {};

if (weathertype == 3) then 
{
_day = (paramsArray select 1);
_hour = (paramsArray select 2);
_minute = (paramsArray select 3);
setdate [2009, 6, _day, _hour, _minute];
	while {true} do
	{
	_overcast = 1;
	0 setovercast _overcast;
	sleep .1;
	0 setrain 1;
	sleep 1;
	}
} else {};

if (weathertype == 4) then 
{
_day = (paramsArray select 1);
_hour = (paramsArray select 2);
_minute = (paramsArray select 3);
setdate [2009, 12, _day, _hour, _minute];
	while {true} do
	{
	_overcast = .35;
	0 setovercast _overcast;
	sleep .1;
	0 setrain 0;
	sleep 1;
	}
} else {};
sleep 1;
hint format["%1", weathertype];

The script runs up to the hint at the end, however the hint says any as its text.
I checked my description.ext for errors, and there are none. I also asked several people and they don't know. Help would be appreciated!

Added 1 hour 53 minutes later:

ok i solved the problem, you can't select parameters unless you are in multiplayer. However, I am having trouble with another script. It seems that it is not possible for me to subtract a string from an array. Is there a way around that?

This post was edited by FuNKo1 (2012-01-16 03:35, 960 days ago)

I Can't Think of a Creative Signature Right Now...





Tags: Any, Weather