Jump to content
Sign in to follow this  
speedshooter

Returning Random Letter [HELP!!]

Recommended Posts

_letters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]; 
_l1 = random(_letters);
_l2 = random(_letters);
_l3 = random(_letters);
_l4 = random(_letters);

Share this post


Link to post
Share on other sites

Place a functions module on the map.

waituntil {!IsNil "Bis_Fnc_Init"}; 
_RandomLetter = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] call Bis_Fnc_SelectRandom;
Hint Format ["%1",_RandomLetter];

---------- Post added at 16:36 ---------- Previous post was at 16:27 ----------

Fixed: Added the letters to strings. Also, apparently the bis random function isn't reliable to ever pick the first or last element. So you can just use those as place holders.

Edited by Iceman77

Share this post


Link to post
Share on other sites

I would avoid using BIS_fnc_selectRandom until this is addressed.

_letters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]; 
_letter = _letters select (floor count _letters);

Share this post


Link to post
Share on other sites

_letters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]; 
_letter = _letters select (floor count _letters);
_l1 = _letter;
_l2 = _letter;
_l3 = _letter;
_l4 = _letter;
_n1 = ceil(random 9) call ISSE_str_IntToStr;
_n2 = ceil(random 9) call ISSE_str_IntToStr;
_n3 = ceil(random 9) call ISSE_str_IntToStr;
_PLetters = _l1 + _l2 + _l3 + _l4;
_PNumbers = _n1 + _n2 + _n3;
_Plate = _PLetters + PNumbers;

newVehicle setVariable ["Licence", _Plate, true];

plates.sqf

_type = _this select 0;
_type2 = typeOf _type;

hintSilent parseText format["<t valign='middle' underline='1' color='#ff0000'>VEHICLE-REGISTRATION</t><br/><br/><t valign='middle' color='#15c73b'>Plate Number: %2<br/>Type: %1",_type2,_type getVariable "Licence",_businfo];

This is returning "scalar" in the hint

Edited by speedshooter

Share this post


Link to post
Share on other sites

You could try this. idk if it would work...

_letters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
_letter = _letters select (floor count _letters); 
_l1 = _letter; 
_l2 = _letter; 
_l3 = _letter;
_l4 = _letter;
_n1 = ceil(random 9) call ISSE_str_IntToStr;
_n2 = ceil(random 9) call ISSE_str_IntToStr;
_n3 = ceil(random 9) call ISSE_str_IntToStr;
_PLetters = [];
_PNumbers = [];
_PLetters = _PLetters + _l1 + _l2 + _l3 + _l4; 
_PNumbers = _PNumbers + _n1 + _n2 + _n3; 
_Plate = _PLetters + PNumbers;

Share this post


Link to post
Share on other sites

_letters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];

_letter = _letters select (floor count _letters);

_l1 = _letter;

_l2 = _letter;

_l3 = _letter;

_l4 = _letter;

_n1 = ceil(random 9) call ISSE_str_IntToStr;

_n2 = ceil(random 9) call ISSE_str_IntToStr;

_n3 = ceil(random 9) call ISSE_str_IntToStr;

_PLetters = [];

_PNumbers = [];

_PLetters = _PLetters + _l1 + _l2 + _l3 + _l4;

_PNumbers = _PNumbers + _n1 + _n2 + _n3;

_Plate = _PLetters + PNumbers;

remember to put a 'random' in there.

_letter = _letters select floor(random(count _letters));

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  

×