[Ajuda] Random de Letras
#1

Boas pessoal, eu gostava de saber se hб como fazer um codigo Random de Letras...
Eu tenho as matriculas dos carros do meu servidor e o formato й NUMERO-LETRA-NUMERO, ou, LETRA-NUMERO-NUMERO, ou NUMERO-NUMERO-LETRA.
Os numeros eu consigo meter random mas as letras nгo :S
Reply
#2

lol...tindi nda.....
Reply
#3

pawn Код:
new letras[] = "oaiwejasjdhasiudnacawlegasba";
new string[4];
for(new i = 0; i < 4; ++i)
{
    new rand = random(sizeof letras);    
    strins(string, strlen(string), letras[rand], strlen(string)+1);
}
Reply
#4

Obrigado cynic
Reply
#5

Cynic,porque nгo usar isto

pawn Код:
new letras[] = "wertyuiopsdfghjklzxcvbnm", string[4],iLoop;
while(++iLoop < 5)
    string[iLoop] = letras[random(sizeof letras)];
Ou Atй como Slice disse:

pawn Код:
new string[5] = 1000 + vehicleid;
Reply
#6

Obrigadгo
Agora quero ver se consigo meter as matriculas do 0.3c a gravar com a Dini mas nгo ta fбcil :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)