About Me

Gang

Location

Occupation

Interests

I've been working on a script that realistically manipulates the wheels. I've gotten to the point I can hide the original wheels, in hopes I can later attach a new set in the same place.
I'm aware I might have to use attachElements, and several other functions. For the moment, I'd like to attach a single wheel.
I've got this:
-- All GUI elements.
local vehicle = getPedOccupiedVehicle(localPlayer)
local x1, y1, z1 = getVehicleComponentPosition(vehicle, "wheel_lf_dummy")
local x2, y2, z2 = getVehicleComponentPosition(vehicle, "wheel_rf_dummy")
local x3, y3, z3 = getVehicleComponentPosition(vehicle, "wheel_lb_dummy")
local x4, y4, z4 = getVehicleComponentPosition(vehicle, "wheel_rb_dummy")
local function replace1 ()
attachElements (1097, vehicle, x1, y2, z1, 0, 0, 0)
end
addEventHandler ("onClientGUIClick", set1, replace1, false) -- Function runs when button called 'set1' is clicked.
-- Everything else.
Here's my thought process:
First, I get the player's vehicle. Then, I get the position of all four wheels in the player's vehicle, and represent them with x1, y1 and z1.
With all wheels hidden by another function, I then attach the wheel model in the same place as the front left wheel. At the moment, I'm only aiming at the position; I'll handle the rotation later.
DB 3 can't identify '1097', and thus asks for a valid element.
Am I on the right path?

this is my code:
function onQuit(thePlayer)
for i,v in pairs(getElementsByType("vehicle",resourceRoot)) do
if getElementData(v,"oveie") == getPlayerName(thePlayer) then
destroyElement(v)
end
end
end
addEventHandler ( "onPlayerQuit", root, onQuit )
but this does not working.. why? how to fix it?

Hey Guys,
For the last couple of hours I have been trying to get OnMarkerHit to trigger, I watched multiple youtube videos and tried using the search function here but none of them helped.
The script is a server sided script, This is the code I am using:
marker = createMarker(1514.5, -1678.2, 13, 'cylinder', 1.0, 19, 132, 38, 150)
function markerHit(hitElement)
setElementPosition(hitElement,0, 0, 0)
outputChatBox("Hitting marker")
end
addEventHandler("onMarkerHit", marker , markerHit)
But nothing happens, and I just don't know why. The object hitting the marker is a player.
Hope someone can help me out.
Greetings.
misterk99

function fvalt( prevSlot, newSlot )
if getElementData (target, "greenzone") then
setPedWeaponSlot(source,0)
end
end
addEventHandler ( "onClientPlayerWeaponSwitch", localPlayer, fvalt )
i added this to a greenzones script, but this doesn't working, why?