Jump to content

مساعده او سمحتم


Recommended Posts

شباب ابي الفنكشات الي تخلي الكاميرا تتحرك لمكان وترجع لنفس المكان الي كانت فيه

وتستمر بي الحركة هاي اتمني تساعدوني وشكرا

https://wiki.multitheftauto.com/wiki/SmoothMoveCamera

طب الحين الكاميرا اتحركت لو ابيها ترجع للمكان الي تحركت منه ثم ترجع تاني للمكان الي اتحركت له وهيك

Link to comment
شباب ابي الفنكشات الي تخلي الكاميرا تتحرك لمكان وترجع لنفس المكان الي كانت فيه

وتستمر بي الحركة هاي اتمني تساعدوني وشكرا

https://wiki.multitheftauto.com/wiki/SmoothMoveCamera

طب الحين الكاميرا اتحركت لو ابيها ترجع للمكان الي تحركت منه ثم ترجع تاني للمكان الي اتحركت له وهيك

استخدمه مع التايمر

setTimer 
Link to comment

وتستمر بي الحركة هاي اتمني تساعدوني وشكرا

https://wiki.multitheftauto.com/wiki/SmoothMoveCamera

طب الحين الكاميرا اتحركت لو ابيها ترجع للمكان الي تحركت منه ثم ترجع تاني للمكان الي اتحركت له وهيك

استخدمه مع التايمر

setTimer 

طب اللحين سويت هاي الكود

  
 setTimer(function () 
smoothMoveCamera(2113.8352050781,1209.8538818359,60.945999145508,2114.2651367188,1208.9752197266,60.738212585449,2122.6770019531,1245.2310791016,56.893001556396,2121.8374023438,1245.7521972656,56.738994598389,1000) 
 end,50000,0) 
  

ووضعته بي هاي الكود فيث القيم مود وما اشتغل ليش

setTimer(function () 
removeEventHandler("onClientRender", root, dxDrawlogo); 
  
if isPedInVehicle(localPlayer) then destroyElement(getPedOccupiedVehicle(localPlayer)) end 
  
  
dx = true     
  
fadeCamera(true); 
  
 setTimer(function () 
smoothMoveCamera(2113.8352050781,1209.8538818359,60.945999145508,2114.2651367188,1208.9752197266,60.738212585449,2122.6770019531,1245.2310791016,56.893001556396,2121.8374023438,1245.7521972656,56.738994598389,1000) 
 end,50000,0) 
 sound = playSound ("ss.mp3",true) 
  
showChat(false) 
  
guiSetVisible(wnd,true) 
  
showCursor(true) 
  
guiSetInputEnabled(true) 
  
  
setElementDimension(localPlayer,0) 
  
setElementData(localPlayer,"new",false) 
  
outputChatBox("#0069c7 ## #ff0000 GameMode By #0069c7[#ff0000MR~#0069c7Mos.[T].aّّّfA~#ff0000] #0069c7##",255,0,0,true) 
  
  
end,10000,1) 

Link to comment

^

حط هذا الكود من فوق بملف الكلينت

local sm = {} 
sm.moov = 0 
sm.object1,sm.object2 = nil,nil 
  
local function removeCamHandler() 
    if(sm.moov == 1)then 
        sm.moov = 0 
    end 
end 
  
local function camRender() 
    if (sm.moov == 1) then 
        local x1,y1,z1 = getElementPosition(sm.object1) 
        local x2,y2,z2 = getElementPosition(sm.object2) 
        setCameraMatrix(x1,y1,z1,x2,y2,z2) 
    end 
end 
addEventHandler("onClientPreRender",root,camRender) 
  
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time) 
    if(sm.moov == 1)then return false end 
    sm.object1 = createObject(1337,x1,y1,z1) 
    sm.object2 = createObject(1337,x1t,y1t,z1t) 
    setElementAlpha(sm.object1,0) 
    setElementAlpha(sm.object2,0) 
    setObjectScale(sm.object1,0.01) 
    setObjectScale(sm.object2,0.01) 
    moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad") 
    moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad") 
    sm.moov = 1 
    setTimer(removeCamHandler,time,1) 
    setTimer(destroyElement,time,1,sm.object1) 
    setTimer(destroyElement,time,1,sm.object2) 
    return true 
