Xperia Posted October 14, 2012 Share Posted October 14, 2012 El error esta en que no encuentra el archivo "swat.txd". function skin_panel() PANEL = guiCreateWindow(337,130,333,338,"Skin panel",false) guiSetAlpha(PANEL,1) guiWindowSetMovable(PANEL,true) guiWindowSetSizable(PANEL,false) ON285 = guiCreateButton(160,35,154,26,"ON",false,PANEL) INFO = guiCreateMemo(9,233,315,96,"New skin panel load.\n\n---------------------------\n\nBy SrXperia^",false,PANEL) guiMemoSetReadOnly(INFO,true) OFF285 = guiCreateButton(160,71,154,26,"OFF",false,PANEL) ON287 = guiCreateButton(160,146,154,26,"ON",false,PANEL) OFF287 = guiCreateButton(160,182,154,26,"OFF",false,PANEL) SKIN285 = guiCreateLabel(43,56,123,24,"Skin 285",false,PANEL) guiSetFont(SKIN285,"default-bold-small") SKIN287 = guiCreateLabel(43,167,123,24,"Skin 287",false,PANEL) guiSetFont(SKIN287,"default-bold-small") showCursor(true) end addEventHandler("onClientResourceStart",getRootElement(),skin_panel) function skinOn285 (button,state) if button == "left" and state == "up" then txd = engineLoadTXD ( "swat.txd" ) engineImportTXD ( txd, 285 ) dff = engineLoadDFF ( "swat.dff", 285 ) engineReplaceModel ( dff, 285 ) end end addEventHandler("onClientGUIClick",ON285,skinOn285,false) addEvent("onSkinOn285",true) addEventHandler("onSkinOn285",getRootElement(),skinOn285) PD: Este script no esta terminado. Link to comment
BorderLine Posted October 14, 2012 Share Posted October 14, 2012 lo agregaste a la ACL? estas seguro que tiene exactamente el mismo nombre? y no un espacio o alguna comilla entremedio? Si esta bien el filepath no deberias tener errores. Seria extraño que el txd viniese bugeado. Link to comment
Xperia Posted October 14, 2012 Author Share Posted October 14, 2012 Ya va bien, ahora, ¿como puedo quitar el skin? He intentado con cancelEvent pero no se si lo pongo bien. Link to comment
Renkon Posted October 14, 2012 Share Posted October 14, 2012 comenta las lineas 32,33,34 y 35 Link to comment
Xperia Posted October 14, 2012 Author Share Posted October 14, 2012 function skin_panel() PANEL = guiCreateWindow(337,130,333,338,"Skin panel",false) guiSetAlpha(PANEL,1) guiWindowSetMovable(PANEL,true) guiWindowSetSizable(PANEL,false) ON285 = guiCreateButton(160,35,154,26,"ON",false,PANEL) INFO = guiCreateMemo(9,233,315,96,"New skin panel load.\n\n---------------------------\n\nBy SrXperia^",false,PANEL) guiMemoSetReadOnly(INFO,true) OFF285 = guiCreateButton(160,71,154,26,"OFF",false,PANEL) ON287 = guiCreateButton(160,146,154,26,"ON",false,PANEL) OFF287 = guiCreateButton(160,182,154,26,"OFF",false,PANEL) SKIN285 = guiCreateLabel(43,56,123,24,"Skin 285",false,PANEL) guiSetFont(SKIN285,"default-bold-small") SKIN287 = guiCreateLabel(43,167,123,24,"Skin 287",false,PANEL) guiSetFont(SKIN287,"default-bold-small") showCursor(true) addEventHandler( "onClientGUIClick", ON285, skinOn285, false ) addEventHandler( "onClientGUIClick", ON287, skinOn287, false ) addEventHandler( "onClientGUIClick", OFF285, skinOff285, false ) end addEventHandler("onClientResourceStart",getRootElement(),skin_panel) --PONER SKIN HOMER function skinOn285 (button,state) if button == "left" and state == "up" then txd = engineLoadTXD ( "swat.txd", 285 ) engineImportTXD ( txd, 285 ) dff = engineLoadDFF ( "swat.dff", 285 ) engineReplaceModel ( dff, 285 ) end end addEvent("onSkinOn285",true) addEventHandler("onSkinOn285",getRootElement(),skinOn285) --PONER SKIN WINNIEH function skinOn287 (button,state) if button == "left" and state == "up" then txd = engineLoadTXD ( "army.txd", 287 ) engineImportTXD ( txd, 287 ) dff = engineLoadDFF ( "army.dff", 287 ) engineReplaceModel ( dff, 287 ) end end addEvent("onSkinOn287",true) addEventHandler("onSkinOn287",getRootElement(),skinOn287) --ENCENDER/APAGAR PANEL function toggle() if (guiGetVisible(PANEL)) then showCursor(false) guiSetVisible(PANEL,false) else showCursor(true) guiSetVisible(PANEL,true) end end bindKey("F2","down",toggle) function skinOff285 (button,state) if button == "left" and state == "up" then txd = engineLoadTXD ( "army.txd", 287 ) engineImportTXD ( txd, 287 ) dff = engineLoadDFF ( "army.dff", 287 ) engineReplaceModel ( dff, 287 ) end end addEvent("onSkinOff285",false) addEventHandler("onSkinOff285",getRootElement(),skinOff285) ¿Que hago para que al apretar OFF285, se desactive el skin? Link to comment
Castillo Posted October 14, 2012 Share Posted October 14, 2012 Proba con destroyElement para el TXD y engineRestoreModel para el DFF. Link to comment
Xperia Posted October 14, 2012 Author Share Posted October 14, 2012 Gracias Solid, ya me funciona. Link to comment
Recommended Posts