Jump to content

Swagy

Members
  • Posts

    88
  • Joined

  • Last visited

Posts posted by Swagy

  1. So basically, all I want to do is to Apply a vehicle mod to a certain vehicle.

    For example I use:

    local vehicle  = createVehicel(id, x,y,z)

    and then I want that vehicle mod to be replaced, but not all the vehicles with same Vehicle ID would be modded.

    I don't want to use shaders, because I'm willing to change the DFF file so.

    I don't really know how to express it xD but I hope you got what I meant

  2. Oh right thanks alot Zango,

    Is this what am I looking for tho ?

    function getMatrixLeft(m)
        return m[1][1], m[1][2], m[1][3]
    end
    function getMatrixForward(m)
        return m[2][1], m[2][2], m[2][3]
    end
    function getMatrixUp(m)
        return m[3][1], m[3][2], m[3][3]
    end
    function getMatrixPosition(m)
        return m[4][1], m[4][2], m[4][3]
    end
    
    local mat = getElementMatrix(element)  -- Get the matrix
    x,y,z = getMatrixLeft(mat)     -- Get the matrix left direction
    x,y,z = getMatrixForward(mat)  -- Get the matrix forward direction
    x,y,z = getMatrixUp(mat)       -- Get the matrix up direction

     

  3. You can make your own Friendlyfire code tho which is going to be client sided.

     

    function friendlyFire (attacker)
      if (isElement(source)) and (isElement(attacker)) and (getElementType(attacker) == "player") and (getElementType(source) == "player") then
      local aTeam = getPlayerTeam(attacker)
      local sTeam = getPlayerTeam(source)
      if (aTeam == sTeam) then
        cancelEvent()
       end
      end
    end
    addEventHandler("onClientPlayerDamage", root, friendlyFire)

     

     

  4. you can try to introduce tables, this way:

     

    for i=550,20000 do
    	removeWorldModel(i,10000,0,0,0)
    end
    setOcclusionsEnabled(false)
    setWaterLevel(-5000)     
    
    for k,objects in ipairs(garageObjects) do -- garageObjects table is already defined and with values
      	local loadedObjects = {}
    	local a,b,c,d,e,f,g,h,i = unpack(objects)
    	local object = createObject ( a,b,c,d,e,f,g )
        table.insert(loadedObjects, object)
    	setObjectScale(object,h or 1)
    	setElementDoubleSided(object, i or false )
    	setElementDimension(object,arenaCDimension)
    end
    if (#loadedObjects >= #garageObjects) then
    	fadeCamera(true)
      	loadedObjects = {}
     end

     

    In this case, fadeCamera will be executed only when all the objects were created.

     

    PS: setGarageOpen only opens the garage door.

  5. On 16/10/2018 at 10:06, Dzsozi (h03) said:

    Yes, I also believe that.

    Sorry, what do you mean by that? With the export functions you get the middle position of the defined vehicle's bed. So from that point on, you can adjust the position of the object by adding or extracting values to/from the position you got.

    Really appreciate your help, thanks.

     

    Keep up the good work mate, I loved this resource.

    • Thanks 1
×
×
  • Create New...