Jump to content

xPeacefulDreams

Members
  • Posts

    8
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by xPeacefulDreams

  1. Can you explain a bit more what the script does and maybe share the entire script? For example, I see a function called allowshoots being called but no function in the code. Are you trying to give the player that shot money, or the player that got killed? If the player got killed, it might be better to give the money upon onPlayerSpawn The quick answer is you could add something like this: addEventHandler(‘onPlayerWasted’, getRootElement(), function(attacker) if attacker == (some check here if it is a projectile) then setElementHealth(source,100) givePlayerMoney(source,100) end )
  2. Hello everyone, I am currently trying to make a lively MTA freeroam server and I was wondering if anyone knows where to find all the parkingspot/vehicle spawnpoint data in the GTA: San Andreas files. I want to create a script that spawns the vehicles as you enter a specific zone or get close to it. To make it simpler: Is there a file that contains all the parking spots for the entire map. I'm aware of the zone system with different vehicles/ped belonging to a zone and would like to utilize it with that data.
  3. Thanks for the tips! I managed to make it all work through getting the matrices and basing the offsets off of that. It can use some optimization, but it's working. An example: I created a quick sync script that adds Packers with attached vehicles to a list on onElementStreamIn and removes them on onElementStreamOut. That list then gets iterated through and it updates the offsets. I will try the way you proposed it as well. I'm curious as to what works best
  4. Hi IIYAMA, an additional question based on your recommendation. I noticed the functions used for adjusting the loading area are client side. What would be the best way to sync this with other clients?
  5. Hello IIYAMA, Thanks so much for your quick response. Running getVehicleAdjustableProperty reveals 2500 (when raised) and 0 (when lowered) for the Packer. I also just discover getVehicleComponents. Using that I found out that the loading area is called misc_a. Using getComponentPosition and getComponentRotation, I can create vectors and a matrix, which I can hopefully use to position the vehicles properly. If not, I'll try the interpolating! Thanks again. I was stuck with this for quite a while.
  6. Hi Tekken, Whenever you attach two elements you can provide offsets relative to the element you are attaching to. Because of this you it shouldn't be too difficult what you're trying to achieve. I've created a simple script to demonstrate this below. You can provide an offset x, y and z. To spawn something in front of the player, you would have to use y. attachElements(object, player,0,3,0) -- Y is 3, you could change this to be smaller (closer to the player) or bigger (farther away) Here's a quick demo script. You can use /cao <objectid> to create something and then /do to detach it in case something goes wrong. -- Creates object and attaches to player function createAttachedObjectInFrontOfPlayer(player,objectid) local x,y,z = getElementPosition(player) local object = createObject(objectid, x,y,z+10) return attachElements(object, player,0,3,0) end -- Command to create attached object addCommandHandler('cao', function(player, cmd, objectid) if not objectid then outputChatBox("You didn't provide an object ID!",player,255,0,0) return false else createAttachedObjectInFrontOfPlayer(player,tonumber(objectid)) end end ) -- Detaches whatever you attached to the player. addCommandHandler('do', function(player) local attached_elements = getAttachedElements(player) for i, element in ipairs(attached_elements) do detachElements(element,player) end end )
  7. Could you explain what you exactly mean by Spy Mode and what you are trying to listen in to? I can imagine you're trying to read the private messages or something? I guess the question is, what are you trying to monitor? When the player sends a message/chat, or when the player receives a message/chat from someone else?
  8. Hello everyone, I've recently created a resource that allows players to attach vehicles to the Packer (vehicle carrier), drive it somewhere, and unload it by pressing a button. This is all working properly except for two things I have questions about: 1. I can't find a way to programmatically raise or lower the loading area of the Packer (see screenshots below). As a player, pressing 2 raises it and pressing 8 lowers it. I'd like to be able to raise/lower it in a script so I can make sure the cars actually align with it. I tried using setVehicleDoorOpenRatio and setVehicleLandingGearDown hoping it was classified as a door or landing gear, but it unfortunately isn't. 2. Is there a way to grab the matrix/position/rotation of the loading area instead of the entire vehicle so I can properly align the cars to it at all times? It would look a lot better than in screenshot 1 where the cars float above the loading area. To better explain the issue: Screenshot 1: This is how it looks if you spawn a packer and attach vehicles to it. You manually have to raise the loading area in order for it to look proper: Screenshot 2: This is what the packer should look like. Ideally, I'd attach the vehicles to the loading area instead of the entire vehicle, so that they don't float when the loading area is lowered.
×
×
  • Create New...