1. Сократ04.05.2025 в 00:32от
Загрузка...
Загрузка...

[MTA:DayZ - Туториал] Изменяем название машины.

Тема в разделе "Grand Theft Auto", создана пользователем NeonEye, 10.05.2014.

  1. NeonEye

    NeonEye

    Статус:
    Оффлайн
    Регистрация:
    08.09.13
    Сообщения:
    36
    Репутация:
    1 +/-
    Сейчас я вам покажу пример, как изменить имена машин. Нам нужен будет файл survivorSystem_client.lua
    ищем:
    Код:
    local x,y,z = getElementPosition(getLocalPlayer()) 
        for i,veh in ipairs(getElementsByType("vehicle")) do 
           local px,py,pz = getElementPosition (veh) 
           local vehID = getElementModel(veh) 
           local vehicle = getPedOccupiedVehicle(getLocalPlayer()) 
           if veh ~= vehicle then 
           if vehID ~= 548 then 
                       local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) 
                       if pdistance <= 6 then 
                             
                           local sx,sy = getScreenFromWorldPosition ( px, py, pz+0.95, 0.06 ) 
            if sx and sy then 
              
            local w = dxGetTextWidth(getVehicleName(veh),1.02,"default-bold") 
            dxDrawText ( getVehicleName(veh), sx-(w/2), sy, sx-(w/2), sy, tocolor ( 100, 255, 100, 200 ), 1.02, "default-bold" )    
            end 
           end 
           end 
           end 
        end
    заменяем этим:
    Код:
     local x,y,z = getElementPosition(getLocalPlayer()) 
        for i,veh in ipairs(getElementsByType("vehicle")) do 
           local px,py,pz = getElementPosition (veh) 
           local vehID = getElementModel(veh) 
           local vehicle = getPedOccupiedVehicle(getLocalPlayer()) 
           if veh ~= vehicle then 
           if vehID ~= 548 then 
                       local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) 
                       if pdistance <= 6 then 
                           --Get screenposition 
                           local sx,sy = getScreenFromWorldPosition ( px, py, pz+0.95, 0.06 ) 
            if sx and sy then 
            --Draw Vehicle 
            local w = dxGetTextWidth(vehID,1.02,"default-bold") 
            dxDrawText (vehname, sx-(w/2), sy, sx-(w/2), sy, tocolor ( 100, 255, 100, 200 ), 1.02, "default-bold" ) 
            if vehID == 470 then 
            vehname = "Патриотище229" 
            elseif vehID == 468 then 
            vehname = "ЯМАХА1337" 
            elseif vehID == 422 then 
            vehname = "БОБВАШИНГТОН" 
            end 
           end 
           end 
           end 
        end 
        end
    Как сделать для всех машин? Просто смотрите на вики ID машины и добавляйте новую строчку:
    Код:
    elseif vehID == идмашины then 
    vehname = "имя"
    Всё!