Salve ragazzi, ho un problema che mi fa salire la rabbia più assoluta :@.
In pratica sto cercando di far definire una stringa ovvero mi spiego.
Codice:
using System;
using GameServer.Virtual_Objects.Room;
using GameServer.Virtual_Objects.User;
using GameServer.Networking.Packets;
namespace GameServer.Networking.Handlers
{
class HANDLE_SHOP_COUPON : PacketHandler
{
public override void Handle(virtualUser User)
{
string Coupon = getBlock(0);
if(Coupon == "11111111-1111-1111" || Coupon == "22222222-2222-2222" )
{
int Rand = new Random().Next(0, 0);
string Code = null ;
int Days = 1 ;
if (Coupon == "1111-1111-1111-1111")
{
if (Rand == 0) { Code = "DB10"; Days = 7; }
}
User.AddOutBoxItem(Code, Days);
User.Inventory = new InventoryItem[105];
User.LoadItems();
User.send(new PACKET_RANDOM_BOX(User, Code, Days));
}
}
}
}
Vedete quello "String Code = Null" E "Int Days = 1"? Ecco quei 2 disgraziati mi stanno facendo dannare l'anima perché Al posto di leggere il Code Contenuto in "If (Rand == 0) {
Code = "DB10"; Days = 7; }" e il Days "f (Rand == 0) { Code = "DB10";
Days = 7; }" Mi mette Code Vuoto e Giorno 1. Devo Fare in modo che Code e days vengono letti da if Rand.. Cosa è che sbaglio o che dimentico di aggiungere? Grazie in anticipo