Jump to content

Que falla en este scrip?


RekZ

Recommended Posts

lo quiero para reemplazar armas el caso esque antes funcionaba desde que le añadi mas ya no va :/ espero que me puedan ayudar y me digan donde se encuentra el fallo para no cometerlo mas

local skins = {{"m4", 356}, {"ak47", 355}, {"bat", 336}, {"bomb", 363}, {"cuntgun", 357}, {"knifecur", 335}, {"micro_uzi", 352}, {"rocketla", 359}, {"satchel", 365}, {"shotgspa", 351}, {"tec9", 372}} 
      
function load() 
        for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "m4.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "m4.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
   else for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "ak47.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "ak47.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
            else for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "bat.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "bat.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
            else for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "bomb.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "bomb.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
            else for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "cuntgun.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "cuntgun.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
            else for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "knifecur.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "knifecur.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
            else for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "micro_uzi.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "micro_uzi.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
            else for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "rocketla.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "rocketla.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
            else for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "satchel.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "sarchel.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
            else for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "shotgspa.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "shotgspa.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
            else for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin[1].. "tec9.txd" ) 
            engineImportTXD ( txd, skin[2] ) 
            dff = engineLoadDFF ( skin[1].. "tec9.dff", 0 ) 
            engineReplaceModel ( dff, skin[2] ) 
       end 
end 
      
addEventHandler("onClientResourceStart",resourceRoot, 
    function () 
        local version = getVersion() 
        if string.find(version.mta, "1.3") then 
            setTimer ( load, 1000, 1) 
      end 
end) 

Link to comment

Esto es un tremendo lio, la tabla era para remplazar todos los skins a la vez, no tenias porque usar "else" (sin un 'if' nunca iva a funcionar o.O).

local skins = {{"m4", 356}, {"ak47", 355}, {"bat", 336}, {"bomb", 363}, {"cuntgun", 357}, {"knifecur", 335}, {"micro_uzi", 352}, {"rocketla", 359}, {"satchel", 365}, {"shotgspa", 351}, {"tec9", 372}} 
  
function load() 
    for index, skin in pairs(skins) do 
        engineImportTXD(engineLoadTXD ( skin[1].. ".txd" ), skin[2]) 
        engineReplaceModel(engineLoadDFF ( skin[1].. ".dff", skin[2] ) 
    end 
end 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
    setTimer ( load, 1000, 1) 
end) 

Link to comment

Mmm no me kedo muy claro :/ quedaria mas o menos asi el siguiente que añada?

local skins = {{"m4", 356}, {"ak47", 355}, {"bat", 336}, {"bomb", 363}, {":O", 357}, {"knifecur", 335}, {"micro_uzi", 352}, {"rocketla", 359}, {"satchel", 365}, {"shotgspa", 351}, {"tec9", 372}} 
  
function load() 
    for index, skin in pairs(skins) do 
        engineImportTXD(engineLoadTXD ( skin[1].. ".txd" ), skin[2]) 
        engineReplaceModel(engineLoadDFF ( skin[1].. ".dff", skin[2] ) 
        if index, skin in pairs(skins) do 
        engineImportTXD(engineLoadTXD ( skin[1].. ".txd" ), skin[2]) 
        engineReplaceModel(engineLoadDFF ( skin[1].. ".dff", skin[2] ) 
    end 
end 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
    setTimer ( load, 1000, 1) 
end) 

Link to comment

Es que no te das cuenta que tenes una tabla para agregar nuevos skins??

local skins = {{"m4", 356}, {"ak47", 355}, {"bat", 336}, {"bomb", 363}, {":O", 357}, {"knifecur", 335}, {"micro_uzi", 352}, {"rocketla", 359}, {"satchel", 365}, {"shotgspa", 351}, {"tec9", 372}, {"NUEVO", NUEVOMODELOACA}} 

Link to comment
  • Recently Browsing   0 members

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