Jump to content

Lalalu

Members
  • Posts

    202
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Lalalu

  1. Hello everyone, i was wondering if there's a way to make some models exceptions on this code, that is supposed to delete all GTA default models but i need the ints to not be deleted so i want to know how can i make exceptions for some interior models.. addEventHandler("onResourceStart", resourceRoot, function() for i=550, 20000 do removeWorldModel(i, 10000, 0, 0, 0) setOcclusionsEnabled(false) end end)
  2. Holaa, gracias por responder mi post. Disculpa, no suelo visitar frecuentemente el foro, pero acabo de testear así: local sX, sY = guiGetScreenSize ( ) function dxDrawImageOnArmas (TheArmas,ImageArmas, distance,height,width,R,G,B,alpha) local cx, cy, cz = getCameraMatrix ( ); local x, y, z = getPedBonePosition ( TheArmas, 6 ); local dArmasIcon = getDistanceBetweenPoints3D( cx, cy, cz, x, y, z); if ( dArmasIcon < 10 ) then if (isLineOfSightClear(cx, cy, cz, x, y, z, true, true, false, false, true, false, false, localPlayer )) then local sx, sy = getScreenFromWorldPosition ( x, y, z+0.55 ) if ( sx ) and ( sy ) then local sArmasIcon =760 / dArmasIcon; dxDrawImage ( sx - ( sArmasIcon / 2 ), sy - ( sArmasIcon / 2 ), sArmasIcon, sArmasIcon, ImageArmas, 0, 0, 0, tocolor (R or 255, G or 255, B or 255, alpha or 255) ); end end end end local Pos_Armas = { {117, -169.2294921875, -75.96875, 711.21716308594, 315}, {141, -166.08984375, 1883.509765625, 724, 272}, {245, -1591.166015625, -607.01483154297, 711.17346191406, 39}, {207, 2073.5895996094, 88.1796875, 721.94860839844, 9}, {117, 2560.8657226562, 1050.4641113281, 727.25622558594, 270} } local NPCArmas = {} local TagArmas = dxCreateTexture("Images/Icon.webp") for i,v1 in ipairs (Pos_Armas) do CrearPedArmas = createPed(v1[1],v1[2],v1[3],v1[4],v1[5]) table.insert(NPCArmas,#NPCArmas + 1,CrearPedArmas) setElementFrozen ( CrearPedArmas, true ) setPedVoice(CrearPedArmas, "PED_TYPE_DISABLED", "") setPedAnimation( CrearPedArmas, "SMOKING", "M_SMK_LOOP",-1,true,false,false,false ) addEventHandler ( "onClientPedDamage",CrearPedArmas, function () cancelEvent() end) addEventHandler("onClientPlayerStealthKill",localPlayer, function (targetPlayer) if targetPlayer == CrearPedArmas then cancelEvent() end end) end addEventHandler( "onClientElementStreamIn", root, function () if getElementType(source) == "ped" and not NPCArmas[source] then NPCArmas[source] = source end end ) addEventHandler( "onClientElementStreamOut", root, function () if NPCArmas[source] then NPCArmas[source] = nil end removeEventHandler("onClientRender", root, dxDrawImageOnArmas) addEventHandler("onClientRender", root, dxDrawImageOnArmas) end ) addEventHandler("onClientElementDestroy", root, function () if NPCArmas[source] then NPCArmas[source] = nil end end ) function dxDrawImageOnArmas() local draw = false for _,PedArmas in pairs(NPCArmas) do if PedArmas then draw = true local x, y, z = getElementPosition(PedArmas) dxDrawImageOnArmas(PedArmas,TagArmas) end end if not draw then removeEventHandler("onClientRender", root, dxDrawImageOnArmas) end end Pero no funciona, me aparece un error y me ocasiona muchisimo lag.. :line 71: stack overflow
  3. Thank you. OK ok im gonna try that
  4. Well, i want to achieve that with my inventory system (another script) opening a box gives you a skin and add it to the gridlist. I want to know how can I add a skin to that gridlist from another script so i can try to use it with my inventory.
  5. Hello there! thanks for visiting my post. Some of you helped me a lot a few months ago with a skin save list using database. Today, this post is to ask you if its possible to add skins to that list from another script, for example using a command from another external script. This is the code i'm using; Server side function myskins(thePlayer,commandName) if thePlayer then local acc = getPlayerAccount( thePlayer ) local acc_name = getAccountName( acc ) local q = dbQuery(connection,"SELECT username,skin FROM skins WHERE username=?",tostring(acc_name)) local rezult = dbPoll(q,-1) if #rezult > 0 then triggerClientEvent(thePlayer,"skin_inventory",thePlayer,rezult) end end end addCommandHandler("myskins",myskins,false,false) addEvent("ChangeSkin",true) change_skin = function(Player,skin) if source == Player and client == source then setElementModel(Player,skin) end end addEventHandler("ChangeSkin",getRootElement(),change_skin) Client side function centerWindow (center_window) local screenW, screenH = guiGetScreenSize() local windowW, windowH = guiGetSize(center_window, false) local x, y = (screenW - windowW) /2,(screenH - windowH) /2 return guiSetPosition(center_window, x, y, false) end addEvent("skin_inventory",true) function skin_inventory_gui(rezult) skin_list = guiCreateWindow(329, 246, 465, 381, "MY SKINS", false) centerWindow(skin_list) guiWindowSetMovable(skin_list, false) guiWindowSetSizable(skin_list, false) skins = guiCreateGridList(9, 20, 376, 351, false, skin_list) guiGridListAddColumn(skins, "Description", 0.5) guiGridListAddColumn(skins, "Model/Skin Owned", 0.5) close = guiCreateButton(389, 20, 66, 21, "X", false, skin_list) set_skin = guiCreateButton(389, 40, 66, 21, "SET SKIN", false, skin_list) guiSetProperty(close, "NormalTextColour", "FFAAAAAA") showCursor(true) for key, value in ipairs(rezult) do local row = guiGridListAddRow(skins) guiGridListSetItemText (skins, row, 1, "Skin Model ->", false, true) guiGridListSetItemText (skins, row, 2, value.skin, false, true) end addEventHandler ( "onClientGUIClick", close, closeinventory,false) addEventHandler ( "onClientGUIClick", set_skin, closeinventory,false) end addEventHandler("skin_inventory",root,skin_inventory_gui) closeinventory = function(button,state) if (button == "left") and (state == "up") then if source == set_skin then if (guiGridListGetSelectedItem (skins)) then local skin_to_change = guiGridListGetItemText (skins, guiGridListGetSelectedItem (skins), 2) triggerServerEvent("ChangeSkin",localPlayer,localPlayer,skin_to_change) outputChatBox("[SKIN SYSTEM] You have changed your skin",160,255,160) end end showCursor (false) guiSetVisible(skin_list,false) end end
  6. Thanks Im gonna try, I used to use serverside, but then when many players took the mission at the same time everything got mixed up lol
  7. Sorry, it's client side. I'm using destroyElement with setTimer to destroy the markers and to create it again, but when i quit the server and join again the markers appears. The missions I have created work like this: When you hit a marker, execute the mission and immediately delete that marker, that way the mission cannot be done again until the marker appears again. What I'm looking for is to save that, 'cause the missions must be daily, I want to make that the marker reappears only the next day once its deleted
  8. Hello everyone, I need help with something, I'm creating missions for my server, I want the missions to only be done daily, I mean, the marker and ped once the mission is done disappears and appears the next day. The problem is, when I destroy the ped and the marker (destroyElement) and I quit or reconnect into the server, the ped and the marker appears again. How can I save destroyElements and make it appears daily once it's destroyed?
  9. Thank you... like this? @alex17" local sX, sY = guiGetScreenSize ( ) function dxDrawImageOnWeapon (TheWeapon,ImageWeapon, distance,height,width,R,G,B,alpha) local cx, cy, cz = getCameraMatrix ( ); local x, y, z = getPedBonePosition ( TheWeapon, 6 ); local dWeaponIcon = getDistanceBetweenPoints3D( cx, cy, cz, x, y, z); if ( dWeaponIcon < 10 ) then if (isLineOfSightClear(cx, cy, cz, x, y, z, true, true, false, false, true, false, false, localPlayer )) then local sx, sy = getScreenFromWorldPosition ( x, y, z+0.55 ) if ( sx ) and ( sy ) then local sWeaponIcon =760 / dWeaponIcon; dxDrawImage ( sx - ( sWeaponIcon / 2 ), sy - ( sWeaponIcon / 2 ), sWeaponIcon, sWeaponIcon, ImageWeapon, 0, 0, 0, tocolor (R or 255, G or 255, B or 255, alpha or 255) ); end end end end local Pos_Weapon = { {310, 2442.2729492188, -1592.2652587891, 2383.9047851562, 267}, {310, 1825.6822509766, -285.5888671875, 2399.453125, 2} } local NPCWeapon = {} local TagWeapon = dxCreateTexture("myimage.webp") for i,v in ipairs (Pos_Weapon) do local CrearPedWeapon = createPed(v[1],v[2],v[3],v[4],v[5]) table.insert(NPCWeapon,#NPCWeapon + 1,CrearPedWeapon) end addEventHandler( "onClientElementStreamIn", root, function () if getElementType(source) == "ped" and not NPCWeapon[source] then NPCWeapon[source] = source end end ) addEventHandler( "onClientElementStreamOut", root, function () if NPCWeapon[source] then NPCWeapon[source] = nil end end ) addEventHandler("onClientElementDestroy", root, function () if NPCWeapon[source] then NPCWeapon[source] = nil end end ) addEventHandler("onClientRender",root,function() for _,PedWeapon in ipairs(NPCWeapon) do local x, y, z = getElementPosition(PedWeapon) dxDrawImageOnWeapon(PedWeapon,TagWeapon) end end)
  10. Hola, una pregunta ¿cual podría ser la mejor forma de crear varios peds sin que generen lag o disminuya el rendimiento? Cada ped tiene un icono encima (dx imagen). Si coloco muchos peds en el servidor me genera bastantes bajones de fps de 60 a 30 - 35, habrá alguna forma de mejorar el rendimiento sin tener que eliminar los peds? o alguna otra forma de crearlos? por lo general los creo todos client side, con sus dx
  11. Hello, I want to know how can I put on the same bar normal health and extra health, normal health is 100 but extra health increase constantly by levels, how can i adapt a bar for both health? that looks full and adapts to the extra health
  12. Lalalu

    Ped Saving

    Hello, how can I create a PED that when players killed It reappears the next day or at 12 hrs? That it does not appear when you reconnect on the server, only the next day or at specific time.
  13. Hello, I want to know how can I detect when a bot dies? But, not when someone kills it, only when it dies, for example when it jumped off a cliff, or another bot killed it, i mean, only detect when it dies in a general way and give a reward by dropping a pickup.
  14. Hola, estoy creando un sistema de animales usando el slothbot de la comunidad, pero quisiera saber como puedo hacer para detectar cuando el bot muere (se que se puede usar onBotWasted) pero quiero que detecte cuando muera, de forma general, no necesariamente que un jugador lo mate, sino que simplemente por ejemplo haya una explosión y se queme y muera y de la recompensa, sin necesidad de detectar si alguien lo mató o no.
  15. thanks, but its not working with that
  16. Thank you @FlorinSzasz It works! by the way, how can I change or set my skin by clicking on item from the list?
  17. Hola, hago el post para preguntar si hay alguna forma de detectar cuando el jugador está mirando al SOL. Mi idea es crear un lensflare o reflejo cuando el jugador mira al sol, pero con una imagen para que no se me haga tan complicado, pero quisiera saber como detecto cuando la cámara mire al sol... por favor.
  18. Hola que tal, estoy teniendo problemas con algo y vengo a solicitar de su ayuda o consejo. Estoy creando ciertos peds que deberían tener imágenes en su cabeza como indicadores, el problema es que los estoy creando en una tabla ya que son varios, mi situación es la siguiente: ¿Como puedo crearle la imagen a todos los peds con un solo render? Sin necesidad de crear cada ped por separado y añadirles un render individual a cada uno... o sea un solo render para todos los peds de la tabla. Inserto la tabla de ejemplo con la cual creo los peds: local Pos_Seta = { {323.9013671875, 2490.8134765625, 15.484375}, {335.341796875, 2486.669921875, 15.484375}, {330.0751953125, 2496.310546875, 15.484375}, {325, 2480.7265625, 15.484375} } for i,v in ipairs (Pos_Seta) do Ped_Seta = createPed(20, v[1],v[2],v[3])
  19. Hola a todos, una pregunta. Estoy creando una tienda y sus items se guardarán en una gridList el motivo de mi post es el siguiente... supongamos están a la venta 5 items: • Arma 1 • Arma 2 • Arma 3 • Arma 4 • Arma 5 Como hago para que por ejemplo si compro el Arma 1 salga en la lista, y si compro el Arma 5 despues salga debajo del item anterior y así. No quiero asignarles un slot de la lista especifico sino que se vaya anexando uno debajo del otro y así sucesivamente.
  20. Hello everyone. I am creating a skins store, but I would like to know how I can save each skin I buy in a list, as items since there are many skins. Is there a way to create a save system for each skin? saving it by id? I don't know if I explain myself well.
  21. Hola que tal, necesito de vuestra ayuda para saber si es posible lo siguiente: Como hago para aplicar un shader donde todos los objetos del mapa e incluso los objetos custom se vean negros totalmente de forma localplayer que solo lo vea el jugador que lo active y luego desactive si quiere, sin que este shader afecte al jugador o sea que el ped siga viéndose normal. Tengo problemas solo con la creación del shader, alguien podría ayudarme o explicarme?
  22. Hello everyone, I need your help with something please. I'm trying to create something like pick items and stuff like that, plants, mushrooms, etc etc. This creates a table with Objects and Collisions. I want to know how can I delete just the collision that I hit and the object in that position as well, not the other elements in the table just the elements that I hit. local sx,sy = guiGetScreenSize() local px,py = 1280,720 local x,y = (sx/px), (sy/py) playerSeta = getLocalPlayer() local Pos_Seta = { {323.9013671875, 2490.8134765625, 15.484375}, {335.341796875, 2486.669921875, 15.484375}, {330.0751953125, 2496.310546875, 15.484375}, {325, 2480.7265625, 15.484375} } for i,v in ipairs (Pos_Seta) do Obj_Seta = createObject(2427, v[1],v[2],v[3]) setObjectScale(Obj_Seta, 1.5) Col_Seta = createColSphere (v[1],v[2],v[3], 1.5) Blip_Seta = createBlip(v[1],v[2],v[3], 33, 2.5, 255, 0, 0, 255, 0, 100) addEventHandler( "onClientColShapeHit", Col_Seta, function(pSeta) if pSeta == playerSeta then addEventHandler('onClientRender', getRootElement(), Text_Seta) bindKey('F','down',StartSeta, playerSeta) end end) addEventHandler( "onClientColShapeLeave", Col_Seta, function(pSeta) if pSeta == playerSeta then removeEventHandler('onClientRender', getRootElement(), Text_Seta) unbindKey('F','down',StartSeta, playerSeta) end end) end function StartSeta () triggerServerEvent ( "StartSeta", localPlayer) unbindKey('F','down',StartSeta, playerSeta) end function Text_Seta () dxDrawText("Use (F) to pick this item", x*481, y*483, x*800, y*501, tocolor(255, 255, 255, 255), 1.35, "default-bold", "center", "top", false, false, false, false, false) end
  23. Hello everyone, i need help with something... I have a tsunami script loaded on my server, but a few zones have holes and the tsunami doesnt include the water outside the limit of the map. I see that theres a new function to include the water outside the world map, how can I use this? includeOutsideWorldSea
  24. Hola, estoy teniendo problemas con algo. Estoy creando un sistema de pesca, es más que todo client-side, al entrar a un marker te sale la UI para comenzar a pescar y te crea la Caña de Pescar etc etc, para la creación de la caña estoy usando un trigger desde el client al server-side, igual para su eliminación, por ejemplo: ---- Client Side: triggerServerEvent("crear.cana", localPlayer) --- Para llamar al server y crear la caña triggerServerEvent("borrar.cana", localPlayer) --- Al momento de borrarla ----- Server side: function Crear_Cana() ---- Aquí se crea la caña de pescar CanaObj = createObject(1851,x,y,z,0,0,0) exports.pAttach:attach(CanaObj, source, 25, -0.1,-0.19,0.1,21.6,136.8,-46.8) end addEvent("crear.cana", true) addEventHandler("crear.cana", root, Crear_Cana) function Borrar_Cana() --- Aquí se elimina la caña de pescar if isElement (CanaObj) then destroyElement(CanaObj) end end addEvent("borrar.cana", true) addEventHandler("borrar.cana", root, Borrar_Cana) Mi problema es el siguiente, supongamos que 2 jugadores entran al marker al mismo tiempo, o simplemente entran ambos para comenzar a pescar, al momento de crear o eliminar la caña se mezcla entre ambos jugadores, es decir, si un jugador termina de pescar la caña le será borrada al otro, o si el otro comienza a pescar la caña se le crea al otro jugador como si todo se conectara o mezclara con el otro jugador... agradecería si pudieran ayudarme al respecto. La creación del marker y todo decidí hacerlo client-side, usé los triggers solo para las cosas que quiero que los demás jugadores vean en el servidor, por ejemplo cuando tenga una caña o capture un pez pero sucede lo que ya mencioné anteriormente, que se mezcla la función con otros jugadores que pesquen al mismo tiempo.
×
×
  • Create New...