lethal 0 Posted March 16, 2007 this is for my afterburner script - the script runs on a vehicle and inside this script there is an intensity variable (0-1) which determines the intensity of the AB effect shown (and also turns it off when below a certain intensity). since there can be more than 1 aircraft displaying the effect i want the keystroke to only affect the aircraft of the player pressing that key. what do i have to look out for - i'm not familiar with the requirements of an mp-environment at all :/ here's a sample of "pseudo"-code of what i'm trying to achive (couldn't post the actual code since some lines in there are way too long ): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">while {true} do { if ((engineon _aircraft) and (_ABOn)) then { if (_ABintesity < 1) then {_ABIntensity = _ABIntensity + 0.05}; _colorprofile = [r,g,b,a*_ABIntensity]; <do some stuff> if (_ABintensity > 0.3) then {turn on particles} else {turn off particles}; } else { if (_ABintesity > 0) then {_ABIntensity = _ABIntensity - 0.05}; _colorprofile = [r,g,b,a*_ABIntensity]; <do some stuff> if (_ABintensity > 0.3) then {turn on particles} else {turn off particles}; }; sleep 0.1; }; basically i want the keystroke to turn on the varliable _ABOn... but only for the player whos actually pressing the key, not globally. Share this post Link to post Share on other sites
UNN 0 Posted March 16, 2007 Vektorboson came up with a method that allowed him to use a keypress for an afterburner in OFP. I think this is the script: Afterburner Share this post Link to post Share on other sites
celery 8 Posted March 16, 2007 I'd like to know how to create custom keystrokes too, can anyone explain them to me? Like if I press a certain button, a code or script activates. Share this post Link to post Share on other sites
lethal 0 Posted March 16, 2007 here's how i did it: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">finddisplay(46) displayseteventhandler ["Keydown","if ((_this select 1) == 16) then {ABon = true}"]; i figured it out thanks to mr.Fleas post here Share this post Link to post Share on other sites
mandoble 1 Posted March 16, 2007 Lethal, you should consider using vehicle variables instead of global ones there: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> finddisplay(46) displayseteventhandler ["Keydown",{if ((_this select 1) == 16) then {(vehicle player) setVariable ["ABon", "true"]}}]; Inside any other script if (vehiclename getVariable "ABon") then {......} This way these variables are particular to each aircraft. Share this post Link to post Share on other sites
lethal 0 Posted March 16, 2007 Lethal, you should consider using vehicle variables instead of global ones there:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> finddisplay(46) displayseteventhandler ["Keydown",{if ((_this select 1) == 16) then {(vehicle player) setVariable ["ABon", "true"]}}]; Inside any other script if (vehiclename getVariable "ABon") then {......} This way these variables are particular to each aircraft. thanks - thats good advice. i wasn't aware of the getvariable command and didn't know how to overcome this problem, thank you Share this post Link to post Share on other sites