end 

سوي ريستارت للسكربت حقك

وجرب ’ لو ماشتغل افتح الديبوق

واطرح لنا المشاكل

Link to comment
^

حط هذا الكود من فوق بملف الكلينت

local sm = {} 
sm.moov = 0 
sm.object1,sm.object2 = nil,nil 
  
local function removeCamHandler() 
    if(sm.moov == 1)then 
        sm.moov = 0 
    end 
end 
  
local function camRender() 
    if (sm.moov == 1) then 
        local x1,y1,z1 = getElementPosition(sm.object1) 
        local x2,y2,z2 = getElementPosition(sm.object2) 
        setCameraMatrix(x1,y1,z1,x2,y2,z2) 
    end 
end 
addEventHandler("onClientPreRender",root,camRender) 
  
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time) 
    if(sm.moov == 1)then return false end 
    sm.object1 = createObject(1337,x1,y1,z1) 
    sm.object2 = createObject(1337,x1t,y1t,z1t) 
    setElementAlpha(sm.object1,0) 
    setElementAlpha(sm.object2,0) 
    setObjectScale(sm.object1,0.01) 
    setObjectScale(sm.object2,0.01) 
    moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad") 
    moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad") 
    sm.moov = 1 
    setTimer(removeCamHandler,time,1) 
    setTimer(destroyElement,time,1,sm.object1) 
    setTimer(destroyElement,time,1,sm.object2) 
    return true 
end 

سوي ريستارت للسكربت حقك

وجرب ’ لو ماشتغل افتح الديبوق

واطرح لنا المشاكل

ما اشتغل صار يجبلي الكاميرا خلف اللاعب

اكواد الكلينت كلها

  
             
            function centerWindow(center_window)
                local screenW,screenH=guiGetScreenSize()
                local windowW,windowH=guiGetSize(center_window,false)
                local x,y = (screenW-windowW)/2,(screenH-windowH)/2
                guiSetPosition(center_window,x,y,false)
            end    
             
local sm = {}
sm.moov = 0
sm.object1,sm.object2 = nil,nil
 
local function removeCamHandler()
    if(sm.moov == 1)then
        sm.moov = 0
    end
end
 
local function camRender()
    if (sm.moov == 1) then
        local x1,y1,z1 = getElementPosition(sm.object1)
        local x2,y2,z2 = getElementPosition(sm.object2)
        setCameraMatrix(x1,y1,z1,x2,y2,z2)
    end
end
addEventHandler("onClientPreRender",root,camRender)
 
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)
    if(sm.moov == 1)then return false end
    sm.object1 = createObject(1337,x1,y1,z1)
    sm.object2 = createObject(1337,x1t,y1t,z1t)
    setElementAlpha(sm.object1,0)
    setElementAlpha(sm.object2,0)
    setObjectScale(sm.object1,0.01)
    setObjectScale(sm.object2,0.01)
    moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad")
    moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad")
    sm.moov = 1
    setTimer(removeCamHandler,time,1)
    setTimer(destroyElement,time,1,sm.object1)
    setTimer(destroyElement,time,1,sm.object2)
    return true
