Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
ZeeSquared

How to show a picture of a rifle in a hint via parseText?

Recommended Posts

I can't for the life of me figure this out. I searched the forums via Google with:

site:forums.bistudio.com cfgweapons picture

Lots of good results came up, but I couldn't get either to work unfortunately.

What I'm trying to accomplish is putting an image of a rifle on a hint pop-up. The code I have so far is this:

hint parseText format ["<t align='center' color='#f39403' shadow='1' shadowColor='#000000'>Rifle Image</t><br/><t align='center' color='#666666'>------------------------------</t><br/><br/><t align='center' color='#666c3f' shadow='1' shadowColor='#000000'><img size='4' image='%1'/></t><br/><br/><t align='center' color='#ffcc33' shadow='1' shadowColor='#000000'>This is a Rifle</t><br/><br/><t align='center' color='#ffffff' shadow='1' shadowColor='#000000'>Did an image of a rifle pop-up?</t>", getText (configFile >> "cfgWeapons" >> "Rifle" >> M14_EP1 >> "picture")];

Everything shows up correctly with the exception of the image of the rifle.

Could someone point me in the right direction? Thanks in advance! :D

Share this post


Link to post
Share on other sites

Didnt test, but Im pretty sure all the names need to be strings.

M14_EP1 -> "M14_EP1"

Share this post


Link to post
Share on other sites

You rock, shk! You've helped me many times on here and I can't thank you enough. This did the trick:

getText (configFile >> "cfgWeapons" >> "M14_EP1" >> "picture")

The whole thing would look like this:

hint parseText format ["<t align='center' color='#f39403' shadow='1' shadowColor='#000000'>Rifle Image</t><br/><t align='center' color='#666666'>------------------------------</t><br/><br/><t align='center' color='#666c3f' shadow='1' shadowColor='#000000'><img size='4' image='%1'/></t><br/><br/><t align='center' color='#ffcc33' shadow='1' shadowColor='#000000'>This is a Rifle</t><br/><br/><t align='center' color='#ffffff' shadow='1' shadowColor='#000000'>Did an image of a rifle pop-up?</t>", getText (configFile >> "cfgWeapons" >> "M14_EP1" >> "picture")];

Share this post


Link to post
Share on other sites

I was not aware you can include a picture in a hint pop up?? Hmm

Any chance of posting an example mission for those who might be interested in doing something similar?

Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×