Jump to content

BORAT

Members
  • Posts

    1
  • Joined

  • Last visited

Details

  • Gang
    The dictator
  • Location
    argentina
  • Occupation
    vendedor
  • Interests
    lo que ellas prefieren

Recent Profile Visitors

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

BORAT's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. BORAT

    AttachEfect

    Hola lo que pasa es que estoy tratando de hacer un attachEfect a un jugador por medio de un comando y me salta este error al ejecutar el comando,(attempt to index local pov (a userdata value) n se por que pasa ya que tome el ejemplo de la misma wiki este es el codigo. local attachedEffects = {} -- Taken from https://wiki.multitheftauto.com/wiki/GetElementMatrix example function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end function attachEffect(effect, element, pos) attachedEffects[effect] = { effect = effect, element = element, pos = pos } addEventHandler("onClientElementDestroy", effect, function() attachedEffects[effect] = nil end) addEventHandler("onClientElementDestroy", element, function() attachedEffects[effect] = nil end) return true end addEventHandler("onClientPreRender", root, function() for fx, info in pairs(attachedEffects) do local x, y, z = getPositionFromElementOffset(info.element, info.pos.x, info.pos.y, info.pos.z) setElementPosition(fx, x, y, z) end end ) function locatePlayer() local pov = getPedOccupiedVehicle( localPlayer ) local fx = createEffect("fire", pov.position) attachEffect(fx, pov, Vector3(0, 0, 2)) end addCommandHandler ( "faier", locatePlayer )
×
×
  • Create New...