Jump to content

Gaimo

Members
  • Posts

    212
  • Joined

  • Last visited

Everything posted by Gaimo

  1. I used setElementPosition as androski mentioned on discord and a setTimer and it worked. bindKey(actionKey, "down", function() if playerInColshape then local elementData = getElementData(playerInColshape, "waste_collector") if elementData and elementData.owner == localPlayer then local vehicle = getElementParent(playerInColshape) local x, y, z = getElementPosition(localPlayer) setElementPosition(localPlayer, x, y, z) setTimer(function() setElementCollidableWith(localPlayer, vehicle, false) triggerServerEvent("onPlayerRequestAttach", localPlayer, playerInColshape) end, 50, 1) end end end)
  2. I need to be able to cancel at any time during the execution of entering a vehicle. My problem is the following, there is a collision behind the vehicle, and when the player presses to enter a vehicle and presses the actionKey, he should be attached to the vehicle, but as he is performing the action of entering the vehicle this does not happen, and the problem with this is that the player is left without colliding with the vehicle. Bug demo: https://youtu.be/um9erpGCSzE Client.lua bindKey(actionKey, "down", function() if playerInColshape then local elementData = getElementData(playerInColshape, "waste_collector") if elementData and elementData.owner == localPlayer then local vehicle = getElementParent(playerInColshape) setElementCollidableWith(localPlayer, vehicle, false) triggerServerEvent("onPlayerRequestAttach", localPlayer, playerInColshape) end end end) Server.lua addEvent("onPlayerRequestAttach", true) addEventHandler("onPlayerRequestAttach", root, function(colshape) local player = source local vehicle = getElementParent(colshape) if attachedPlayers[player] then detachPlayerFromVehicle(player) togglePlayerControls(player, true) else attachPlayerToVehicle(player, vehicle) togglePlayerControls(player, false) end end)
  3. I was thinking about creating a supermarket simulator in MTA. I want to know the size of the objects to know how many can fit on each shelf and make the calculation to position the elements, what is the function to obtain the size of an object?
  4. I like the result of a 3d line, I just need to make a few adjustments, it's in the wrong position when it's descending.
  5. I'm creating a zipline resource, and I'd like to know how to create a rope between two points, any ideas? I remember seeing a resource for a gas station, where there was a hose that changed size dynamically. Resource: zipline I don't know if it's a smart option, but I can make some models with fixed sizes, 10 meters, 5 meters, 2 meters and 1 meter. Depending on the distance, I calculate how many objects I need to create and create them in sequence. Example 23 meters away, 2x10m + 2m + 1m. What do you think?
  6. I'm making a resource zipline and I'd like to make the player look in the right direction when he starts moving, any idea how to do that? I would also like to know if there is an animation that looks like the player is using a zipline. Demo:
  7. I have the following problem, I need the blip to be stuck to the edge of the radar. I know I need to do some sort of math.clump, to prevent the blip from rendering outside of the minimap's border function math.clamp( _in, low, high ) return math.min( math.max( _in, low ), high ) end I performed some tests and almost succeeded, however, I'm not sure if the way I implemented to position the blips was the most efficient. How does the radar work? It is based on shader_hud_mask, and it is rendered like this: Any idea how I can do this?
  8. I just changed the texture of the radar outline, radardisc.
  9. I solved the problem by doing this: function dxNewDrawText(...) arg = {...} arg[4] = arg[2] + arg[4] arg[5] = arg[3] + arg[5] dxDrawText(unpack(arg)) end But I would like to understand the reason to use end position.
  10. Gaimo

    [REL] Ball

    Add kick animation - Any animation suggestions, I don't know how to create animations. Add a power bar - This one is good for changing the ball's distance. Add a way to guide the ball while running - This one I don't exactly know how to do. why don't you share your ressource on the mta community ? I'm too lazy to put the information in meta.xml I use Google Translate.
  11. All function related to physics are unavailable yet right? local terrainData = { 3,3,3,3, 3,0,0,3, 3,0,0,3, 3,3,3,3, } local terrainShape = physicsCreateShape(physics, "heightfieldterrain", 4,4, terrainData) local terrain = physicsCreateStaticCollision(terrainShape) physicsSetProperties(terrain, "position", 0,0,5) physicsSetProperties(terrain, "scale", 5,5,1) -- in terrain, sets mesh density, now mesh has size 20x20units, one vertex every 5 units With this script plus shader it would be possible to create custom terrains, right?
  12. Gaimo

    check jump

    local tick = getTickCount() local delay = 150 -- ms local jump = false addEventHandler("onClientRender", root, function() if getTickCount() - tick > delay then if getPedControlState(localPlayer, "jump") and not jump then outputChatBox("jump") jump = true elseif not getPedControlState(localPlayer, "jump") and jump then jump = false end tick = getTickCount() end end) So you can detect, regardless of the key that the player presses.
  13. I know an HTML HUD might not be the best option, I'm still sharing it in case anyone wanted to see some HTML resource as an example. Download
  14. I converted the mod from gta sa to mta -> original mod mta version -> download
  15. Debugscript 3 limpo, feito em DGS, descompilado. Contato: Gaimo#0152 - discord
  16. A simple RP for removing trash from the beach. full server-side, you get $ 50 for every garbage collected, you need pAttach. Any bug found can report here. Download
  17. local object = createObject(1265, 0,0,3) setElementVelocity(object, 0,0,0) wiki createObject Note: Dynamic objects do not automatically have physics applied to them. Use setElementVelocity(object, 0, 0, 0) to fix this. would it be a bug?
  18. local function removeShadow(vehicle) local shader = dxCreateShader("files/replace.fx", 0, 0, false, "vehicle") local texture = dxCreateTexture("files/remove.png") dxSetShaderValue(shader, "gTexture", texture) engineApplyShaderToWorldTexture(shader, "shad_car", vehicle) end and local function removeShadow(vehicle) local shader = dxCreateShader("files/replace.fx", 0, 0, false) local texture = dxCreateTexture("files/remove.png") dxSetShaderValue(shader, "gTexture", texture) engineApplyShaderToWorldTexture(shader, "shad_car", localPlayer) end Neither worked, I want to remove the shadow of a specific vehicle, not all. The texture name of the shadow I know is "shad_car" And this replace shader works because I used it in other things, I just don't understand why it didn't work for the shade. Any solution?
  19. My voice resource is this https://community.multitheftauto.com/index.php?p=resources&s=details&id=15958 I couldn't test it, but does it work? CLIENT-SIDE: addEventHandler("onClientElementStreamIn", root, function () if source:getType() == "player" then if getElementData(source, "call") then return end triggerServerEvent("proximity-voice::broadcastUpdate", localPlayer, getElementsByType("player", root, true)) end end ) addEventHandler("onClientElementStreamOut", root, function () if source:getType() == "player" then if getElementData(source, "call") then return end triggerServerEvent("proximity-voice::broadcastUpdate", localPlayer, getElementsByType("player", root, true)) setSoundPan(source, 0) setSoundVolume(source, 0) end end ) SERVER-SIDE: addCommandHandler("call", function(plr, cmd, target) local target = getPlayerFromPartialName(target) -- return a player setElementData(plr, "call", true) setElementData(target, "call", true) setPlayerVoiceBroadcastTo(plr, target) setPlayerVoiceBroadcastTo(target, plr) end)
  20. A simple vehicle alarm system. I accept suggestions for improvements. Demo: NOTE: It is only possible to open the dashboard after you leave a vehicle as a driver. [Download] UPDATE #1 - Fixed an issue that the menu was not open.
  21. I had problem with this shader, there is even a message from me in this post. shader line 13,9 -> sampler Sampler0 = sampler_state
×
×
  • Create New...