Jump to content

RobbieG-NL

Members
  • Posts

    11
  • Joined

  • Last visited

Details

  • Gang
    R*

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

RobbieG-NL's Achievements

Square

Square (6/54)

0

Reputation

  1. You, sir, are a hero. My saviour in desperate times. You just deserved my everlasting gratitude. Thanks man
  2. Hello, I've been battling this problem I'm having for a while now, but I failed to figure it out. It's a script that replaces some models in GTA with some of my own (a building), and also places some original GTA models into that building. For some reason I can't rotate the original GTA parts. --[[************************************************************************** * * PROJECT: RobbieG-NL * LICENSE: * FILE: :RobbieG-NL/client/burjKhalifa/burj.lua * PURPOSE: Creation and model replacment functions for the Burj Khalifa. * DEVELOPERS: John Lillis <[email protected]> * *****************************************************************************]] local modelsToReplace = {1900, 1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915} local burjBasePosition, burjZRotation = {0, 0, 0}, 0 --Located in the centre of the map. local burjObjects = {--{modelID, xOffset, yOffset, zOffset} {1915, 0, 0, 0, 0, 0, 0}, {1900, 0, 0, 25.39, 0, 0, 0}, {1901, 0, 0, 29.64205, 0, 0, 0}, {1902, 0, 0, 33.8941, 0, 0, 0}, {1903, 0, 0, 38.14615, 0, 0, 0}, {1904, 0, 0, 42.3982, 0, 0, 0}, {1905, 0, 0, 46.65025, 0, 0, 0}, {1906, 0, 0, 50.9023, 0, 0, 0}, {1907, 0, 0, 55.15435, 0, 0, 0}, {1908, 0, 0, 59.4064, 0, 0, 0}, {1909, 0, 0, 63.65845, 0, 0, 0}, {1910, 0, 0, 67.9105, 0, 0, 0}, {1911, 0, 0, 72.16255, 0, 0, 0}, {1912, 0, 0, 76.4146, 0, 0, 0}, {1913, 0, 0, 80.66665, 0, 0, 0}, {1914, 0, 0, 84,9187, 0, 0, 0}, {14745, -1.638, 25.56, 26.249, 0, 0, 0}, {15039, -9.06, 14.85, 25.704, 0, 0, 180}, {15039, 7.5, 25.65, 25.704, 0, 0, 270}, {15039, 0.07, 47, 25.704, 0, 0, 0}, {15032, 7.15, 40.464, 27.565, 0, 0, 270}, {14535, -6.681, 32.479, 27.7, 0, 0, 90}, {14745, 22.95, -11.36, 26.249, 0, 0, 240}, {15039, 17.392, 0.421, 25.704, 0, 0, 60}, {15039, 19, -18.365, 25.704, 0, 0, 150}, {15039, 40, -23.17, 25.704, 0, 0, 240}, {15032, 31.43, -26.5, 27.565, 0, 0, 150}, {14535, 31.465, -10.45, 27.7, 0, 0, 330}, {14745, -21.32, -14.2, 26.249, 0, 0, 120}, {15039, -8.334, -15.277, 25.704, 0, 0, 300}, {15039, -25.56, -7, 25.704, 0, 0, 30}, {15039, -40.7, -23.413, 25.704, 0, 0, 120}, {15032, -38.64, -14, 27.565, 0, 0, 30}, {14535, -24.785, -22.03, 27.7, 0, 0, 120} } local function resourceStart() local burjKhalifa = createElement("burjKhalifa", "burjKhalifa") setElementPosition(burjKhalifa, burjBasePosition[1], burjBasePosition[2], burjBasePosition[3]) setElementRotation(burjKhalifa, 0, 0, burjZRotation) for i,v in ipairs(burjObjects) do local x, y, z = (burjBasePosition[1] + v[2]), (burjBasePosition[2] + v[3]), (burjBasePosition[3] + v[4]) local newObject = createObject(v[1], x, y, z, 0, 0, burjZRotation) setElementParent(newObject, burjKhalifa) end for i,v in ipairs(modelsToReplace) do local texture = engineLoadTXD("Burj.txd") engineImportTXD(texture, v) local colission = engineLoadCOL("Burj"..i..".col") local model = engineLoadDFF("Burj"..i..".dff", 0) engineReplaceCOL(colission, v) engineReplaceModel(model, v) engineSetModelLODDistance(v, 500) end local burjBlip = createBlip(burjBasePosition[1], burjBasePosition[2], burjBasePosition[3], 19, 2, 255, 0, 0, 255, 0, 500) setElementParent(burjBlip, burjKhalifa) --This is to reload the collision data when the local player gets near the Burj local streamingColShape = createColCircle(burjBasePosition[1], burjBasePosition[2], 250) setElementParent(streamingColShape, burjKhalifa) addEventHandler("onClientColShapeHit", streamingColShape, streamInBurj) --addEventHandler("onClientColShapeLeave", streamingColShape, streamOutBurj) end addEventHandler("onClientResourceStart", resourceRoot, resourceStart) --Streams the burj IN function streamInBurj(hitElement, dimensionMatch) if hitElement ~= localPlayer or not dimensionMatch then return end for i,v in ipairs(modelsToReplace) do local texture = engineLoadTXD("Burj.txd") engineImportTXD(texture, v) local colission = engineLoadCOL("Burj"..i..".col") local model = engineLoadDFF("Burj"..i..".dff", 0) engineReplaceCOL(colission, v) engineReplaceModel(model, v) engineSetModelLODDistance(v, 500) end end --[[ THIS CAUSES A CRASH --Streams the burj OUT function streamOutBurj(hitElement, dimensionMatch) if hitElement ~= localPlayer then return end for i,v in ipairs(modelsToReplace) do engineRestoreCOL(v) engineRestoreModel(v) end end]] Model ID's 14745, 15039, 15032 and 14745 need to be rotated, but in game they keep showing up un-rotated. Please help...
  3. Lmao, never mind that. I figured it out. By interior objects I meant the standard GTA interiors that are used in houses, for example: ID 14502 Turns out I can now simple add lines under the coordinates for ID's 1915. Thanks a lot. If you ever need a model of anything, just let me know and I'll do what I can for you. I can make them small in kb's or very detailed with more kb's. Any way you like it. Thanks a lot for all your time, effort and patience.
  4. Hahaha, nice. I've had something else working in the meantime, but that required me to copy/paste most of the script 4 times. This is a much cleaner way to do it. Thanks a million. Got another question though: can I add interior objects in this same lua script? If so, how? Or would it be better to do that in a new file? Again, if so, how?
  5. I decided to make a new topic for my new problem: viewtopic.php?f=91&t=50546 It's about the same model, but a different script. I need to get the rotations for the various parts in order, but so far I've had no success with it. If there's an easier way to do it, by editing the script above, I'm pleased to know about that.
  6. Hello, Today I finally made this show my model in MTA (viewtopic.php?f=91&t=50434&p=493519). Unfortunately I can't get the seperate parts to be rotated in the correct way. I can only rotate the first part (line 2, by changing the 0 into another number for degrees). What I want to do is give the 4 seperate parts their own rotation. I'm pretty sure line 3 has something to do with it, but since I am a total idiot/n00b when it comes to coding, I'm not sure at all. Been trying for some hours now, in numerous ways, but so far, without any success. What am I missing here? local modelsToReplace = {1915} local castleBasePosition, castleZRotation = {20, -1995, 5}, 0 --Located just west of Area 69. local castleObjects = {--{modelID, xOffset, yOffset, zOffset} {1915, -129.182, 0, 0, 0, 0, 270}, {1915, -129.182, -129.182, 0, 0, 0, 180}, {1915, 0, -129.182, 0, 0, 0, 90}, {1915, 0, 0, 0, 0, 0, 0}, } local function resourceStart() local castle = createElement("castle", "castlea") setElementPosition(castle, castleBasePosition[1], castleBasePosition[2], castleBasePosition[3]) setElementRotation(castle, 0, 0, castleZRotation) for i,v in ipairs(castleObjects) do local x, y, z = (castleBasePosition[1] + v[2]), (castleBasePosition[2] + v[3]), (castleBasePosition[3] + v[4]) local newObject = createObject(v[1], x, y, z, 0, 0, castleZRotation) setElementParent(newObject, castle) end for i,v in ipairs(modelsToReplace) do local texture = engineLoadTXD("castle.txd") engineImportTXD(texture, v) local colission = engineLoadCOL("castle.col") local model = engineLoadDFF("castle.dff", 1915) engineReplaceCOL(colission, v) engineReplaceModel(model, v) engineSetModelLODDistance(v, 500) end local castleBlip = createBlip(castleBasePosition[1], castleBasePosition[2], castleBasePosition[3], 19, 2, 255, 0, 0, 255, 0, 500) setElementParent(castleBlip, castle) --This is to reload the collision data when the local player gets near the castle local streamingColShape = createColCircle(castleBasePosition[1], castleBasePosition[2], 250) setElementParent(streamingColShape, castle) addEventHandler("onClientColShapeHit", streamingColShape, streamInCastle) --addEventHandler("onClientColShapeLeave", streamingColShape, streamOutCastle) end addEventHandler("onClientResourceStart", resourceRoot, resourceStart) --Streams the castle IN function streamInCastle(hitElement, dimensionMatch) if hitElement ~= localPlayer or not dimensionMatch then return end for i,v in ipairs(modelsToReplace) do local texture = engineLoadTXD("castle.txd") engineImportTXD(texture, v) local colission = engineLoadCOL("castle.col") local model = engineLoadDFF("castle.dff", 0) engineReplaceCOL(colission, v) engineReplaceModel(model, v) engineSetModelLODDistance(v, 500) end end BTW, debugscript is giving me no errors or anything.
  7. Lol, I found out why: I had to replace line 13 (local texture = engineLoadTXD("castle/castle.txd")) with this: local texture = engineLoadTXD("castle.txd") Same with the lines for the col and dff (15 and 16). So it works now ^^ Thanks a lot for the input. I've got a new question though, but I will try to figure it out myself first. Thanks a lot so far
  8. This is the info given to me by "debugscript 3": WARNING: castle\castle.lua:12: Load error @ 'engineLoadTXD'(unable to load "castle/castle.txd'] WARNING: castle\castle.lua:13: Bad 'txd' pointer @ 'engineImportTXD'(1) WARNING: castle\castle.lua: 14: Load error @ 'engineLoadCOL' (Unable to load "castle/castle.col'] WARNING: castle\castle.lua: 15: Load error @ 'engineLoadDFF' (Unable to load "castle/castle.dff'] WARNING: castle\castle.lua: 16: Bad 'col' pointer @ 'engineImportCOL'(1) WARNING: castle\castle.lua: 17: Bad 'dff' pointer @ 'engineImportModel'(1) WARNING: castle\castle.lua: 21: Bad argument @ 'setElementParent' WARNING: castle\castle.lua: 26: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil] BTW, I've removed line 6, since it doesn't seem to serve any purpose and it gave me an error as well.
  9. Indeed it did. The other stuff is a term set by BinaryHead, the main scripter of the Full Theft Auto server. Here is his post about that:
  10. The error I get is that it only shows the original model 1915, which is a pokerchip. This script works fine (in un-edited version) for another model I made: a race track. Replacing this model with a simpler script works fine, but then I have to place it on the map with runcode. This is the simpler script that works: function loadCastle() local texture = engineLoadTXD("Castle.txd") engineImportTXD(texture, 1915) local collision = engineLoadCOL("Castle.col") local model = engineLoadDFF("Castle.dff", 1915) engineReplaceCOL(collision, 1915) engineReplaceModel(model, 1915) end addEventHandler("onClientResourceStart", getResourceRootElement(), loadCastle) But with this script I need to use a code via runcode to place it on the map: srun castle = createObject(1915, 20, -1995, 5, 0, 0, 0)
  11. Hello, Last week I've finished a model I've been creating (a castle) to place into the Full Theft Auto server. There is a script involved that is meant to put the model in a fixed position. I've edited a script that's used for another model of mine, to work for this castle. But for some reason it only shows the original model 1915 (a pokerchip) on the place where the castle should be. Can somebody tell me where I made a mistake and how to correct it? I've been trying and trying, but nothing worked for me so far. Also, Id like to add 3 more locations for that model in the same script. And I'd also like to add 144 interiors in this script. If you feel like it, please let me know how to add the rest of the coordinates with the corresponding model ID's. Any help will be much appreciated. local modelToReplace = 1915 local castleBasePosition, castleBaseRotation = {20, -1995, 5}, 0 --Located west of Los Santos beach. local function resourceStart() local castle = createElement("castle", "castle") setElementPosition(v, castleBasePosition[1], castleBasePosition[2], castleBasePosition[3]) setElementRotation(castle, 0, 0, castleBaseRotation) local castleBase = createObject(modelToReplace, castleBasePosition[1], castleBasePosition[2], castleBasePosition[3]) setElementRotation(castleBase, 0, 0, castleBaseRotation) setElementParent(castleBase, castle) local texture = engineLoadTXD("castle/castle.txd") engineImportTXD(texture, modelToReplace) local colission = engineLoadCOL("castle/castle.col") local model = engineLoadDFF("castle/castle.dff", modelToReplace) engineReplaceCOL(colission, modelToReplace) engineReplaceModel(model, modelToReplace) engineSetModelLODDistance(modelToReplace, 500) local vBlip = createBlip(20, -1995, castleBasePosition[3], 53, 2, 255, 0, 0, 255, 0, 500) setElementParent(castleBlip, castle) --This is to reload the collision data when the local player gets near the castle local streamingColShape = createColCircle(castleBasePosition[1], castleBasePosition[2], 250) setElementParent(streamingColShape, castle) addEventHandler("onClientColShapeHit", streamingColShape, streamInCastle) --addEventHandler("onClientColShapeLeave", streamingColShape, streamOutcastle) end addEventHandler("onClientResourceStart", resourceRoot, resourceStart) function streamIncastle(hitElement, dimensionMatch) if hitElement ~= localPlayer or not dimensionMatch then return end local texture = engineLoadTXD("castle/castle.txd") engineImportTXD(texture, modelToReplace) local colission = engineLoadCOL("castle/castle.col") local model = engineLoadDFF("castle/castle.dff", modelToReplace) engineReplaceCOL(colission, modelToReplace) engineReplaceModel(model, modelToReplace) engineSetModelLODDistance(modelToReplace, 500) end
×
×
  • Create New...