
Ace_Gambit
Members-
Posts
569 -
Joined
-
Last visited
Everything posted by Ace_Gambit
-
DP3 will have support for peds.
-
Here's an idea that I posted earlier in the wrong thread (must have been drunk or something ). When DP3 is out you can try to put a dummy ped inside the helicopter (maybe even hide it by setting alpha to 0) and remove it when you start entering (assuming the helicopter engine is turned on by putting a dummy ped inside).
-
LOL, wrong topic...
-
Some times it does that when the vehicle is not within streaming radius of an active player.
-
Probably because that is 1337.
-
What are you looking forward to in DP3?
Ace_Gambit replied to I_R_Venom's topic in Public beta testing
Yes, I know . But what I meant was interchangeable themes that you can script and distribute to other clients. -
What are you looking forward to in DP3?
Ace_Gambit replied to I_R_Venom's topic in Public beta testing
I want better support for custom fonts. And I want to be able to change the ce-gui scheme because the current one is ugly. -
It should be possible to script the crane.
-
Yes, this is possible with the attachElementToElement function.
-
Erm, yes that is possible. I can run this game on my laptop but it stresses out when the intro video is played. Even my desktop pc starts vomiting when the video is enabled even though I can play the game just fine.
-
I can understand that some people find it annoying that the video is enabled by default. When you start the game on a slow computer even getting to things like settings is a seriously challenge.
-
This confuses even me. When you create the customer marker in let's say onPlayerJoin call back everything goes fine. Even if you define the customer marker globally it doesn't work even though the marker is created successfully. Maybe this is a bug because I've tried all possibilities that should have worked but didn't. Also when you want to make a blip explicitly visible to one or a group of players you must hide it for the entire root first. This is DP2 related as well.
-
Global scope is the magic word.
-
pplace is not known outside the pizzaDeliveryHandler function. You are trying to compare source in onMarkerHitHandler but this function does not know pplace exists.
-
Here's a simplified function that calculates the offset values relative to posX, posY, posZ and outputs pseudo Lua script code. The object configuration file is read from objects.xml (create this file in the root of your game mode folder). You can build a ferry boat in the race map editor and copy the object elements to the objects.xml file. Example objects.xml "hull" posX="2150.595703" posY="-1724.988647" posZ="6.562508" rotX="0.0000" rotY="0.0000" rotZ="270.0000" model="10771" /> "ldeck" posX="2150.602051" posY="-1662.088379" posZ="5.380146" rotX="0.0000" rotY="0.0000" rotZ="270.0000" model="11145" /> "hangar" posX="2151.157227" posY="-1716.000000" posZ="13.407950" rotX="0.0000" rotY="0.0000" rotZ="269.9999" model="11146" /> "bits" posX="2143.061523" posY="-1728.324463" posZ="39.771801" rotX="0.0000" rotY="0.0000" rotZ="269.9999" model="11237" /> Don't forget to add this line to your meta.xml file: "objects.xml" type="server" /> local objects = {} function outputOffsetDebug(posX, posY, posZ) local rootNode = getResourceConfig(getThisResource(), "objects.xml") local nextSibling = 0 local node = false local gX, gY, gZ = 0, 0, 0 local oX, oY, oZ = 0, 0, 0 objects = {} if (rootNode) then node = xmlFindSubNode(rootNode, "object", nextSibling) while (node) do table.insert(objects, { ["name"] = xmlNodeGetAttribute(node, "name"), ["model"] = tonumber(xmlNodeGetAttribute(node, "model") or 0), ["posX"] = tonumber(xmlNodeGetAttribute(node, "posX") or 0), ["posY"] = tonumber(xmlNodeGetAttribute(node, "posY") or 0), ["posZ"] = tonumber(xmlNodeGetAttribute(node, "posZ") or 0), ["rotX"] = tonumber(xmlNodeGetAttribute(node, "rotX") or 0), ["rotY"] = tonumber(xmlNodeGetAttribute(node, "rotY") or 0), ["rotZ"] = tonumber(xmlNodeGetAttribute(node, "rotZ") or 0), ["xPosOffset"] = 0, ["yPosOffset"] = 0, ["zPosOffset"] = 0 } ) nextSibling = nextSibling + 1 node = xmlFindSubNode(rootNode, "object", nextSibling) end end oX, oY, oZ = objects[1].posX, objects[1].posY, objects[1].posZ for _, object in ipairs(objects) do gX = math.abs(posX - oX) gY = math.abs(posY - oY) if (object.posX > posX) then gX = object.posX - gX else gX = object.posX + gX end if (object.posY > posY) then gY = object.posY - gY else gY = object.posY + gY end object.posX = gX object.posY = gY end for _, object in ipairs(objects) do gX = math.abs(posX - object.posX) gY = math.abs(posY - object.posY) gZ = object.posZ if (object.posX < posX) then gX = -(gX) end if (object.posY < posY) then gY = -(gY) end object.xPosOffset = gX object.yPosOffset = gY object.zPosOffset = gZ outputDebugString("attachElementToElement(createObject(" .. object.model .. ", " .. object.posX .. ", " .. object.posY .. ", " .. object.posZ .. ", " .. object.rotX .. ", " .. object.rotY .. ", " .. object.rotZ .. "), [element theParent], " .. object.xPosOffset .. ", " .. object.yPosOffset .. ", " .. object.zPosOffset .. ", " .. object.rotX .. ", " .. object.rotY .. ", " .. object.rotZ .. ")") end end
-
Here's a simplified function that calculates the offset values relative to posX, posY, posZ and outputs pseudo Lua script code. The object configuration file is read from objects.xml (create this file in the root of your game mode folder). You can build a ferry boat in the race map editor and copy the object elements to the objects.xml file. Example objects.xml "hull" posX="2150.595703" posY="-1724.988647" posZ="6.562508" rotX="0.0000" rotY="0.0000" rotZ="270.0000" model="10771" /> "ldeck" posX="2150.602051" posY="-1662.088379" posZ="5.380146" rotX="0.0000" rotY="0.0000" rotZ="270.0000" model="11145" /> "hangar" posX="2151.157227" posY="-1716.000000" posZ="13.407950" rotX="0.0000" rotY="0.0000" rotZ="269.9999" model="11146" /> "bits" posX="2143.061523" posY="-1728.324463" posZ="39.771801" rotX="0.0000" rotY="0.0000" rotZ="269.9999" model="11237" /> Don't forget to add this line to your meta.xml file: "objects.xml" type="server" /> local objects = {} function outputOffsetDebug(posX, posY, posZ) local rootNode = getResourceConfig(getThisResource(), "objects.xml") local nextSibling = 0 local node = false local gX, gY, gZ = 0, 0, 0 local oX, oY, oZ = 0, 0, 0 objects = {} if (rootNode) then node = xmlFindSubNode(rootNode, "object", nextSibling) while (node) do table.insert(objects, { ["name"] = xmlNodeGetAttribute(node, "name"), ["model"] = tonumber(xmlNodeGetAttribute(node, "model") or 0), ["posX"] = tonumber(xmlNodeGetAttribute(node, "posX") or 0), ["posY"] = tonumber(xmlNodeGetAttribute(node, "posY") or 0), ["posZ"] = tonumber(xmlNodeGetAttribute(node, "posZ") or 0), ["rotX"] = tonumber(xmlNodeGetAttribute(node, "rotX") or 0), ["rotY"] = tonumber(xmlNodeGetAttribute(node, "rotY") or 0), ["rotZ"] = tonumber(xmlNodeGetAttribute(node, "rotZ") or 0), ["xPosOffset"] = 0, ["yPosOffset"] = 0, ["zPosOffset"] = 0 } ) nextSibling = nextSibling + 1 node = xmlFindSubNode(rootNode, "object", nextSibling) end end oX, oY, oZ = objects[1].posX, objects[1].posY, objects[1].posZ for _, object in ipairs(objects) do gX = math.abs(posX - oX) gY = math.abs(posY - oY) if (object.posX > posX) then gX = object.posX - gX else gX = object.posX + gX end if (object.posY > posY) then gY = object.posY - gY else gY = object.posY + gY end object.posX = gX object.posY = gY end for _, object in ipairs(objects) do gX = math.abs(posX - object.posX) gY = math.abs(posY - object.posY) gZ = object.posZ if (object.posX < posX) then gX = -(gX) end if (object.posY < posY) then gY = -(gY) end object.xPosOffset = gX object.yPosOffset = gY object.zPosOffset = gZ outputDebugString("attachElementToElement(createObject(" .. object.model .. ", " .. object.posX .. ", " .. object.posY .. ", " .. object.posZ .. ", " .. object.rotX .. ", " .. object.rotY .. ", " .. object.rotZ .. "), [element theParent], " .. object.xPosOffset .. ", " .. object.yPosOffset .. ", " .. object.zPosOffset .. ", " .. object.rotX .. ", " .. object.rotY .. ", " .. object.rotZ .. ")") end end
-
You are attaching one element to the next. Instead you should try to glue all elements to one parent element, the hull for example. This makes it easier to calculate the required offset values. The offset values are relative to the element you are attaching to. Take a look at the carrier resource. There is a server side function that calculates the right offsets on the fly. Also: attacheElementToElement Should be: attachElementToElement
-
You are attaching one element to the next. Instead you should try to glue all elements to one parent element, the hull for example. This makes it easier to calculate the required offset values. The offset values are relative to the element you are attaching to. Take a look at the carrier resource. There is a server side function that calculates the right offsets on the fly. Also: attacheElementToElement Should be: attachElementToElement
-
Godfather Role-Play (Comes to MTA:DM) Tonight!
Ace_Gambit replied to Max3D's topic in General discussion
I have never played this game mode. But can you please post some screenshots because I don't want to register before I've seen the product . -
Godfather Role-Play (Comes to MTA:DM) Tonight!
Ace_Gambit replied to Max3D's topic in General discussion
I have never played this game mode. But can you please post some screenshots because I don't want to register before I've seen the product . -
Yes, it does.
-
Yes, it does.
-
Very basic example: spawnpoints = { {1, 1, 1}, {2, 2, 2}, {3, 3, 3} } spawnpoint = spawnpoints[math.random(1, #spawnpoints)] spawnPlayer(player, spawnpoint[1], spawnpoint[2], spawnpoint[3])
-
Very basic example: spawnpoints = { {1, 1, 1}, {2, 2, 2}, {3, 3, 3} } spawnpoint = spawnpoints[math.random(1, #spawnpoints)] spawnPlayer(player, spawnpoint[1], spawnpoint[2], spawnpoint[3])
-
pushed away when driving in teleport, pleas help
Ace_Gambit replied to XetaQuake's topic in Scripting
I've just tested this code (made some minor changes to yours) and it seems to work. server local targetX, targetY, targetZ = -1396.1995849609, 1093.6236572266, 1048.9255371094 local sourceX, sourceY, sourceZ = 1078.9619140625, 1602.2117919922, 12.546875 local ColHotringRaceEingang = createColSphere(sourceX, sourceY, sourceZ, 2) function HotringRaceMarkerEingang(name) if (name ~= getThisResource()) then return else createMarker(sourceX, sourceY, sourceZ, "cylinder", 4, 219, 155, 135, 100) end end function HotringRaceMarkerEingangBeamer(player) local vehicle = false if (getElementType(player) == "player") then vehicle = getPlayerOccupiedVehicle(player) if (vehicle) then setElementInterior(vehicle, 15, targetX, targetY, targetZ) setVehicleFrozen(vehicle, true) setElementInterior(player, 15, targetX, targetY, targetZ) triggerClientEvent(player, "onVehicleTeleport", player, targetX, targetY, targetZ) end end end function onVehicleTeleported() local vehicle = getPlayerOccupiedVehicle(source) if (vehicle) then setVehicleFrozen(vehicle, false) end end addEvent("onVehicleTeleported", true) addEventHandler("onVehicleTeleported", getRootElement(), onVehicleTeleported) addEventHandler("onColShapeHit", ColHotringRaceEingang, HotringRaceMarkerEingangBeamer) addEventHandler("onResourceStart", getRootElement(), HotringRaceMarkerEingang) client function onVehicleTeleport(targetX, targetY, targetZ) local vehicle = getPlayerOccupiedVehicle(getLocalPlayer()) local vX, vY, vZ = 0, 0, 0 local cX, cY, cZ = 0, 0, 0 if (vehicle) then vX, vY, vZ = getElementPosition(vehicle) cX, cY, cZ = getCameraPosition() if (getDistanceBetweenPoints3D(vX, vY, vZ, targetX, targetY, targetZ) < 5.0 and getDistanceBetweenPoints3D(cX, cY, cZ, targetX, targetY, targetZ) < 25.0) then triggerServerEvent("onVehicleTeleported", getLocalPlayer()) else setTimer(onVehicleTeleport, 50, 1, targetX, targetY, targetZ) end end end addEvent("onVehicleTeleport", true) addEventHandler("onVehicleTeleport", getRootElement(), onVehicleTeleport)