[Duda] Matriculas Aleatorias
#1

Hola, me gustaria que me dijeran como puedo poner a mi RP matriculas aleatorias ejemplo:

GS 76-4
GS 09-6

Pero siempre con 'GS' delante y al lado un nъmero aleatorio...
Saludos, ojala me ayuden!
Reply
#2

pawn Код:
new matriculas = random(5), string[250];
switch (matriculas)
{
    case 0: format(string, 256, "GS 76-4", PlayerName2(playerid),playerid);
    case 1: format(string, 256, "GS 09-6", PlayerName2(playerid),playerid);
    case 2: format(string, 256, "GS 41-5", PlayerName2(playerid),playerid);
    case 3: format(string, 256, "GS 24-0", PlayerName2(playerid),playerid);
    case 4: format(string, 256, "GS 99-9", PlayerName2(playerid),playerid);
}
SetVehicleNumberPlate(vehicleid, string);
o
pawn Код:
new random1 = random(99), random2 = random(9), string[250];
format(string, 256, "GS %d-%d", random1,random2);
SetVehicleNumberPlate(vehicleid, string);
Usa un 'for(new vehicleid = 0...' para que cada carro tenga una matricula diferente
Reply
#3

emmm podrias decirme que es lo de 'for(new vehcile = 0 ...' esque no eh tenido ocasiуn de usar ese cуdigo, podrias decirme solo como es?
Digame porfavor como es lo de for(new vehicle... o seria:

pawn Код:
for(new vehicles = 0; vehicles < MAX_VEHICLES; vehicles++)
{
new random1 = random(99), random2 = random(9), string[250];
format(string, 256, "GS %d-%d", random1,random2);
SetVehicleNumberPlate(vehicleid, string);
}
??
Gracias y Saludos
Reply
#4

Si, asi es =D.. Saludos!

Este foro requiere que tъ esperes 60 segundos entre mensajes. Por favor intenta de nuevo en 11 segundos.
Reply
#5

Gracias man :P te lo agradezco de verdad!!

TEMA SOLUCIONADO
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)