Home   Help Search Login Register  

Author Topic: Need Help With Dialog Pic...  (Read 333 times)

0 Members and 1 Guest are viewing this topic.

CopyrightPhilly

  • Guest
Need Help With Dialog Pic...
« on: 14 Apr 2004, 03:44:52 »
ok i tryed everything that i know to try and get this to work...

I want  a picture to change when the player selects a weapon from a list box, i dont want them to press any buttons to make the picture change i want to to chage as soon as they have selected a  weapon from the list...

my code for the contents of the list is:

===============================================

_ok = createDialog "Buygun"
?(!_ok): hint "Your Not Ment To See This..."; exit

_index = lbAdd [104, "AK47 - $1k"]
lbSetData [104, _index, "\dtaext\equip\m\m_AK47.paa"]
_index = lbAdd [104, "AK74 Nade - $1K"]
lbSetData [104, _index, "\dtaext\equip\w\w_AK74GrenadeLauncher.paa"]
lbSetCurSel [104, 0]

===============================================

My Code For The List Box In The Description File Is:

===============================================

     class GunPic1 : RscPicture
{
     idc = 106;
     x = 0.285;
     y = 0.495;
     w = 0.15;  
     h = 0.08;
     text = "\G36A\w_g36.paa";
};

===============================================

So When They Select Say The AK-47 The G36A\w_g36.paa will change to \dtaext\equip\m\m_AK47.paa

ok Thats That, I Would Be Gratfull In Any Advice You CAn Give Me...

Cheers, Philly

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Need Help With Dialog Pic...
« Reply #1 on: 14 Apr 2004, 04:04:47 »
How about:


_chosen = lbdata [104, lbcursel 104]

? chosen == "AK47 - $1k" : lbSetPicture [106,0,"dtaext\equip\m\m_AK47.paa"]

? _chosen == "AK74 Nade - $1K" : lbSetPicture [106,0,"dtaext\equip\m\w_AK74GrenadeLauncher.paa"]

Or something along those lines.


Planck
I know a little about a lot, and a lot about a little.

CopyrightPhilly

  • Guest
Re:Need Help With Dialog Pic...
« Reply #2 on: 14 Apr 2004, 04:23:17 »
ok i worked it out, so if anyone else has this trobble then they can use this...

i added this to the bottom sqs file that says whats in the list box

=======================================

goto "loop"

#loop
ctrlSetText [106, lbData[104, lbCurSel 104]]
goto "loop"

===================================

So There you Have It lol

Cheers, Philly