Crow Posted June 10, 2013 Share Posted June 10, 2013 Buenas, como dice el titulo he querido copiar el skinshop que descargue de esta comunidad para hacer otro en el que los usuarios puedan seleccionar gratis skins del juego gta, asi tengo otro skinshop donde se cobran por skin exclusivos de otros juegos. Bueno tengo estos dos skin shop pero al añadirlos al server se combinan, La ventana de la tienda GRATIS con la tienda que COBRA aparecen al mismo tiempo. En el mapa tengo un sitio distinto para cada uno pero aun asi aparecen las dos ventanas ademas de que me cobran por los gratis. Bien lo que quiero es que un resource sea independiente del otro como que si fuera nuevo en resumen tengo esto Skin_shop GRATIS Archivo: GUI2.LUA Wnd = guiCreateWindow ( 0.2, 0.2, 0.25, 0.5, "Skin shop normal", true ) guiSetAlpha( Wnd, 1 ) button = guiCreateButton ( 0.01, 0.8, 0.99, 0.15, "Close", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double click on skin. ($0)", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) vehicles = { {"CJ", 0}, {"The Truth m", 1}, {"Taxi Driver m", 7}, {"Backpacker m", 26}, {"Sexy Woman f", 93}, {"Secretary f", 150}, {"Clothes Shop Staff m", 217}, {"Punk m", 181}, {"Kurt Cobain m", 101}, {"Metal m", 248}, {"Rocker m", 299}, {"Vegas f", 172}, {"Chinese f", 169}, {"Girl f", 211}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Skins", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("useSkin", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function guishowc() guiSetVisible(Wnd,true) showCursor(true) end addEvent("guishowc",true) addEventHandler("guishowc", getRootElement(), guishowc) Archivo: Server2.lua marker = createMarker( 2457, -1673, 14, "cylinder", 2, 255, 255, 0, 255 ) blip = createBlip( 2457, -1673, 14, 45 ) function buy(id) reskin = setElementModel(source, id) takePlayerMoney(source, 0) playeraccount = getPlayerAccount(source) setAccountData(playeraccount, "standardskin", id) end addEvent("useSkin2",true) addEventHandler("useSkin2", root, buy) function guishow(hitPlayer) triggerClientEvent (hitPlayer,"guishowc",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker,guishow) SKIN SHOP QUE COBRA Archivo: GUI.LUA Wnd = guiCreateWindow ( 0.2, 0.2, 0.25, 0.5, "Skin shop", true ) guiSetAlpha( Wnd, 1 ) button = guiCreateButton ( 0.01, 0.8, 0.99, 0.15, "Close", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double click on skin. ($50000)", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) vehicles = { {"Leon Kennedy", 2}, {"Chris Redfield", 23}, {"Heather Mason", 40}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Skins", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("useSkin", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function guishowc() guiSetVisible(Wnd,true) showCursor(true) end addEvent("guishowc",true) addEventHandler("guishowc", getRootElement(), guishowc) precioSkin = 50000 function buy( id ) if ( getPlayerMoney( source ) >= 50000 ) then setElementModel( source, id ) takePlayerMoney( source, precioSkin ) outputChatBox ( "Has comprado tu Skin Satisfactoriamente", source, 0, 255, 0, true ) else outputChatBox ( "Tu dinero no es suficiente para comprar este skin", source, 255, 0, 0, true ) end end addEvent( "useSkin", true ) addEventHandler( "useSkin", root, buy ) Archivo: Server.lua marker = createMarker( 2247.3356933594, -1664.8883056641, 14.4765625, "cylinder", 2, 255, 255, 0, 255 ) blip = createBlip( 2247.3356933594, -1664.8883056641, 14.4765625, 45 ) precioSkin = 50000 function buy( id ) if ( getPlayerMoney( source ) >= 50000 ) then setElementModel( source, id ) takePlayerMoney( source, 50000 ) outputChatBox ( "Has comprado tu Skin Satisfactoriamente", source, 0, 255, 0, true ) else outputChatBox ( "Tu dinero no es suficiente para comprar este skin", source, 255, 0, 0, true ) end end addEvent( "useSkin", true ) addEventHandler( "useSkin", root, buy ) function guishow(hitPlayer) triggerClientEvent (hitPlayer,"guishowc",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker,guishow) En los archivos server notaran que estan en distintos lugares lo cual funciona bien, pero al ponerse encima de el area saltan ambas ventanas de compra ayuda pls !! PD: Sospecho que en los archivos server de ambos hay una funcion llamada function buy( id ) que podria ser el problema ... quizas si la borro o cambio el nombre para el resource de Skin gratis ya no tendria el problema ... Link to comment
BorderLine Posted June 10, 2013 Share Posted June 10, 2013 es porq estas usando los mismos triggers para ambos. Cambiale el nombre a los triggers Link to comment
Crow Posted June 10, 2013 Author Share Posted June 10, 2013 Ok solo a los trigger ? vale Link to comment
Recommended Posts