Jump to content

Paintjobs (mehrere TXDs) ersetzen


Recommended Posts

WIe tuht man eigentl. die Paintjobs ersetzen (die mehrere TXDs)???

Hab schon ein lua mit tuningteile

function adminFahrzeug()  
 txd = engineLoadTXD ( "model/sultan.txd" ) 
engineImportTXD ( txd, 560) 
dff = engineLoadDFF ( "model/sultan.dff", 560) 
engineReplaceModel ( dff, 560) 
  
dff = engineLoadDFF ( "tuning/exh_a_s.dff", 1028) 
engineReplaceModel ( dff, 1028) 
  
dff = engineLoadDFF ( "tuning/exh_c_s.dff", 1029) 
engineReplaceModel ( dff, 1029) 
  
dff = engineLoadDFF ( "tuning/fbmp_a_s.dff", 1169) 
engineReplaceModel ( dff, 1169) 
  
dff = engineLoadDFF ( "tuning/fbmp_c_s.dff", 1170) 
engineReplaceModel ( dff, 1170) 
  
dff = engineLoadDFF ( "tuning/rbmp_a_s.dff", 1141) 
engineReplaceModel ( dff, 1141) 
  
dff = engineLoadDFF ( "tuning/rbmp_c_s.dff", 1140) 
engineReplaceModel ( dff, 1140) 
  
dff = engineLoadDFF ( "tuning/rf_a_s.dff", 1032) 
engineReplaceModel ( dff, 1032) 
  
dff = engineLoadDFF ( "tuning/rf_c_s.dff", 1033) 
engineReplaceModel ( dff, 1033) 
  
dff = engineLoadDFF ( "tuning/spl_a_s_b.dff", 1138) 
engineReplaceModel ( dff, 1138) 
  
dff = engineLoadDFF ( "tuning/spl_c_s_b.dff", 1139) 
engineReplaceModel ( dff, 1139) 
  
dff = engineLoadDFF ( "tuning/wg_l_a_s.dff", 1026) 
engineReplaceModel ( dff, 1026) 
  
dff = engineLoadDFF ( "tuning/wg_l_c_s.dff", 1031) 
engineReplaceModel ( dff, 1031) 
  
dff = engineLoadDFF ( "tuning/wg_r_a_s.dff", 1027) 
engineReplaceModel ( dff, 1027) 
  
dff = engineLoadDFF ( "tuning/wg_r_c_s.dff", 1030) 
engineReplaceModel ( dff, 1030) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), adminFahrzeug) 

Wie mache ich mit Paintjobs??

Die Dateien:

Sultan1.txd

Sultan2.txd

Sultan3.txd

Link to comment

Hy AtiBoy94,

das Ganze ist an sich ganz einfach.

nur anstelle von

engineLoadDFF 

und

engineReplaceModel 

nimmst du

engineLoadTXD ( string txd_file [, bool filteringEnabled = true ] ) 

und

engineImportTXD ( txd texture, int model_id )  

dann schaut das ganze so aus

  
function pj_sultan1( commandName ) 
1 = engineLoadTXD ( "Sultan1.txt" ) 
engineImportTXD (1,560) 
end 
function pj_sultan2( commandName ) 
2 = engineLoadTXD ( "Sultan2.txt" ) 
engineImportTXD (2,560) 
end 
function pj_sultan3( commandName ) 
3 = engineLoadTXD ( "Sultan3.txt" ) 
engineImportTXD (3,560) 
end 
  
addCommandHandler ( "sultan1", pj_sultan1) 
addCommandHandler ( "sultan2", pj_sultan2) 
addCommandHandler ( "sultan3", pj_sultan3) 
  
  

Hab leider nix anderes gefunden fl. könnte mir mal jemand sagen wie ich in ein Command eine variable ein bau und auslesen kann

MFG

cs8898

Link to comment
Hy AtiBoy94,

das Ganze ist an sich ganz einfach.

nur anstelle von

engineLoadDFF 

und

engineReplaceModel 

nimmst du

engineLoadTXD ( string txd_file [, bool filteringEnabled = true ] ) 

und

engineImportTXD ( txd texture, int model_id )  

dann schaut das ganze so aus

  
function pj_sultan1( commandName ) 
[color=#FF0000]txd[/color]1 = engineLoadTXD ( "Sultan1.txt" ) 
engineImportTXD ([color=#FF0000]txd[/color]1,560) 
end 
function pj_sultan2( commandName ) 
[color=#FF0000]txd[/color]2 = engineLoadTXD ( "Sultan2.txt" ) 
engineImportTXD ([color=#FF0000]txd[/color]2,560) 
end 
function pj_sultan3( commandName ) 
[color=#FF0000]txd[/color]3 = engineLoadTXD ( "Sultan3.txt" ) 
engineImportTXD ([color=#FF0000]txd[/color]3,560) 
end 
  
addCommandHandler ( "sultan1", pj_sultan1) 
addCommandHandler ( "sultan2", pj_sultan2) 
addCommandHandler ( "sultan3", pj_sultan3) 
  
  

Hab leider nix anderes gefunden fl. könnte mir mal jemand sagen wie ich in ein Command eine variable ein bau und auslesen kann

MFG

cs8898

  
function MONSTER_INIT() 
    for i,elm in pairs(aSkinList) do 
        if elm[2] ~= -1 then 
            local texture = nil; 
            local iCounter = 0; 
            while not texture do 
                texture = engineLoadTXD ( "models/"..elm[1].."txd", true ); 
                iCounter = iCounter + 1; 
                if iCounter > 20 then 
                    outputDebugString("Texture loading failed."); 
                    break; 
                end 
            end 
            local model = engineLoadDFF ( "models/"..elm[1].."dff", elm[2] ); 
            if model and texture then 
                local iCounter = 0; 
                local bLoaded = true; 
                while not engineImportTXD ( texture, elm[2] ) do 
                    iCounter = iCounter + 1; 
                    if iCounter > 20 then 
                        outputDebugString("Texture import failed."); 
                        bLoaded = false; 
                        break; 
                    end 
                end 
                if bLoaded then 
                    engineReplaceModel ( model, elm[2] ); 
                end 
            end 
        end 
    end 
end 
  
function MONSTER_DEINIT() 
    for i,elm in pairs(aSkinList) do 
        local texture = engineRestoreModel ( elm[2] ); 
    end 
end 
  

Sowas?

Übrigens:

function pj_sultan1( commandName )

txd1 = engineLoadTXD ( "Sultan1.txt" )

engineImportTXD (txd1,560)

end

function pj_sultan2( commandName )

txd2 = engineLoadTXD ( "Sultan2.txt" )

engineImportTXD (txd2,560)

end

function pj_sultan3( commandName )

txd3 = engineLoadTXD ( "Sultan3.txt" )

engineImportTXD (txd3,560)

end

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...