Jump to content

دوران حول البيد


Recommended Posts

يعني الكود يسير كذآ ؟

function SelectSkin () 
    setElementInterior ( getLocalPlayer(), 0, 0,0,0 ) 
    setCameraMatrix( 3878.8999023438,-1610.0999755859,17.1, 3878.9900488281,-1607.4000244141,16.5) 
    local ped = createPed ( StartSkin, 3878.9900488281,-1608.4000244141,16.3,180 ) 
    local speed = 5 -- زيد الرقم لتقليل سرعة الدوران 
    local r = 2 -- زيد الرقم لزيادة المسافة بين الكاميرا والبيد 
    function makeRotateCamera () 
    local x,y,z = getElementPosition(ped) 
    local g = getTickCount() / speed 
    local cx = math.cos(g) * r + x 
    local cy = math.sin(g) * r + y 
    local cz = z 
    setCameraMatrix ( cx, cy, cz, 3878.8999023438,-1610.0999755859,17.1 ) 
    end 
     addEventHandler ( "onClientRender", root, makeRotateCamera ) 
    setPedAnimation( ped, "DANCING", SkinAnims[math.random(1,4)]) 
    fadeCamera( true, 5) 
    setTime(0,0) 
    SkinSelectMusic = playSound(SkinMusic,true) 
    bindKey("arrow_r","down",NextSkin) 
    bindKey("arrow_l","down",LastSkin) 
    bindKey("lshift","down",SpawnPlayer) 
    addEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) 
    showCursor(true) 
end 
  
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), 
function() 
    SelectSkin() 
    FreezeBots() 
end) 
  

وبصراحه في اشياء ما فهمتها مثل

cx, cy, cz

واشكر بسول انه رد على الموضوع :) وساعدني

Link to comment

تفضل تراه مو كودي

  local angle = 0 
      
    function renderCameraRotation( target, targetX, targetY, targetZ, cameraHeight, radius, speed, roll, fov ) 
        local target = target or nil 
        local cameraHeight = cameraHeight or 5 
        local radius = radius or 20 
        local speed = speed or 0.2 
        local roll = roll or 0 
        local fov = fov or 70 
      
        if isElement( target ) then 
            targetX, targetY, targetZ = getElementPosition( target ) 
        end 
      
        local camX = targetX + radius * math.cos( math.rad( angle ) ) 
        local camY = targetY + radius * math.sin( math.rad( angle ) ) 
      
        if ( angle <= 360 ) then angle = angle + speed else angle = 0 end 
      
        setCameraMatrix( camX, camY, targetZ + cameraHeight, targetX, targetY, targetZ, roll, fov ) 
    end 

مثال

ملاحظة لازم مع الرندر

    function renderCameraTest() 
        renderCameraRotation( localPlayer ) 
    end 
    addEventHandler( "onClientRender", root, renderCameraTest ) 

+

اذ تبي تبدل

localPlayer = حط اسم الي تبي الكميرة تلف حوالة

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...