[Pedido] Lуgica sobre random utilizando letras e nъmeros
#8

Код:
new letters[27][1] =
{
	"a",
	"b",
	"c",
	"d",
	"e",
	"f",
	"g", 
	"h",
	"i",
	"j", 
	"k",
	"l",
	"m",
	"n",
	"o",
	"p",
	"q",
	"r",
	"s",
	"t",
	"u",
	"v",
	"w",
	"x",
	"y",
	"z"
};

stock GenerateRandomSerial(string[])
{
	for(new c; c < sizeof(string), c++)
	{
		new type = random(2);
		
		switch(type)
		{
			case 0: format(string, sizeof(string), "%d", random(10));
			case 1: string[c] = letters[random(27)];
		}		
	}
	return string;
}
OBS: Nгo testei
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)