How to make a numberplate
#1

Okay, making this post just because I have to explain myself like a 3 year old other wise people get confused. Lets just try one thing at a time now without the big words that might confuse some of us.
*Rant over*

I am looking for that little bit of code that will make a number plate with letters and numbers

for example.
LLL - NNN
or
LLL-NNN

The L's standing for letters and the N's standing for numbers

An example number plate.
JHQ-492
Reply
#2

This function may works, i didn't tested.

https://sampforum.blast.hk/showthread.php?tid=353154

it was to be at that topic, But you have created another topic, So, i just post in this new one.

it will set random plates for each car.
pawn Код:
new lol1[3][] =
{
 "A", "B", "C"
};

new lol2[3][] =
{
  "1", "2", "3"
};
public OnPlayerConnect(playerid)
{
 new lol3[8];
 for(new i=0;i<MAX_VEHICLES;i++)
 {
   new Vehicle = GetPlayerVehicleID(playerid);
   i = Vehicle;
   format(lol3,sizeof(lol3),"%s%s%s %d%d%d",lol1[random(sizeof(lol1))],lol1[random(sizeof(lol1))],lol1[random(sizeof(lol1))],lol2[random(sizeof(lol2))],lol2[random(sizeof(lol2))],lol2[random(sizeof(lol2))]);
   SetVehicleNumberPlate(i,lol3);
 }
}
Reply
#3

Okay thanks, and at least you tried to help, unlike the rest of them just trying to get their post count up on ignoring what I have previously asked/said and coming back with the most stupidest response.

Thanks mate.
Reply
#4

After setting the number plate you have to respawn the vehicle.
Using SetVehicleToRespawn(vehicleid);
Reply
#5

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
This function may works, i didn't tested.

https://sampforum.blast.hk/showthread.php?tid=353154

it was to be at that topic, But you have created another topic, So, i just post in this new one.

it will set random plates for each car.
pawn Код:
new lol1[3][] =
{
 "A", "B", "C"
};

new lol2[3][] =
{
  "1", "2", "3"
};
public OnPlayerConnect(playerid)
{
 new lol3[8];
 for(new i=0;i<MAX_VEHICLES;i++)
 {
   new Vehicle = GetPlayerVehicleID(playerid);
   i = Vehicle;
   format(lol3,sizeof(lol3),"%s%s%s %d%d%d",lol1[random(sizeof(lol1))],lol1[random(sizeof(lol1))],lol1[random(sizeof(lol1))],lol2[random(sizeof(lol2))],lol2[random(sizeof(lol2))],lol2[random(sizeof(lol2))]);
   SetVehicleNumberPlate(i,lol3);
 }
}
Why not use a little more professional variable naming? It's not a good habit to use random words/letters for variables, especially not when teaching newbies.
Reply
#6

As far as i know, i can use what i want for anything i want, it's up to him to change it, not myself.

At least i've tried to help, unlike few others.
Reply
#7

Quote:
Originally Posted by Littlehelper[MDZ]
Посмотреть сообщение
After setting the number plate you have to respawn the vehicle.
Using SetVehicleToRespawn(vehicleid);
Cheers for that handy tip

Quote:
Originally Posted by SWEMike
Посмотреть сообщение
Why not use a little more professional variable naming? It's not a good habit to use random words/letters for variables, especially not when teaching newbies.
I Understand what you mean but I am quite capable of changing a variable name but you have a strong point

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
As far as i know, i can use what i want for anything i want, it's up to him to change it, not myself.

At least i've tried to help, unlike few others.
You also hold a strong point here, at least you have tried to assist me, and thank you for that, All of ya's :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)