Jump to content

2kristof2

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by 2kristof2

  1. Hello, It'd be nice if you add support for breakable objects which require additional .dat file. That would be amazing.
  2. Hello, 6th argument of setPedAnimation function should update position of a ped but when I tried to use it in server-sided script it didn't work. It updated its position only if the ped was streamed in.
  3. As I thought. It would be cool to make breakable objects like glass or walls in the future. About particles I meant effects like smoke, explsions, gunshots etc, not ped animations, @Saml1er. I recreate an object every 100 ms and it works fine. Thanks for the answers.
  4. Hello, I've got gta particles in dff files and I have a question if it is possible to edit for example gunshot animation and make it looped? Because when I create an object with this animation it disappears when the animation ends. Also another question, is it possible to make a breakable object in mta? As I know a .dat file is needed so probably it isn't. Thanks.
  5. The element is attached and getElementRotation won't return actual rotation but rotation before attaching. And yes I know all those functions related to attachments but there are needed even more complicated maths to rotate an element by setting its offsets.
  6. Hello, I would like to know how to get rotation of an element (rx,ry,rz) if I have its x,y,z axes and their positions (P1, P2, P3 and element's position are given like in the picture below). Some maths are needed but unfortunately calculating angles is not my strong side. Thanks in advance.
  7. Hello, MTA wiki says: Due to a limitation in GTA, unexpected attach rotations may occur if all rotation offsets are non-zero. (i.e. Try to ensure at least one of 'xRotOffset', 'yRotOffset' or 'zRotOffset' is zero) I want to create group of objects (with random xyz rotations) and make possibility to move them and rotate around all axes (around their center point). I wanted to use simple attachElements but as you can see I can't due to a limitation. So all I want to know is it possible to rotate group of objects around all 3 axes without bugs?
  8. Hello, I made a map which is quiet big and has a big amount of objects (textured objects if it does matter). As everyone knows there is object limit what is really annoying. The best way would be use LODs for all objects but they are so bugged when I tried to use it. Also there is a function called engineSetModelLODDistance but it has nothing to do with extending object limit. I think it's just impossible to solve the problem with a script but I hope I'm wrong. Maybe there is a shader which could help me? Thanks in advance for any help.
  9. Is it possible to edit/delete files of resources which are zipped? I read them succesfully but I have a problem with editing/removing them. Also it's impossible to create a file which is zipped.. What can I do? (I want to change xml file of a resource which is in .zip format)
  10. Hello, I'd like to know how to change selected element in map editor via script. For example I selected an object and want to drop it and select a new created object called object1. I found few server and client events like onElementDrop and onElementSelect but I don't know how to use it. Thanks in advance.
  11. I was checking the collisions in exactly the same way. The handler doesn't trigger for example when I jump on an object with ID 3095. Anyway I don't really need this handler anymore. Thanks for your answer.
  12. It doesn't work on small jumps. You attach the line near a player.
  13. Hey, I have a problem related to this topic. I want to detect collision when bmx hits an object. The problem is that handler "onClientVehicleCollision" not always works. Any suggestions? I was thinking about processLineOfSight but maybe there is better solution, Thanks in advance.
  14. Hey, I wanted to make a texture for 1 object with ID XXXX but it worked for all objects with this ID. Here is lua code of a shader: local blockTexture = {"images/block1.png", "images/block2.png", "images/block3.png"} local shader = dxCreateShader('shader.fx') local t_x = 256 local t_y = 256 local renderTarget = dxCreateRenderTarget(t_x,t_y,true) function start_shaders() dxSetRenderTarget(renderTarget) do dxDrawImage(0,0,256,256, blockTexture[math.random(1,3)]) end dxSetRenderTarget() do dxSetShaderValue(shader,'gTexture',renderTarget) end end addEventHandler('onClientResourceStart',resourceRoot,start_shaders) function apply_shader(element) engineApplyShaderToWorldTexture(shader,'Crate_B', element) end And here .fx file: texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } I wanted to make a function apply_shader which applies a random texture (block1, block2 or block3) to an object by using: call(getResourceFromName("shader"),"apply_shader",block) but it didn't work properly.
  15. Thx for the reply. It's not really what i was looking for. I want to make it by using a shader because it allows me drawing dx images rectangles etc as well
  16. Please guys, I need a simple example which shows how it works, something what changes its value for intance countdown - the script displayes numbers 3..2..1.. every second.
  17. Hello, I created this thread because I'd love to know how to put a text to an object. It can be for example clock or something like that https://forum.multitheftauto.com/viewtopic.php?f=108&t=68962. I know that I have to use a shader for that. I'm not sure but I think I should use this very simple one: texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } I've read some about functions I probably need: dxSetRenderTarget, dxSetShaderValue, engineApplyShaderToWorldTexture etc and I've even made a texture with a text but I have no idea how to make it changing (onClientRender I guess). Any help is appreciated
  18. You are right, I will edit it. And I meant that the acceleration of a vehicle seems to be unstable. (it's not really annoying since I want to use the script only on few parts of a map but still I'd like to fix that) EDIT: nvm I don't really need help already, besides Arezu left mta sadly..
  19. Okay.. It almost works. I did wrong calculation with vx,vy,vz I guess.. because sometimes I drive unnaturally (too fast or too slow it depends in which direction I drive). (25th line) --Script Made By Bulldog~ -- local start = createMarker(3300, -1781.23632, 50.5, "corona" , 5, 0, 255, 255, 255) local stop = createMarker(55, 55, 55, "corona" , 5, 0, 0, 0, 0) local localPlayer = getLocalPlayer() local screenWidth, screenHeight = guiGetScreenSize() function addGravityFinder(veh) addEventHandler("onClientRender", root, magnetWheels) setElementHealth(veh, 1000000) end local power = 0.02 -- magnet's power function removeGravityFinder(veh) removeEventHandler("onClientRender", root, magnetWheels) end function magnetWheels() local veh = getPedOccupiedVehicle(localPlayer) local x,y,z = getElementPosition(veh) local vx,vy,vz = getElementVelocity(veh) local underx,undery,underz = getPositionUnderTheElement(veh) setVehicleGravity(veh, 0, 0, 0) setElementVelocity(veh, (underx - x)*power+vx, (undery - y)*power+vy, (underz - z)*power+vz) end function getPositionUnderTheElement(element) local matrix = getElementMatrix(element) local offX = 0 - 1 * matrix[3][1] + matrix[4][1] local offY = 0 - 1 * matrix[3][2] + matrix[4][2] local offZ = 0 - 1 * matrix[3][3] + matrix[4][3] return offX,offY,offZ end function stopMagnets(var) if var then removeEventHandler("onClientPlayerVehicleEnter", localPlayer, addGravityFinder) removeEventHandler("onClientPlayerVehicleExit", localPlayer, removeGravityFinder) removeEventHandler("onClientRender", root, magnetWheels) local veh = getPedOccupiedVehicle(localPlayer) if veh then setVehicleGravity(veh, 0, 0, -1) end else addEventHandler("onClientPlayerVehicleEnter", localPlayer, addGravityFinder) addEventHandler("onClientPlayerVehicleExit", localPlayer, removeGravityFinder) addEventHandler("onClientRender", root, magnetWheels) end end function magnetMarker(player) if player~=localPlayer then return end if source==start or source==start then stopMagnets(false) elseif source==stop or source==stop then stopMagnets(true) end end addEventHandler("onClientMarkerHit", resourceRoot, magnetMarker)
  20. Oh I tried it before but didn't change vehicle's gravity, it works now! Thanks Arezu
  21. Hi, I used function setVehicleGravity which changes camera view. I'm trying to set the camera back to default settings. I'm sure it's not so easy to do. Maybe someone know where can I find default camera script or how to do that (any tips?) Arezu already solved the problem in magnet script but I can't find any link to check it out ( )If such script isn't public I'd be grateful for any advices regards, 2kristof2
  22. Hey! I have a question If I set too many timers at the same time they cause lags, because setTimer is resource-intensive; if I use many moveObject functions they also will cause lags (fps drops)? I'm asking because I used many timers and I had to remove them because they didn't work effectively. I don't want to have similar problem with moveObject. I'd rather use interpolateBetween or something. thanks!
  23. It worked when I changed bone id but only when I use bone_attach resource, how to make it only for 1 map client-sided? Edit: I think I solved the problem If I find new issues I'll bump this topic. Thanks Citizen PS if someone have an idea which bone would be the best to attach a parachute please write.
×
×
  • Create New...