Jump to content

Lalalu

Members
  • Posts

    202
  • Joined

  • Last visited

  • Days Won

    1

Lalalu last won the day on November 29 2023

Lalalu had the most liked content!

Details

  • Gang
    Arianators♡
  • Interests
    die

Recent Profile Visitors

3,726 profile views

Lalalu's Achievements

Chump

Chump (17/54)

4

Reputation

  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.
×
×
  • Create New...