Jump to content
Sign in to follow this  
mikie boy

pilots licence

Recommended Posts

not sure if this is been answered else where - but no joy finding the correct answer.

Long story short - created a JIP driving licence/pilot licence, basically you gain points whilst you are moving. Once you have a certain amount of points this allows you to drive/fly a better type of plane or car etc.

my problem is - how would i create a points system (not using score as ive used that) that would be saved for each person and then recalled when rejoining. Pretty much an exact copy of score but calling it driving licence.

quick example of gaining points for the initial driving licence. works on single player if anyone want the code....

while {true} do 		
	{ 	
//		 	_licence =  pilotlicence; 
		_vehchoice = vehicle player;

   if (driver _vehchoice == player) then 
		  {
	 	 	if (_vehchoice iskindof "car") then          
	 		{									 

		while {speed _vehchoice > 2} do   
		{ 
		pilotlicence = pilotlicence + 1; publicvariable "pilotlicence";
		sleep 1;
              _vehicle hintsilent format ["driving licence :%1", pilotlicence];

					};
			};
		  };
	};

scoring system

if ! isdedicated then                               
{
[] spawn 								
{
waituntil {!isnull player};	

for [{_loop=0}, {_loop<1}, {_loop=_loop}] do 

{

switch (true) do 

{
_myguy = name player; 
     _licence = pilotlicence;
_permit = pilotpermit;


  case ((_licence < rankup2) and (_licence >= rankup1) and (_permit != "CLASS2")): 


   {
       hintsilent  format["Your Driving licence is Now %2",_myguy,"CLASS2"];
       Sleep 2;


		pilotpermit = "CLASS2"; publicVariable "pilotpermit";	


  };

			  case ((_licence < rankup3) and (_licence >= rankup2) and (_permit != "CLASS3")): 

			   {
	 hintsilent format["Your driving licence is %2",_myguy,"CLASS 3"];

			pilotpermit = "CLASS3"; publicVariable "pilotpermit";	

			  };




};
sleep 1.03;
};

};	
};

init.sqf

if (isNil "pilotlicence") then
{ 
 pilotlicence = 0; 
}; 

if (isNil "pilotpermit") then
{ 
 pilotpermit = "CLASS1"; 
}; 

execvm "pilotlicence.sqf";
execvm "pilotpermit.sqf";

multiplayer - this works for everyone - with all participants connected adding to the total score. Sorry if this is a bit of a stupid question but, need a point on the right direction.

mike

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  

×