Santy. Posted January 5, 2013 Share Posted January 5, 2013 well im noob ( really noob in scripting ) please help me addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () speedmarker1 = createMarker(4773.90234375, -1728.6389160156, 7.0291533470154, "arrow", 9, 0, 255, 0, 255) end) function MarkerHit (element) if (element == getLocalPlayer()) then if (source == speedmarker1) then if (getElementType(element) == "player") then if (isPedInVehicle(element)) then local vehicle = getPedOccupiedVehicle(element) local velx, vely, velz = getElementVelocity(vehicle) local newx, newy, newz = velx*3.5, vely*3.5, velz*3.5 setElementVelocity(vehicle, newx, newy, newz) end end end end end addEventHandler("onClientMarkerHit", getRootElement(), MarkerHit) Sayme Error please, in game dont work... Link to comment
HunT Posted January 5, 2013 Share Posted January 5, 2013 local root = getRootElement() local this = getThisResource() local resourceRoot = getResourceRootElement(this) local localPlayer = getLocalPlayer() local Marker = {} addEventHandler("onClientResourceStart", resourceRoot, function() Marker[1] = createMarker(4773.90234375, -1728.6389160156, 7.0291533470154, "arrow", 9, 0, 255, 0, 255) end ) addEventHandler("onClientMarkerHit", root, function(player, matchingDimension) if not matchingDimension then return end if player == localPlayer and isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if source == Marker[1] then local velx, vely, velz = getElementVelocity(vehicle) local newx, newy, newz = velx*3.5, vely*3.5, velz*3.5 setElementVelocity(vehicle, newx, newy, newz) end end end ) Link to comment
Anderl Posted January 5, 2013 Share Posted January 5, 2013 local root = getRootElement() local this = getThisResource() local resourceRoot = getResourceRootElement(this) local localPlayer = getLocalPlayer() local Marker = {} addEventHandler("onClientResourceStart", resourceRoot, function() Marker[1] = createMarker(4773.90234375, -1728.6389160156, 7.0291533470154, "arrow", 9, 0, 255, 0, 255) end ) addEventHandler("onClientMarkerHit", root, function(player, matchingDimension) if not matchingDimension then return end if player == localPlayer and isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if source == Marker[1] then local x, y, z = getElementVelocity(vehicle) setElementVelocity(vehicle, x, y, z + 0.25) -- change the value if u need more jump end end end ) You don't need to declare any of these global variables, they're already pre-declared. Link to comment
HunT Posted January 5, 2013 Share Posted January 5, 2013 And you no need reply for nothing Link to comment
Anderl Posted January 5, 2013 Share Posted January 5, 2013 Well, if you don't like people to fix your mistakes, what can I do? I'll still correct them. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now