Jump to content

How to change items name in skin list


dam034

Recommended Posts

It is downloaded from a website, and I have modified something.

meta.xml

 <meta> 
    <info author="Damiano M" version ="1.1.1" type ="misc" description="Contachilometri con km/h, mph, nome e salute del veicolo" /> 
    <script src="speedo.lua" type="client" /> 
    <file src="carattere.ttf" /> 
 </meta> 

speedo.lua

spfont = dxCreateFont("carattere.ttf", 15) 
  
function conta() 
    if isPedInVehicle(localPlayer) == false then 
        return 
    end 
    sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) 
    kmhs = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) 
    mphs = math.floor((((sx^2 + sy^2 + sz^2)^(0.5))*180)/1.6) 
    health = getElementHealth (getPedOccupiedVehicle(localPlayer)) 
    name = getVehicleName (getPedOccupiedVehicle(localPlayer)) 
    currenthealth = math.floor(health/10) 
    screenWidth, screenHeight = guiGetScreenSize() 
    windowWidth, windowHeight = 300, 170 
    left = screenWidth/1.15 - windowWidth/4.5 
    top = screenHeight/1.15 - windowHeight/20 
    px, py, pz = getElementPosition(localPlayer) 
    posizione = getZoneName(px, py, pz, false) 
    dxDrawText ( " "..posizione, left ,  top -123, screenWidth +2, screenHeight , tocolor ( 0, 0, 0, 255 ), 1, spfont ) 
    dxDrawText ( " #FF8040"..posizione, left -2,  top-125, screenWidth, screenHeight -2, tocolor ( 0, 255, 255, 255 ), 1, spfont, "left", "top", false, false, false, true ) 
    dxDrawText ( " "..tostring(name).." ", left ,  top -93, screenWidth +2, screenHeight , tocolor ( 0, 0, 0, 255 ), 1, spfont ) 
    dxDrawText ( " "..tostring(name).." ", left -2,  top -95, screenWidth, screenHeight -2, tocolor ( 0, 255, 0, 255 ), 1, spfont ) 
    dxDrawText ( " "..tostring(currenthealth).."%", left ,  top -63, screenWidth +2, screenHeight , tocolor ( 0, 0, 0, 255 ), 1, spfont ) 
    dxDrawText ( " "..tostring(currenthealth).."#00FF00%", left -2,  top -65, screenWidth, screenHeight -2, tocolor ( 255, 12, 0, 255 ), 1, spfont, "left", "top", false, false, false, true  ) 
    dxDrawText ( " ___________________", left -2,  top -62, screenWidth, screenHeight -2, tocolor ( 255, 0, 0, 255 ), 1, spfont ) 
    dxDrawText ( " ___________________", left -2,  top -60, screenWidth, screenHeight -2, tocolor ( 0, 0, 0, 255 ), 1, spfont ) 
    dxDrawText ( " "..tostring(kmhs).."km/h", left ,  top -23, screenWidth +2, screenHeight , tocolor ( 0, 0, 0, 255 ), 1, spfont ) 
    dxDrawText ( " "..tostring(kmhs).."#00FF00km/h", left -2,  top -25, screenWidth, screenHeight -2, tocolor ( 0, 255, 255, 255 ), 1, spfont, "left", "top", false, false, false, true ) 
    dxDrawText ( " "..tostring(mphs).."mph", left ,  top +2, screenWidth +2, screenHeight , tocolor ( 0, 0, 0, 255 ), 1, spfont ) 
    dxDrawText ( " "..tostring(mphs).."#00FF00mph", left -2,  top, screenWidth, screenHeight -2, tocolor ( 0, 255, 255, 255 ), 1, spfont, "left", "top", false, false, false, true ) 
end 
  
addEventHandler("onClientRender", root, conta) 

And there is the file carattere.ttf, which is the font file.

The name of the vehicle is taken by getVehicleName(), I want to change this in the script of MTA.

Thanks

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...