Jump to content
Sign in to follow this  
aaronhance

Need help with vehicle spawn script.

Recommended Posts

I've been making a vehicle spawn script for my mission, but it does not want to work.

//vehicle spawn script - by [bB]Aaron

if(driversLicense == 1)then{
if((player getVariable "moneyHand") => 300)then{
	player setVariabe ["moneyHand", ((player getVariable "moneyHand") - 300)];
	_veh = "C_Quadbike_01_F" createVehicle (position player);
	vehiclelock = _veh addAction ['Unlock / Lock','veh\lock.sqf',[],7,true,true,'','(_target distance _this) < 4'];
}
else{
	hint "You need more money!";
}
}
else{
hint "You need a license!";
}

Share this post


Link to post
Share on other sites

Thanks again. :D

---------- Post added at 13:21 ---------- Previous post was at 13:18 ----------

close off your brackets

};

The Script still doesn't work.

Share this post


Link to post
Share on other sites

hey aaron, i noticed that one of the "variable"'s was spelled wrong and also i switched '=>' to '>=', try this and see if it works for you :) hope i could help!

if(driversLicense == 1)then{	if ((player getVariable "moneyHand") >= 300) then {
	player setVariable ["moneyHand", ((player getVariable "moneyHand") - 300)];
	_veh = "C_Quadbike_01_F" createVehicle (position player);
	vehiclelock = _veh addAction ['Unlock / Lock','veh\lock.sqf',[],7,true,true,'','(_target distance _this) < 4'];
}
else
{
	hint "You need more money!";
};
}
else
{
hint "You need a license!";
};

~ToxicMuffin

Share this post


Link to post
Share on other sites
hey aaron, i noticed that one of the "variable"'s was spelled wrong and also i switched '=>' to '>=', try this and see if it works for you :) hope i could help!

if(driversLicense == 1)then{	if ((player getVariable "moneyHand") >= 300) then {
	player setVariable ["moneyHand", ((player getVariable "moneyHand") - 300)];
	_veh = "C_Quadbike_01_F" createVehicle (position player);
	vehiclelock = _veh addAction ['Unlock / Lock','veh\lock.sqf',[],7,true,true,'','(_target distance _this) < 4'];
}
else
{
	hint "You need more money!";
};
}
else
{
hint "You need a license!";
};

~ToxicMuffin

Thanks, I must have gone over it 5 or 6 times can't believe I missed it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×