Jump to content

Destroyer.-

Members
  • Posts

    103
  • Joined

  • Last visited

Destroyer.-'s Achievements

Punk-@ss B*tch

Punk-@ss B*tch (12/54)

0

Reputation

  1. I modified the argument localplayer , and I also pulls the warn, throws me nil in the second argument of the event. how could I fix it?
  2. Hi, I have a problem with creating a marker with a table, create the marker, but it gives me a warn to debug and not found local marker = {} function Test() marker[source] = createMarker(-1055.3283691406,-1679.3109130859,76,"cylinder",5.5,255,255,0,170 ) end addEvent("Test", true) addEventHandler("Test",root,Test) function TestMarker() exports.sidechat:outputSideChat ( "test", 255, 0, 0) end addEventHandler("onClientMarkerHit",marker[source],TestMarker)
  3. Hice eso pero a medida q la barra va pasando se queda abajo el texto function renderizar_progreso( ) progreso_barra = progreso_barra + 0.4 if progreso_barra >= 300 then removeEventHandler( "onClientRender", root, renderizar_barras ) removeEventHandler( "onClientRender", root, renderizar_progreso ) end end addEventHandler( "onClientRender", root, renderizar_progreso ) function renderizar_barras( ) dxDrawRectangle((screenW - 23) / 2-131, (screenH - 10) / 2, 300, 25, tocolor(0, 0, 0, 160), true) dxDrawRectangle((screenW - 23) / 2-131, (screenH - 10) / 2, progreso_barra, 25, tocolor(0, 255, 0, 255), true) dxDrawBorderedText ("Drogandose",(screenWidth - 15) / 2 -120, (screenHeight - 10) / 2, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 2, "sans" ) dxDrawText ("Drogandose",(screenWidth - 15) / 2 -120, (screenHeight - 10) / 2, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 2, "sans" ) end addEventHandler( "onClientRender", root, renderizar_barras ) Solucionado, gracias a los 2
  4. Aka Blue tu codigo me funciono, gracias, como podria que este texto se superponga a la barra progresando dxDrawText ("Drogandose",(screenWidth - 15) / 2 -120, (screenHeight - 10) / 2, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 2, "sans" )
  5. Hola, tengo un problema con DXRectangle, estoy tratando de hacer una barra que vaya progresando, me tira error del tercer argumento local screenW, screenH = guiGetScreenSize() local i = 0 function render() i=i+0.4 if i >= 300 then removeEventHandler("onClientRender", root, drawing) end end addEventHandler("onClientRender", root, drawing) function drawing() dxDrawRectangle((screenW - 23) / 2-131, (screenH - 10) / 2, i, 25, tocolor(144, 3, 3, 255), true) dxDrawRectangle((screenW - 23) / 2-131, (screenH - 10) / 2, 300, 25, tocolor(0, 0, 0, 130), true) end Gracias a los que ayuden
  6. setAccountData https://wiki.multitheftauto.com/wiki/SetAccountData Ya lo solucione hace dias, Gracias igual
  7. Lo que quiero es que me vuelva al skin que esta en la database, osea, cuando elijo, y cancelo, me queda el skin elegido, pero yo no puse aceptar, nose si me entiende, de ultima lo hago con un ped si no me entendieron Ejemplo: Yo tomo el skin ID 250, y pongo aceptar -> me lo pone BIEN Yo tomo el skin ID 250, y pongo Salir -> me queda el skin tomado, pero yo no quise cambiarlo PD: Solucionado gracias a los que me ayudaron
  8. Aún asi no funciona, y no arroja ningun debug
  9. De nada , recuerda que cancelEvent no lleva argumentos en client
  10. function abortAllStealthKills(thePlayer) if ( getElementInterior(thePlayer) == 1 ) then cancelEvent() end end addEventHandler("onClientPlayerStealthKill", root, abortAllStealthKills)
  11. Esto te puede servir. https://forum.multitheftauto.com/viewtopic.php?f=148&t=38203
  12. emm function ComprarSkin(id) -- Al Comprar skin --> takePlayerMoney(source, 0) local account = getPlayerAccount(source) if ( not isGuestAccount( getPlayerAccount( source ) ) ) then skin = setElementModel(source, id) setAccountData(account,"Sking",id) outputChatBox("Skin Guardado Exitosamente.", source, 255, 20, 20, true) end end addEvent("skins",true) addEventHandler("skins", root, ComprarSkin) function removers() -- Al Cerrar Panel --> if not (isGuestAccount (getPlayerAccount (source))) then local acc = getPlayerAccount(source) local skinG = getAccountData (acc, "Sking") -- Cargar skin que habia seleccionado anteriormente outputChatBox ( "Test", source, 170, 0, 0, false ) setElementModel(source, skinG) -- setearle el skin anterior end end addEvent("remover",true) addEventHandler("remover", root, removers) Sking es un skin que uno elige al registrarse, o en el mismo skinshop, es como que al cambiar el skin en client , porque en realidad, si guarda el skin, pero no lo setea, si me cambio el skin con el panel de admin y me seteo el skin si guarda, pero el problema seria al setear el model en client, pero no se como repararlo , dejo el script completo, total es de la comunidad local marker = createMarker ( 2247.3356933594, -1664.8883056641, 14.4765625, "cylinder", 2, 0, 255, 0, 255 ) local marker2 = createMarker ( 1734.7803955078, -1861.1599121094, 12.577855110168, "cylinder", 2, 0, 255, 0, 255 ) blip = createBlip (2247.2526855469,-1664.8112792969,15.4765625, 45,2, 0, 0, 0,0,0,1000.0 ) function ComprarSkin(id) -- Al Comprar skin --> takePlayerMoney(source, 0) local account = getPlayerAccount(source) if ( not isGuestAccount( getPlayerAccount( source ) ) ) then skin = setElementModel(source, id) setAccountData(account,"Sking",id) outputChatBox("Skin Guardado Exitosamente.", source, 255, 20, 20, true) end end addEvent("skins",true) addEventHandler("skins", root, ComprarSkin) function removers() -- Al Cerrar Panel --> if not (isGuestAccount (getPlayerAccount (source))) then local acc = getPlayerAccount(source) local skinG = getAccountData (acc, "Sking") outputChatBox ( "Test", source, 170, 0, 0, false ) setElementModel(source, skinG) end end addEvent("remover",true) addEventHandler("remover", root, removers) function MarkerSkin(player) if (getElementType(player) =="player" and getPlayerTeam(player) and getTeamName (getPlayerTeam(player)) == "Criminal" or getTeamName (getPlayerTeam(player)) == "Desocupados") then triggerClientEvent (player,"marker_skines",getRootElement(),player) end end addEventHandler("onMarkerHit",marker,MarkerSkin) addEventHandler("onMarkerHit",marker2,MarkerSkin) Windows = guiCreateWindow ( 0.2, 0.2, 0.25, 0.5, "Skin Shop", true ) grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Windows) guiGridListAddColumn(grid, "Skins", 0.85) guiSetAlpha( Windows, 1 ) button1 = guiCreateButton ( 0.5, 0.8, 0.45, 0.15, "Salir", true, Windows) button2 = guiCreateButton ( 0.02, 0.8, 0.45, 0.15, "Aceptar", true, Windows) label1 = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Skin PARA TODOS DE LA KRISTI", true, Windows ) showCursor(false) guiSetVisible( Windows, false ) guiWindowSetSizable( Windows, false ) guiWindowSetMovable( Windows, false ) skines = { {"CJ", 0}, {"Sweet", 270}, {"Ryder", 300}, {"Ryder 2", 301}, {"Big Smoke", 269}, {"Big Smoke 2", 311}, {"Truth", 1}, {"Wuzi Mu", 294}, {"Claude", 299}, {"Madd Dogg", 297}, {"Mike Toreno", 295}, {"Cesar", 292}, {"OG Loc", 293}, {"T-Bone", 307}, {"Joe Pesci", 258}, {"Pimp", 249}, {"White Dealer", 29}, {"Black Dealer", 28}, {"Hiker", 26}, {"Casino Bouncer 1", 163}, {"Casino Bouncer 2", 164}, {"Drug Worker 1", 144}, {"Drug Worker 2", 145}, {"Drug Worker 3", 146}, } function aceptar() -- Funcion para comprar skin if (source == button2) then 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("skins", localPlayer, model) --Trigger al tocar el boton Aceptar guiSetVisible(Windows,false) showCursor(false) end end end end addEventHandler("onClientGUIClick", button2, aceptar) function close1() -- Funcion para cerrar el panel if (source == button1) then triggerServerEvent("remover", localPlayer) -- Trigger al tocar el boton Cerrar guiSetVisible(Windows,false) showCursor(false) end end addEventHandler("onClientGUIClick", button1, close1) function MarkerSkines() -- Funcion al tocar el marker guiSetVisible(Windows,true) showCursor(true) guiGridListClear(grid) for i,sk in ipairs(skines) do row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1, tostring(sk[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(sk[2])) end end addEvent("marker_skines",true) addEventHandler("marker_skines", getRootElement(), MarkerSkines) function click1 () -- Funcion para tomar el skin seleccionado local item = guiGridListGetItemData( grid, guiGridListGetSelectedItem ( grid ), 1 ) if item then setElementModel ( localPlayer, item ) end end addEventHandler("onClientGUIClick", grid, click1)
  13. Si perdoname. ahí actualice el post para que se entienda mas, generalmente en lua nunca eh puesto comentarios, los pondre si posteo asi me entienden
  14. Hola tengo un problema con un "skin shop" es que, quiero que tenga una vista previa para ver el skin y ahi recien comprarlo, pero pasa que cuando quiero volver al skin anterior, osea al que tenia antes de q tome la vista previa, no me deja, aca dejo el : client skines = { {"CJ", 0}, {"Sweet", 270}, {"Ryder", 300}, {"Ryder 2", 301}, {"Big Smoke", 269}, {"Big Smoke 2", 311}, {"Truth", 1}, {"Wuzi Mu", 294}, {"Claude", 299}, {"Madd Dogg", 297}, {"Mike Toreno", 295}, {"Cesar", 292}, {"OG Loc", 293}, {"T-Bone", 307}, {"Joe Pesci", 258}, {"Pimp", 249}, {"White Dealer", 29}, {"Black Dealer", 28}, {"Hiker", 26}, {"Casino Bouncer 1", 163}, {"Casino Bouncer 2", 164}, {"Drug Worker 1", 144}, {"Drug Worker 2", 145}, {"Drug Worker 3", 146}, } function aceptar() -- Funcion para comprar skin if (source == button2) then 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("skins", localPlayer, model) --Trigger al tocar el boton Aceptar guiSetVisible(Windows,false) showCursor(false) end end end end addEventHandler("onClientGUIClick", button2, aceptar) function close1() -- Funcion para cerrar el panel if (source == button1) then triggerServerEvent("remover", localPlayer) -- Trigger al tocar el boton Cerrar guiSetVisible(Windows,false) showCursor(false) end end addEventHandler("onClientGUIClick", button1, close1) function MarkerSkines() -- Funcion al tocar el marker guiSetVisible(Windows,true) showCursor(true) guiGridListClear(grid) for i,sk in ipairs(skines) do row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1, tostring(sk[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(sk[2])) end end addEvent("marker_skines",true) addEventHandler("marker_skines", getRootElement(), MarkerSkines) function click1 () -- Funcion para tomar el skin seleccionado local item = guiGridListGetItemData( grid, guiGridListGetSelectedItem ( grid ), 1 ) if item then setElementModel ( localPlayer, item ) end end addEventHandler("onClientGUIClick", grid, click1) server function ComprarSkin(id) -- Al Comprar skin --> takePlayerMoney(source, 0) local account = getPlayerAccount(source) if ( not isGuestAccount( getPlayerAccount( source ) ) ) then skin = setElementModel(source, id) setAccountData(account,"Sking",id) outputChatBox("Skin Guardado Exitosamente.", source, 255, 20, 20, true) end end addEvent("skins",true) addEventHandler("skins", root, ComprarSkin) function removers() -- Al Cerrar Panel --> if not (isGuestAccount (getPlayerAccount (source))) then local acc = getPlayerAccount(source) local skinG = getAccountData (acc, "Sking") outputChatBox ( "Test", source, 170, 0, 0, false ) end end addEvent("remover",true) addEventHandler("remover", root, removers)
  15. Entonces ni es tanto que digamos, ya que los servidores de hoy en dia suelen tener mas de 2gb de RAM, por lo que 5 kbs no creo que sea algo significativo, aunque obvio, es mejor hacer todo de forma optima para hacer las cosas de la forma mejor posible
×
×
  • Create New...