local marker2 = createMarker (1536.27,-1686.387,13.546,"cylinder", 2, 0, 255, 0, 255)
local blip2 = createBlip (1536.27, -1686.387, 13.546,5)
addEventHandler("onClientMarkerHit", marker2,
function (hit)
if (hit == localPlayer) then
if isElement (ped) then
destroyElement ( ped )
end
end
end
)
local marker33 = createMarker ( 1536.27,-1686.387+5,13.54,"cylinder", 2, 0, 255, 0, 255)
addEventHandler("onClientMarkerHit", marker33,
function (hit)
if (hit == localPlayer) then
if getPlayerTeam (localPlayer) and getTeamName (getPlayerTeam (localPlayer)) == "No Team" then
ped = createPed(0, getElementPosition(localPlayer))
end
end
end
)
addEventHandler("onClientRender", root,
function()
if getPlayerTeam (localPlayer) and getTeamName (getPlayerTeam (localPlayer)) == "No Team" then
local x, y, z = getElementPosition(localPlayer)
local tx, ty, tz = getElementPosition(ped)
local dis = getDistanceBetweenPoints2D(x, y, tx, ty)
if dis > 2 then
setPedControlState(ped, "forwards", true)
else
setPedControlState(ped, "forwards", false)
end
setPedRotation(ped, findRotation(tx, ty, x, y))
end
end
)
function findRotation(x1,y1,x2,y2)
local t = -math.deg(math.atan2(x2-x1,y2-y1))
if t < 0 then t = t + 360 end
return t
end
اناعندي ذا الكود بس اخش يرسبن بيد ويلحقني اسا انا ابيه بس اركب سيارة يركب معي وبس اخرج يخرج معي