Tomas Posted February 7, 2014 Share Posted February 7, 2014 Hola, un amigo estaba creando un panel freeroam, pero no le abre la parte de los skins, yo lo pongo acá porque el no tiene cuenta: Client: addEventHandler("onClientResourceStart", resourceRoot, function () F1 = guiCreateWindow(6, 164, 279, 367, "Panel de control F1", false) guiWindowSetSizable(F1, false) boton1 = guiCreateButton(24, 50, 222, 16, "Skin / Personaje", false, F1) guiSetFont(boton1, "default-bold-small") boton2 = guiCreateButton(24, 114, 222, 16, "Clothes / Vestimenta", false, F1) guiSetFont(boton2, "default-bold-small") boton3 = guiCreateButton(24, 82, 222, 16, "Animation / Animaciones", false, F1) guiSetFont(boton3, "default-bold-small") boton4 = guiCreateButton(24, 146, 100, 16, "Kill / Suicidarse", false, F1) guiSetFont(boton4, "default-bold-small") boton5 = guiCreateButton(136, 146, 100, 16, "Create / Crear", false, F1) guiSetFont(boton5, "default-bold-small") checkbox1 = guiCreateCheckBox(85, 178, 81, 15, "Fall Of Bike", true, false, F1) guiSetFont(checkbox1, "default-bold-small") label1 = guiCreateLabel(20, 203, 27, 15, "Pos:", false, F1) label2 = guiCreateLabel(68, 203, 36, 15, "", false, F1) label3 = guiCreateLabel(124, 203, 37, 15, "", false, F1) label4 = guiCreateLabel(178, 203, 24, 15, "", false, F1) staticimage1 = guiCreateStaticImage(10, 236, 258, 114, "FotoPanel.png", false, F1) showCursor(true) addEventHandler ( "onClientGUIClick", boton1, perso ) end ) function otworz() if ( guiGetVisible ( F1 )) == false then guiSetVisible ( F1, true ) showCursor ( true ) else guiSetVisible ( F1, false ) showCursor ( false ) guiSetVisible(skin, false) end end bindKey ( "F1", "down", otworz ) function perso () skin = guiCreateWindow(299, 163, 204, 295, "Skin / Personaje", false) guiWindowSetSizable(skin, false) lista = guiCreateGridList(9, 23, 186, 217, false, skin) skinTitleColumn = guiGridListAddColumn(lista,"skin",0.7) skinIDColumn = guiGridListAddColumn(lista, "ID", 0.2) selec = guiCreateButton(10, 250, 84, 35, "Seleccionar", false, skin) cancel = guiCreateButton(110, 250, 84, 35, "Cancelar", false, skin) guiSetVisible(skin, false) guiSetVisible(skin, true) showCursor(true) addEventHandler("onClientGUIClick", cancel, function () guiSetVisible(skin, false) setPlayerHudComponentVisible("all", true) setElementFrozen(localPlayer, false) end, false) end function showSkin(skinsTable) guiGridListClear(lista) setElementFrozen(localPlayer, true) for category, skins in pairs(skinsTable) do local row = guiGridListAddRow(lista) guiGridListSetItemText(lista, row, 1, category, true, false) for id, name in pairs(skins) do local row = guiGridListAddRow(lista) guiGridListSetItemText(lista, row, 1, name, false, false) guiGridListSetItemText(lista, row, 2, id, false, false) end end model = getElementModel(localPlayer) end addEvent("clothes.showSkin", true) addEventHandler("clothes.showSkin", root, showSkin) Server: skinsTable = {} skinsTable.all = {} skinsTable.categories = {} function loadSkins() local xml = xmlLoadFile("files/skins.xml") for index, category in pairs(xmlNodeGetChildren(xml)) do local cName = xmlNodeGetAttribute(category, "name") skinsTable.categories[cName] = {} for index, skin in pairs(xmlNodeGetChildren(category)) do local id, name = xmlNodeGetAttribute(skin, "model"), xmlNodeGetAttribute(skin, "name") skinsTable.categories[cName][id] = name skinsTable.all[id] = name end end xmlUnloadFile(xml) end addEventHandler("onResourceStart", resourceRoot, loadSkins) function getSkinsTable(category) if not category then return skinsTable.categories or false elseif category == "all" then return skinsTable.all or false else return skinsTable[category] or false end return false end function enteredShop(player, matchingDim) if (player and getElementType(player) == "player" and matchingDim) then local skins = getSkinsTable() triggerClientEvent(player, "clothes.showSkin", player, skins) triggerClientEvent(player, "clothes.showSkin", player, skins) end end function getBoughtSkin(player) if (not isElement(player)) then return end return tonumber(getAccountData(getPlayerAccount(player), "clothes.boughtSkin")) or 0 end Meta: > author="TraficanteDeCrack" name="Panel de control F1" version="1.5" type="Script" /> ="Server.lua" type="server" /> ="Client.lua" type="client" /> src="FotoPanel.png" /> function="getBoughtSkin" type="server"/> server="1.3.1-9.04939.0" client="1.3.1-9.04939.0"/>> Y en la carpeta files tengo el skin.xml files/skin.xml Link to comment
BorderLine Posted February 7, 2014 Share Posted February 7, 2014 yo creo que mas que postear las 100 y tantas lineas de todo tu codigo, deberias ser mas especifico. Tambien puedes señalar los errores en debugscript o algo, o simplemente postear la parte del codigo correspondiente y no todo el lua Link to comment
Arsilex Posted February 7, 2014 Share Posted February 7, 2014 en que sentido que no le carga? no le cargan los skins del skins.xml o no le abre el panel de skins por que yo acabo de probarlo y a mi si me abre Link to comment
Tomas Posted February 7, 2014 Author Share Posted February 7, 2014 yo creo que mas que postear las 100 y tantas lineas de todo tu codigo, deberias ser mas especifico.Tambien puedes señalar los errores en debugscript o algo, o simplemente postear la parte del codigo correspondiente y no todo el lua No da errores en el debug... Link to comment
Tomas Posted February 7, 2014 Author Share Posted February 7, 2014 en que sentido que no le carga? no le cargan los skins del skins.xml o no le abre el panel de skins por que yo acabo de probarlo y a mi si me abre Lo que no carga es el panel de skins. Link to comment
Recommended Posts