13/01/2022 13:59
(Esta mensagem foi modificada pela última vez a: 13/01/2022 14:05 por Dr Editor.
Motivo da edição: Correção
)
Um modelo funcional para gerar as placas.
Pra verificar se alguma placa já existe terá que fazer esta verificação junto ao seu sistema de salvamento.
Pra verificar se alguma placa já existe terá que fazer esta verificação junto ao seu sistema de salvamento.
Código PHP:
stock GerarPlaca(placa[])
{
new letras[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
new numeros[] = "0123456789";
new rndChar[2];
for(new i = 0; i < 8; i ++)
{
if(i < 3)
{
new rndCharN = random(strlen(letras));
strcat(rndChar[0], letras[rndCharN], 2);
}
else
{
new rndCharN = random(strlen(numeros));
strcat(rndChar[0], numeros[rndCharN], 2);
}
strcat(placa, rndChar[0], 8);
rndChar[0] = '\0';
}
/*
if(!strcmp(placa, variavel_loop_placas_existentes))
{
// Placa existe
}
*/
}
EVO Anti-Cheat
A melhor defesa contra o melhor ataque! ~> Discord
____________________________________________
Soluções personalizadas para SA:MP e Open.MP
Discord: .eduardoac
A melhor defesa contra o melhor ataque! ~> Discord
____________________________________________
Soluções personalizadas para SA:MP e Open.MP
Discord: .eduardoac