Problem in "equipping itens" GUI

Started by Fabiano, Sat 26/11/2005 22:26:46

Previous topic - Next topic

Fabiano

Heya ppl. Im having some troubles and I appreciate any light anyone can give me.

In my Inventory GUI I have 9 buttons. 3 of then are the "Examine, Use and Drop" buttons, pretty normal on AGS GUIs. The Other 6 are "Equip Slots", that works in this way (example):

Code: ags

if ((button=5) { 
if ((getglobalint(0) = 1))
Setbuttonpic(2,5,1,0); // remove the button pic
Addinv (1); // Add the item 1 back to inv
SetglobalInt(0,0);
wait(5);
}
else if ((getglobalint(0) = 0) &&  (player.activeinv =1))) { // I dont remember right now the active inv command, but this line says "if you have in active inv the item 1 and GlobalInt =0"
SetButtonPic(2,5,1,2); // Chance button to weapon
LoseInv (1); // Lose the item 1
SetGlobalInt(0,1);
wait(5);
}
}


The main problem is: You "equip" the weapon = OK
You "unequip" the weapon = OK
You try to equip it again, you have to click it a thousand times. I dont know why.

Anyone can help me?

[]'s


Yeah, yeah, It happens. A lot.

SMF spam blocked by CleanTalk