end
             wnd = guiCreateStaticImage(45, 8, 718, 544, "abed.png",false)
             guiSetVisible(wnd,false)
            user_2 = guiCreateLabel(463, 310, 177, 29, "Username", false, wnd)
            function Color ( )
            guiLabelSetColor (user_2, math.random(0, 255), math.random(0, 255), math.random(0, 255) )
            end
            setTimer ( Color, 1000, 0 )
            guiLabelSetHorizontalAlign(user_2,"center",false)
            guiSetFont(user_2,"default-bold-small")
            user_l = guiCreateLabel(115, 310, 177, 29, "Username",false,wnd)
            function Color ( )
            guiLabelSetColor (user_l, math.random(0, 255), math.random(0, 255), math.random(0, 255) )
            end
            setTimer ( Color, 1000, 0 )
            guiLabelSetHorizontalAlign(user_l,"center",false)
            guiSetFont(user_l,"default-bold-small")
            user1 = guiCreateEdit(476, 345, 159, 28, "", false, wnd)
            setTimer(function()
            guiSetProperty(user1, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
                end, 1000, 0)
            user = guiCreateEdit(126, 343, 159, 28, "",false,wnd)
            setTimer(function()
            guiSetProperty(user, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
                end, 1000, 0)
            pass_2 = guiCreateLabel(462, 379, 177, 29, "Password", false,wnd)
            function Color ( )
            guiLabelSetColor (pass_2, math.random(0, 255), math.random(0, 255), math.random(0, 255) )
            end
            setTimer ( Color, 1000, 0 )
            guiLabelSetHorizontalAlign(pass_2,"center",false)
            guiSetFont(pass_2,"default-bold-small")
            pass_l = guiCreateLabel(115, 378, 177, 29, "Password",false,wnd)
            function Color ( )
            guiLabelSetColor (pass_l, math.random(0, 255), math.random(0, 255), math.random(0, 255) )
            end
            setTimer ( Color, 1000, 0 )
            guiLabelSetHorizontalAlign(pass_l,"center",false)
            guiSetFont(pass_l,"default-bold-small")
            pass1 = guiCreateEdit(475, 413, 159, 28, "", false,wnd)
            setTimer(function()
            guiSetProperty(pass1, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
                end, 100, 0)
            guiEditSetMasked(pass1,true)
            pass = guiCreateEdit(127, 414, 159, 28, "",false,wnd)
            setTimer(function()
            guiSetProperty(pass, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
                end, 100, 0)
            guiEditSetMasked(pass,true)
            remember = guiCreateCheckBox(0.0231,0.6642,0.3728,0.0746,"Remember Me !!",false,true,wnd)
            guiSetFont(remember,"default-bold-small")
            setTimer(function()
            guiSetProperty(remember, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
                end, 1000, 0)
            reg = guiCreateButton(470, 461, 175, 40, "Register",false,wnd)
            guiSetFont(reg,"default-bold-small")
            setTimer(function()
            guiSetProperty(reg, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
                end, 1000, 0)
            login = guiCreateButton(118, 466, 175, 40, "Login",false,wnd)
            guiSetFont(login,"default-bold-small")
            setTimer(function()
            guiSetProperty(login, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255)))
                end, 1000, 0)  
    addEventHandler("onClientResourceStart", resourceRoot,
        function()
     
        showChat(false)
        fadeCamera(false);
    end)
function dxDrawlogo()
 
dxDrawImage(  55, 42, 1167, 645, "logo.png", 0,0,0)
dxDrawText("welcome to server mo7trefen 6arh", 177, 697, 1186, 826, tocolor(255, 255, 255, 255), 5.00, "default-bold", "center", "top", false, false, false, false, false)
 
end
        local rot = 9
        function dxDrawLoading()
 
 
        rot = rot + 2
        if rot > 360 then rot = 0 end
 
        dxDrawText("Welcome To Server mo7trefen 6arh", 367, 262, 994, 361, tocolor(255, 255, 255, 255), 3.00, "default-bold", "center", "top", false, false, false, false, false)
 
        dxDrawImage( 536, 428, 175, 178, "load.png", rot)
 
        dxDrawText("loadiing to server", 581, 402, 672, 418, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "top", false, false, false, false, false)
        end
        addEventHandler("onClientRender", root, dxDrawLoading);
        removeEventHandler("onClientRender", root, dxDrawLoading);
 
 
 
addEventHandler("onClientRender", root, dxDrawLoading);
 
setTimer(
 
function ()
addEventHandler("onClientRender", root, dxDrawlogo);
 
 
removeEventHandler("onClientRender", root, dxDrawLoading);
end,6000,1)
setTimer(function ()
removeEventHandler("onClientRender", root, dxDrawlogo);
 
if isPedInVehicle(localPlayer) then destroyElement(getPedOccupiedVehicle(localPlayer)) end
 
 
dx = true    
 
fadeCamera(true);
 
 setTimer(function ()
smoothMoveCamera(2113.8352050781,1209.8538818359,60.945999145508,2114.2651367188,1208.9752197266,60.738212585449,2122.6770019531,1245.2310791016,56.893001556396,2121.8374023438,1245.7521972656,56.738994598389,5000)
 end,0,0)
 sound = playSound ("ss.mp3",true)
 
showChat(false)
 
guiSetVisible(wnd,true)
 
showCursor(true)
 
guiSetInputEnabled(true)
 
 
setElementDimension(localPlayer,0)
 
setElementData(localPlayer,"new",false)
 
outputChatBox("#0069c7 ## #ff0000 GameMode By #0069c7[#ff0000MR~#0069c7Mos.[T].aّّّfA~#ff0000] #0069c7##",255,0,0,true)
 
 
end,10000,1)
 
 
            centerWindow(wnd)
            triggerServerEvent("onGetSave",localPlayer)
     
            addEvent("onPutSave",true)
            addEventHandler("onPutSave",root,
                function (puser,ppass)
                    guiSetText(user,puser)
                    guiSetText(pass,ppass)
                end
            )
             
             
            addEventHandler("onClientGUIClick",root,
                function ()
                    local user = guiGetText(user)
                    local pass = guiGetText(pass)
                    local user1 = guiGetText(user1)
                    local pass1 = guiGetText(pass1)
                    if ( source == login ) then
                        if user ~= "" and pass ~= "" then
                            if guiCheckBoxGetSelected(remember) then
                                triggerServerEvent("onLoginWith",localPlayer,user,pass)
                            else
                                triggerServerEvent("onLogin",localPlayer,user,pass)
                            end
                        else
                            outputChatBox("* You Must Write Username Or Password",255,0,0)
                        end
                    elseif ( source == reg ) then
                        if user1 ~= "" and pass1 ~= "" then
                            triggerServerEvent("onReg",localPlayer,user1,pass1)
                        else
                            outputChatBox("* You Must Write Username Or Password",255,0,0)
                        end
                    end
                end
            )
             
            addEvent("onCl",true)
            addEventHandler("onCl",root,
                function ()
                    guiSetVisible(wnd,false)
                    showCursor(false)
                    showChat(false)
    fadeCamera(true);
                    guiSetInputEnabled(false)
                    Show()
                end
            )
             
            function setPlayerXYZ(x,y,z)
                local player = getLocalPlayer()
                setElementData(player,"x",x)
                setElementData(player,"y",y)
                setElementData(player,"z",z)
            end
             
           
            dx = false
            skin = {{46,"ثوب سعودي ابيض"},{0,"cj"},{124,"ثوب سعودي اسود"}}
            num = 1
place = {
    {"النخيل",2021.6854248047,1441.3870849609,40.58459854126,2022.5858154297,1441.0551757813,40.303291320801,2119.56250,1396.94238,10.81252},
    {"الدائري",1869.2296142578,1426.2882080078,74.245399475098,1868.2775878906,1426.3618164063,73.948387145996,1686.27844,1400.07080,10.74839},
    {"ساحة القتال",414.17388916016,2046.4881591797,61.682598114014,413.30380249023,2046.0771484375,61.410533905029,277.93359,1988.82581,17.64063},
    {"البداية",-4403.8959960938,-2989.5773925781,85.724098205566,-4404.7690429688,-2989.6337890625,85.240089416504,-4502.21875,-2984.65259,39.20000},
    {"الطعس",-2750.5700683594,-2616.154296875,26.364200592041,-2750.1618652344,-2615.2575683594,26.193408966064,-2682.37036,-2549.38403,3.23208},
}
         
            function Show()
                smoothMoveCamera
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...