[Help] Trade problem

05/11/2009 00:02 crappyreleases2#1
ok um the requesting trade function...i dont think its coded correctly and i tried several times trying to fix it. heres the problem. whenever someone requests trade to me 2 times and i click no it opens up the trade box even if i click no. and the annoying part is you can keep spamming other players like forcing the trade box open.
heres the code for requesting trade. anyone know how to make it better?
Code:
                                case 1://Request trade
                                    {
                                        Character Who = (Character)World.AllChars[UID];
                                        if (UID != Character.TradingWith)
                                        {
                                            Who.MyClient.SendPacket(General.MyPackets.TradePacket(Character.UID, 1));
                                            Character.TradingWith = UID;
                                            Who.TradingWith = Character.UID;
                                            SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", Character.Name, "[Trade]Request for trading has been sent out.", 2005));
                                        }
                                        else
                                        {
                                            Who.Trading = true;
                                            Character.Trading = true;
                                            Who.MyClient.SendPacket(General.MyPackets.TradePacket(Character.UID, 3));
                                            SendPacket(General.MyPackets.TradePacket(Who.UID, 3));
                                        }
 
                                        break;
                                    }
05/11/2009 00:24 PeTe Ninja#2
try to make it so even if it clicks twice like if trades twice then wont let him..i dont have time to look at it atm since i dont have a source ><