hridaysabz 14 Posted December 13, 2013 Hey all, I was trying to work out the variables for a little script i'm writing. So two questions, how do I apply %1, and how do I use veh_name? I also would like to find somewhere that has variables like these documented. Thanks. Share this post Link to post Share on other sites
albertfish 11 Posted December 13, 2013 %1 is used for formatting a string; it is a placeholder that gets replaced by the value of a variable. The is used in the format command. For example _var1 = 2; _var2 = 5; _string = format ["Var1 is equal to %1 and var 2 is equal to %2", _var1, _var2]; %1 is a placeholder that get replaced with the value of the first parameter following the format string. %2 gets replaced with the second parameter after the format string. The resulting variable _string will look like "Var1 is equal to 2 and var 2 is equal to 5". As far as veh_name, that just looks like an ordinary variable, presumably storing the name of a vehicle. Where did you come across this variable? Share this post Link to post Share on other sites
hridaysabz 14 Posted December 13, 2013 Oh thanks, I was looking for a variable that would replace the %1 with the name of the vehicle. For example, I have a vehicle named hazler and a vehicle named typhoon. I want it to be so that when one dies in a notification it shows, "hazler is dead!" or "typhoon is dead!" but is there is a quick way of doing so? Share this post Link to post Share on other sites
Johnson11B2P 3 Posted December 13, 2013 (edited) To keep it simple, make a trigger with the condition: !alive hazler activation : hint format["%1 is dead",hazler]; Make another one and replace hazler with typhoon. Edited December 13, 2013 by Johnson11B2P Thanks semiconductor forgot the most important thing. Share this post Link to post Share on other sites
semiconductor 309 Posted December 13, 2013 (edited) condition: alive hazleractivation : hint format["%1 is dead",hazler]; I think there shoud be "!alive" instead of "alive" in condition to make trigger fire when vehicle isn't alive. :) Edited December 13, 2013 by Semiconductor Share this post Link to post Share on other sites
hridaysabz 14 Posted December 13, 2013 Alright, thanks guys. ---------- Post added at 15:00 ---------- Previous post was at 14:59 ---------- To keep it simple, make a trigger with the condition: !alive hazler activation : hint format["%1 is dead",hazler]; Make another one and replace hazler with typhoon. That would completely defeat the purpose of writing %1. Share this post Link to post Share on other sites
Johnson11B2P 3 Posted December 13, 2013 You're right. hint "Hazler is dead"; Share this post Link to post Share on other sites
Larrow 2827 Posted December 13, 2013 vehicleVarName is the command you were looking for Hridaysabz. Share this post Link to post Share on other sites
hridaysabz 14 Posted December 14, 2013 Thanks Larrow Share this post Link to post Share on other sites