Skip to content

Add a new country

Guillaume BÉNIT edited this page Dec 22, 2016 · 1 revision

Create the texture of the license plate

Create a .png file of 4096*1024 pixels.

Example : en.png

Save your picture on materials/licenseplate/plate/"ID of picture".png

File

Open LicensePlate/lua/autorun/licenseplate_lang.lua

Set parameters of the license plate

Add a new line and paste this code under the last country.

["en"]={
		["Texture"]="licenseplate/plate/en.png",
		["SetTextColor"]=Color(0,0,0),
		["SetTextPos"]={2,2},
		["SetFontSize"]=125
},

en is the ID of country.

licenseplate/plate/en.png is the path of the texture for plate (use on .png file and 4K texture (4096*1024 pixels) en.png ).

Color(0,0,0) is the color of the text (use rgb color).

{2,2} is the posstion of the text (center is 2,2).

125 is the size of the text.

Generate the text of license plate

Add a new line and paste this code under the last country.

if LicensePlate.lang=="en" then
		return math.random(1,9)..LicensePlate_let(ply,1)..LicensePlate_let(ply,10)..LicensePlate_rlet().." "..LicensePlate_id(ply)
end

en is the ID of country.

List of tags

  • math.random(1,9) generate a number between 1 and 9 (1 is the minumum number and 9 is the maximum number).

  • LicensePlate_rlet() generate a random letter.

  • LicensePlate_let(ply,1) generate a letter with the firt letter of player name. (1 is the number to add a letter. Example : if the first letter of player name is "A" then the generate letter is "B").

  • LicensePlate_id(ply) generate a unique ID at three number for player.

  • " " create a space.

Note : for separate the different functions you need use .. ! Example : math.random(1,9)..LicensePlate_let(ply,1)

Generate the text of license plate for NPC

Add a new line and paste this code under the last country.

if LicensePlate.lang=="en" then
		return "▓"..LicensePlate_let(ply,1)..LicensePlate_let(ply,10).."▓".." "..LicensePlate_id(ply)
end

Copy/Paste the last code and replace math.random(1,9) and LicensePlate_rlet() with "▓".

End

Save your code and launch your server.

Open your console and enter : LicensePlate_country "ID of your contry".

Restart your server and have fun !

Note : for view the currently country, open your context menu and open "License plate". The blue button show the country.

License Plate

Addon for Garry's Mod. Add license plates on your vehicles !

Download last release : LicensePlate-master.zip

Download snapshot release : LicensePlate-dev.zip

Follow this addon on Steam Workshop (for server) : License plate

Follow this addon on Steam Workshop (for client) : License plate - content

Clone this wiki locally