Hassan Posted July 1, 2017 Share Posted July 1, 2017 (edited) لو سمحتو معايا جيم مود هجولة بيشتغل فيه اغنيه بس لما الاعب يجي يسجل وينزل في المكان الي اختاره مثل البدايه الدايري/ساحة القتال الخ ............... المشكله :::: بتفضل الاغنيه شغاله حتا لو الاعب نزل في المكان الي اختاره الطلب::::: ابي الفنكشن الي يخلي الاغنيه تقف لما الاعب ينزل بس ابي الفنكشن كامل ارجوكم يا شباب !!!!!!!!! ارجو الرد في اسرع وقت لغاية الاهميه وشكراا Edited July 1, 2017 by Hassan Link to comment
Doffy Posted July 1, 2017 Share Posted July 1, 2017 9 hours ago, Hassan said: لو سمحتو معايا جيم مود هجولة بيشتغل فيه اغنيه بس لما الاعب يجي يسجل وينزل في المكان الي اختاره مثل البدايه الدايري/ساحة القتال الخ ............... المشكله :::: بتفضل الاغنيه شغاله حتا لو الاعب نزل في المكان الي اختاره الطلب::::: ابي الفنكشن الي يخلي الاغنيه تقف لما الاعب ينزل بس ابي الفنكشن كامل ارجوكم يا شباب !!!!!!!!! ارجو الرد في اسرع وقت لغاية الاهميه وشكراا 'onPlayerLogin' stopSound 1 Link to comment
#LorD-.? Posted July 1, 2017 Share Posted July 1, 2017 ضيف في فنكشن اختيار مكان السباون stopSound(soundname) Link to comment
Hassan Posted July 2, 2017 Author Share Posted July 2, 2017 يشبااب انا عايز الفنكشن كامل حد يكتبوو كامل عشان اخدو كوبي وبست ارجو الرد في اسرع وقت وشكرا✋ Link to comment
A7M8D Posted July 2, 2017 Share Posted July 2, 2017 stopSound(اسم الصوت) guiSetVisible 1 Link to comment
Hassan Posted July 2, 2017 Author Share Posted July 2, 2017 16 minutes ago, #MR.NaiF said: stopSound(اسم الصوت) guiSetVisible تسلم حب? Link to comment
Hassan Posted July 2, 2017 Author Share Posted July 2, 2017 font = guiCreateFont("Font.ttf", 10) local sm = {} sm.moov = 0 sm.object1, sm.object2 = nil, nil local function removeCamHandler () if(sm.moov == 1) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end function camRender () if sm.object1 and isElement(sm.object1) then local x1, y1, z1 = getElementPosition ( sm.object1 ) local x2, y2, z2 = getElementPosition ( sm.object2 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end end 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" ) addEventHandler ( "onClientPreRender", getRootElement(), camRender ) 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 function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "img.png", relative2 ) mainBackgroundLabel = guiCreateLabel ( 55, 0, 450, 100, titleBarText2, false, mainBackground ) guiSetFont ( mainBackgroundLabel, Font ) font = guiCreateFont("Font.ttf", 10) guiLabelSetColor(mainBackgroundLabel, 0, 233, 255) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end addEventHandler("onClientResourceStart",resourceRoot, function () setTimer(function () if isPedInVehicle(localPlayer) then destroyElement(getPedOccupiedVehicle(localPlayer)) end dx = true setCameraMatrix(2070.6166992188 ,1007.6680908203 ,60.8203125 ,2060.6166992188 ,1007.6680908203 ,60.8203125) showCursor(true) guiSetInputEnabled(true) showChat(false) setElementDimension(localPlayer,0) setElementData(localPlayer,"new",false) end,500,1) end ) guiSetFont(mainBackgroundLabel, font) wnd = guiCreateWindow(247, 138, 789, 522, "",false,wnd) guiSetFont(wnd, font) guiCreateWindow(wnd, 66, 240, 12) guiSetProperty(wnd,"CaptionColour","ff0069c7") logownd = guiCreateStaticImage(20, 25, 759, 291, "logo.png", false, wnd) user_l = guiCreateLabel(336, 358, 91, 15, "♥ User Name ♥", false, wnd) guiSetFont(user_l, font) guiLabelSetColor(user_l, 147, 229, 51) user = guiCreateEdit(290, 379, 184, 27, "", false, wnd) pass_l = guiCreateLabel(336, 413, 91, 15, "♥ PassWord ♥", false, wnd) guiSetFont(pass_l, font) guiLabelSetColor(pass_l, 241, 71, 207) pass = guiCreateEdit(289, 431, 184, 27, "", false, wnd) guiEditSetMasked(pass,true) reg = guiCreateButton(270, 465, 87, 23, "♥ Register ♥", false, wnd) guiSetFont(reg, font) guiSetProperty(reg, "NormalTextColour", "FF26D5CB") --------------------------------------------------------------------------------- login = guiCreateButton(399, 465, 87, 23, "♥ Login ♥", false, wnd) guiSetFont(login, font) guiSetProperty(login, "NormalTextColour", "FF26D5CB") centerWindow(wnd) triggerServerEvent("onGetSave",localPlayer) addEventHandler("onClientMouseEnter",guiRoot,function() if ( source == login ) then guiSetText(login,"♥ Login ♥") elseif ( source == reg ) then guiSetText(reg,"♥ Register ♥") elseif ( source == ex ) then guiSetText(ex,"") end end) showPlayerHudComponent('radar',false) addEventHandler("onClientMouseLeave",guiRoot,function() if ( source == login ) then guiSetText(login,"♥ Login ♥") elseif ( source == reg ) then guiSetText(reg,"♥ Register ♥") elseif ( source == ex ) then guiSetText(ex,"") end end) showPlayerHudComponent('radar',false) 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) if ( source == login ) then if user ~= "" and pass ~= "" then if guiCheckBoxGetSelected(remember) then triggerServerEvent("remember",localPlayer,user,pass) else triggerServerEvent("login",localPlayer,user,pass) end else outputChatBox("* You Must Write Username Or Password",255,0,0) end elseif ( source == reg ) then if user ~= "" and pass ~= "" then triggerServerEvent("reg",localPlayer,user,pass) else triggerEvent("addNotification", getLocalPlayer()," الرجاء التأكد من كلمة المرور او اسم المستخدم",2) end end end ) addEvent("onCl",true) addEventHandler("onCl",root, function () guiSetVisible(wnd,false) showCursor(false) guiSetInputEnabled(false) triggerEvent("addNotification", getLocalPlayer(),"",1) triggerEvent("addNotification", getLocalPlayer(),"",1) Show() end ) function setPlayerXYZ(x,y,z) local player = getLocalPlayer() setElementData(player,"x",x) setElementData(player,"y",y) setElementData(player,"z",z) end text = "" dx = false skin = {{46,""},{104,""},{124,""}} num = 1 place = { {"البداية الرئيسية",-4496.9311523438,-2629.4548339844,46.657073974609,-6038.07178, -1211.89038, 4.27837, -4761.966796875, -2609.5629882813, 5.5015625953674}, {"الدايري",1873.07971, 825.39416, 29.59185,1797.5855712891,830.97955322266,10.664346694946,1848.1938476563,807.23809814453,10.6810131073}, {"الطعس",-2541.21655, -2897.66601, 18.39924,-2479.4760742188,-2830.7487792969,3,-2479.4760742188,-2830.7487792969,3}, {"الشارع الطويل",-3070.94921, -3083.84301, 45.22809,-3072.5554199219,-3000.345703125,5,-3072.5554199219,-3000.345703125,5}, } function Show() smoothMoveCamera(2070.6166992188 ,1007.6680908203 ,60.8203125 ,2060.6166992188 ,1007.6680908203 ,60.8203125 ,2025.6166992188 ,1007.6680908203 ,10.8203125,2021.6166992188 ,1007.6680908203 ,10.8203125,6000) ped = createPed(skin[1][1],2021.6166992188 ,1007.6680908203 ,10.1 ,370) bindKey("arrow_l","down",left) bindKey("arrow_r","down",right) bindKey("enter","down",enter) text = skin[1][2] end function left() if num == 1 then num = #skin else num = num - 1 end setElementModel(ped,skin[num][1]) text = skin[num][2] playSoundFrontEnd(32) end function right() if num == #skin then num = 1 else num = num + 1 end setElementModel(ped,skin[num][1]) text = skin[num][2] playSoundFrontEnd(32) end addEventHandler('onClientRender',root,re) function r_s() if ( getElementModel(ped) == 1 ) then setElementModel(ped,2) model = 2 else model = getElementModel(ped) + 1 setElementModel(ped,model) end end function l_s() if ( getElementModel(ped) == 2 ) then setElementModel(ped,1) model = 1 else model = getElementModel(ped) - 1 setElementModel(ped,model) end end function enter() triggerEvent("addNotification", getLocalPlayer(),"",1) playSoundFrontEnd(33) destroyElement(ped) unbindKey("arrow_l") unbindKey("arrow_r") unbindKey("enter") setTimer(fadeCamera, 1000, 1, true) setElementData(localPlayer,"skin",skin[num][1]) num = 1 text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) dx = true bindKey("arrow_l","down",Pleft) bindKey("arrow_r","down",Pright) bindKey("enter","down",Penter) end addEventHandler("onClientRender",root, function () local size = {guiGetScreenSize()} if dx == true then dxDrawText("\n( " .. text .. " )",1,0,size[1] + 1,size[2],tocolor(0,0,0,255),3,"default-bold","center","top",false,false,false,true) dxDrawText("\n( " .. text .. " )",0,0,size[1],size[2],tocolor(255,166,0,255),3,"default-bold","center","top",false,false,false,true) end end ) function Pleft() if num == 1 then num = #place else num = num - 1 end text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) playSoundFrontEnd(32) end function Pright() if num == #place then num = 1 else num = num + 1 end text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) playSoundFrontEnd(32) end function Penter() playSoundFrontEnd(33) unbindKey("arrow_l") unbindKey("arrow_r") unbindKey("enter") triggerEvent("addNotification", getLocalPlayer(),"",1) triggerEvent("addNotification", getLocalPlayer(),"",3) showPlayerHudComponent('radar',true) showChat(true) dx = false text = "" setPlayerXYZ(place[num][8],place[num][9],place[num][10]) triggerServerEvent("SpawnPlayer",localPlayer) end fileDelete("Client.lua") شباب هاد الكلنت قبل كتاب فنكشن التشغيل انا اعرف كيف اضيف فنكشن التشغيل بس انا ابي فنكشن الوقوف عند نزول اللاعب ارجو الرد? Link to comment
A7M8D Posted July 2, 2017 Share Posted July 2, 2017 (edited) فين كود تشغيل الصوت ؟ ___________________________________ ارجو منك قبل المشاركة في القسم مراجعة هذا الموضوع للاخ نصور Edited July 2, 2017 by #MR.NaiF Link to comment
Hassan Posted July 2, 2017 Author Share Posted July 2, 2017 font = guiCreateFont("Font.ttf", 10) local sm = {} sm.moov = 0 sm.object1, sm.object2 = nil, nil local function removeCamHandler () if(sm.moov == 1) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end function camRender () if sm.object1 and isElement(sm.object1) then local x1, y1, z1 = getElementPosition ( sm.object1 ) local x2, y2, z2 = getElementPosition ( sm.object2 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end end 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" ) addEventHandler ( "onClientPreRender", getRootElement(), camRender ) 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 function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "img.png", relative2 ) mainBackgroundLabel = guiCreateLabel ( 55, 0, 450, 100, titleBarText2, false, mainBackground ) guiSetFont ( mainBackgroundLabel, Font ) font = guiCreateFont("Font.ttf", 10) guiLabelSetColor(mainBackgroundLabel, 0, 233, 255) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end addEventHandler("onClientResourceStart",resourceRoot, function () setTimer(function () if isPedInVehicle(localPlayer) then destroyElement(getPedOccupiedVehicle(localPlayer)) end dx = true setCameraMatrix(2070.6166992188 ,1007.6680908203 ,60.8203125 ,2060.6166992188 ,1007.6680908203 ,60.8203125) showCursor(true) guiSetInputEnabled(true) showChat(false) setElementDimension(localPlayer,0) setElementData(localPlayer,"new",false) end,500,1) end ) guiSetFont(mainBackgroundLabel, font) wnd = guiCreateWindow(247, 138, 789, 522, "",false,wnd) guiSetFont(wnd, font) guiCreateWindow(wnd, 66, 240, 12) guiSetProperty(wnd,"CaptionColour","ff0069c7") logownd = guiCreateStaticImage(20, 25, 759, 291, "logo.png", false, wnd) user_l = guiCreateLabel(336, 358, 91, 15, "♥ User Name ♥", false, wnd) guiSetFont(user_l, font) guiLabelSetColor(user_l, 147, 229, 51) user = guiCreateEdit(290, 379, 184, 27, "", false, wnd) pass_l = guiCreateLabel(336, 413, 91, 15, "♥ PassWord ♥", false, wnd) guiSetFont(pass_l, font) guiLabelSetColor(pass_l, 241, 71, 207) pass = guiCreateEdit(289, 431, 184, 27, "", false, wnd) guiEditSetMasked(pass,true) reg = guiCreateButton(270, 465, 87, 23, "♥ Register ♥", false, wnd) guiSetFont(reg, font) guiSetProperty(reg, "NormalTextColour", "FF26D5CB") --------------------------------------------------------------------------------- login = guiCreateButton(399, 465, 87, 23, "♥ Login ♥", false, wnd) guiSetFont(login, font) guiSetProperty(login, "NormalTextColour", "FF26D5CB") centerWindow(wnd) triggerServerEvent("onGetSave",localPlayer) addEventHandler("onClientMouseEnter",guiRoot,function() if ( source == login ) then guiSetText(login,"♥ Login ♥") elseif ( source == reg ) then guiSetText(reg,"♥ Register ♥") elseif ( source == ex ) then guiSetText(ex,"") end end) showPlayerHudComponent('radar',false) addEventHandler("onClientMouseLeave",guiRoot,function() if ( source == login ) then guiSetText(login,"♥ Login ♥") elseif ( source == reg ) then guiSetText(reg,"♥ Register ♥") elseif ( source == ex ) then guiSetText(ex,"") end end) showPlayerHudComponent('radar',false) 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) if ( source == login ) then if user ~= "" and pass ~= "" then if guiCheckBoxGetSelected(remember) then triggerServerEvent("remember",localPlayer,user,pass) else triggerServerEvent("login",localPlayer,user,pass) end else outputChatBox("* You Must Write Username Or Password",255,0,0) end elseif ( source == reg ) then if user ~= "" and pass ~= "" then triggerServerEvent("reg",localPlayer,user,pass) else triggerEvent("addNotification", getLocalPlayer()," الرجاء التأكد من كلمة المرور او اسم المستخدم",2) end end end ) addEvent("onCl",true) addEventHandler("onCl",root, function () guiSetVisible(wnd,false) showCursor(false) guiSetInputEnabled(false) triggerEvent("addNotification", getLocalPlayer(),"",1) triggerEvent("addNotification", getLocalPlayer(),"",1) Show() end ) function setPlayerXYZ(x,y,z) local player = getLocalPlayer() setElementData(player,"x",x) setElementData(player,"y",y) setElementData(player,"z",z) end text = "" dx = false skin = {{46,""},{104,""},{124,""}} num = 1 place = { {"البداية الرئيسية",-4496.9311523438,-2629.4548339844,46.657073974609,-6038.07178, -1211.89038, 4.27837, -4761.966796875, -2609.5629882813, 5.5015625953674}, {"الدايري",1873.07971, 825.39416, 29.59185,1797.5855712891,830.97955322266,10.664346694946,1848.1938476563,807.23809814453,10.6810131073}, {"الطعس",-2541.21655, -2897.66601, 18.39924,-2479.4760742188,-2830.7487792969,3,-2479.4760742188,-2830.7487792969,3}, {"الشارع الطويل",-3070.94921, -3083.84301, 45.22809,-3072.5554199219,-3000.345703125,5,-3072.5554199219,-3000.345703125,5}, } function Show() smoothMoveCamera(2070.6166992188 ,1007.6680908203 ,60.8203125 ,2060.6166992188 ,1007.6680908203 ,60.8203125 ,2025.6166992188 ,1007.6680908203 ,10.8203125,2021.6166992188 ,1007.6680908203 ,10.8203125,6000) ped = createPed(skin[1][1],2021.6166992188 ,1007.6680908203 ,10.1 ,370) bindKey("arrow_l","down",left) bindKey("arrow_r","down",right) bindKey("enter","down",enter) text = skin[1][2] end function left() if num == 1 then num = #skin else num = num - 1 end setElementModel(ped,skin[num][1]) text = skin[num][2] playSoundFrontEnd(32) end function right() if num == #skin then num = 1 else num = num + 1 end setElementModel(ped,skin[num][1]) text = skin[num][2] playSoundFrontEnd(32) end addEventHandler('onClientRender',root,re) function r_s() if ( getElementModel(ped) == 1 ) then setElementModel(ped,2) model = 2 else model = getElementModel(ped) + 1 setElementModel(ped,model) end end function l_s() if ( getElementModel(ped) == 2 ) then setElementModel(ped,1) model = 1 else model = getElementModel(ped) - 1 setElementModel(ped,model) end end function enter() triggerEvent("addNotification", getLocalPlayer(),"",1) playSoundFrontEnd(33) destroyElement(ped) unbindKey("arrow_l") unbindKey("arrow_r") unbindKey("enter") setTimer(fadeCamera, 1000, 1, true) setElementData(localPlayer,"skin",skin[num][1]) num = 1 text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) dx = true bindKey("arrow_l","down",Pleft) bindKey("arrow_r","down",Pright) bindKey("enter","down",Penter) end addEventHandler("onClientRender",root, function () local size = {guiGetScreenSize()} if dx == true then dxDrawText("\n( " .. text .. " )",1,0,size[1] + 1,size[2],tocolor(0,0,0,255),3,"default-bold","center","top",false,false,false,true) dxDrawText("\n( " .. text .. " )",0,0,size[1],size[2],tocolor(255,166,0,255),3,"default-bold","center","top",false,false,false,true) end end ) function Pleft() if num == 1 then num = #place else num = num - 1 end text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) playSoundFrontEnd(32) end function Pright() if num == #place then num = 1 else num = num + 1 end text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) playSoundFrontEnd(32) end function Penter() playSoundFrontEnd(33) unbindKey("arrow_l") unbindKey("arrow_r") unbindKey("enter") triggerEvent("addNotification", getLocalPlayer(),"",1) triggerEvent("addNotification", getLocalPlayer(),"",3) showPlayerHudComponent('radar',true) showChat(true) dx = false text = "" setPlayerXYZ(place[num][8],place[num][9],place[num][10]) triggerServerEvent("SpawnPlayer",localPlayer) end fileDelete("Client.lua") sound = playSound ( "muse/noovl.mp3" ) ده الكلينت بفنكشن تشغيل الصوت ارجوو الرد بفنكشن الوقوووووف??? Link to comment
#BrosS Posted July 2, 2017 Share Posted July 2, 2017 حط لما بحدث . فنكشن نزول اللاعب if isElement(sound) then destroyElement(sound) end Link to comment
Hassan Posted July 2, 2017 Author Share Posted July 2, 2017 18 minutes ago, #BrosS said: حط لما بحدث . فنكشن نزول اللاعب if isElement(sound) then destroyElement(sound) end مش فاهم وضح!!! يعني هو ده الفنكشن بتاع الوقوف؟؟؟ Link to comment
#BrosS Posted July 2, 2017 Share Posted July 2, 2017 Just now, Hassan said: مش فاهم وضح!!! يعني هو ده الفنكشن بتاع الوقوف؟؟؟ لا الجلوس اقولك ضيفه بكود لما ينزل او يرسبن Link to comment
A7M8D Posted July 2, 2017 Share Posted July 2, 2017 (edited) الرجاء منك قبل المشاركة في القسم و وضع اكواد مراجعة هذا الموضوع للاخ نصور اما بالنسبة لايقاف الصوت stopSound(اسم الصوت الي عايز توقفه) Edited July 2, 2017 by #MR.NaiF Link to comment
Hassan Posted July 2, 2017 Author Share Posted July 2, 2017 5 hours ago, #MR.NaiF said: الرجاء منك قبل المشاركة في القسم و وضع اكواد مراجعة هذا الموضوع للاخ نصور اما بالنسبة لايقاف الصوت stopSound(اسم الصوت الي عايز توقفه) يا اخ نايف اكتب هاد الفنكشن في الكلنت واكتب اسم الاغنيه وكده هتثف لما ينزل الاعب؟؟؟ Link to comment
1337.Ibrahim Posted July 2, 2017 Share Posted July 2, 2017 function startMySound() sound = playSound( "sound.mp3", true ) end addEventHandler( "onPlayerJoin", resourceRoot, startMySound ) function stopMySound() stopSound( sound ) end addEventHandler('onPlayerLogin',root,StopMySound) مثال بسيط - ابرئ نفسي منك Link to comment
#BrosS Posted July 2, 2017 Share Posted July 2, 2017 7 minutes ago, Talis said: function startMySound() sound = playSound( "sound.mp3", true ) end addEventHandler( "onPlayerJoin", resourceRoot, startMySound ) function stopMySound() stopSound( sound ) end addEventHandler('onPlayerLogin',root,StopMySound) مثال بسيط - ابرئ نفسي منك x Link to comment
1337.Ibrahim Posted July 2, 2017 Share Posted July 2, 2017 @#BrosS عسى ماجبت العيد بس Link to comment
#BrosS Posted July 2, 2017 Share Posted July 2, 2017 Just now, Talis said: @#BrosS عسى ماجبت العيد بس مخلط وظاىف سيرفر مع كلينت Link to comment
A7M8D Posted July 2, 2017 Share Posted July 2, 2017 (edited) onPlayerLogin stopSound playSound متعملش نفسك برو بس دا كلاينت و دا سيرفر @Talis font = guiCreateFont("Font.ttf", 10) local sound = playSound ( "muse/noovl.mp3" ) local sm = {} sm.moov = 0 sm.object1, sm.object2 = nil, nil local function removeCamHandler () if(sm.moov == 1) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end function camRender () if sm.object1 and isElement(sm.object1) then local x1, y1, z1 = getElementPosition ( sm.object1 ) local x2, y2, z2 = getElementPosition ( sm.object2 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end end 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" ) addEventHandler ( "onClientPreRender", getRootElement(), camRender ) 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 function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "img.png", relative2 ) mainBackgroundLabel = guiCreateLabel ( 55, 0, 450, 100, titleBarText2, false, mainBackground ) guiSetFont ( mainBackgroundLabel, Font ) font = guiCreateFont("Font.ttf", 10) guiLabelSetColor(mainBackgroundLabel, 0, 233, 255) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end addEventHandler("onClientResourceStart",resourceRoot, function () setTimer(function () if isPedInVehicle(localPlayer) then destroyElement(getPedOccupiedVehicle(localPlayer)) end dx = true setCameraMatrix(2070.6166992188 ,1007.6680908203 ,60.8203125 ,2060.6166992188 ,1007.6680908203 ,60.8203125) showCursor(true) guiSetInputEnabled(true) showChat(false) setElementDimension(localPlayer,0) setElementData(localPlayer,"new",false) end,500,1) end ) guiSetFont(mainBackgroundLabel, font) wnd = guiCreateWindow(247, 138, 789, 522, "",false,wnd) guiSetFont(wnd, font) guiCreateWindow(wnd, 66, 240, 12) guiSetProperty(wnd,"CaptionColour","ff0069c7") logownd = guiCreateStaticImage(20, 25, 759, 291, "logo.png", false, wnd) user_l = guiCreateLabel(336, 358, 91, 15, "♥ User Name ♥", false, wnd) guiSetFont(user_l, font) guiLabelSetColor(user_l, 147, 229, 51) user = guiCreateEdit(290, 379, 184, 27, "", false, wnd) pass_l = guiCreateLabel(336, 413, 91, 15, "♥ PassWord ♥", false, wnd) guiSetFont(pass_l, font) guiLabelSetColor(pass_l, 241, 71, 207) pass = guiCreateEdit(289, 431, 184, 27, "", false, wnd) guiEditSetMasked(pass,true) reg = guiCreateButton(270, 465, 87, 23, "♥ Register ♥", false, wnd) guiSetFont(reg, font) guiSetProperty(reg, "NormalTextColour", "FF26D5CB") --------------------------------------------------------------------------------- login = guiCreateButton(399, 465, 87, 23, "♥ Login ♥", false, wnd) guiSetFont(login, font) guiSetProperty(login, "NormalTextColour", "FF26D5CB") centerWindow(wnd) triggerServerEvent("onGetSave",localPlayer) addEventHandler("onClientMouseEnter",guiRoot,function() if ( source == login ) then guiSetText(login,"♥ Login ♥") elseif ( source == reg ) then guiSetText(reg,"♥ Register ♥") elseif ( source == ex ) then guiSetText(ex,"") end end) showPlayerHudComponent('radar',false) addEventHandler("onClientMouseLeave",guiRoot,function() if ( source == login ) then guiSetText(login,"♥ Login ♥") elseif ( source == reg ) then guiSetText(reg,"♥ Register ♥") elseif ( source == ex ) then guiSetText(ex,"") end end) showPlayerHudComponent('radar',false) 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) if ( source == login ) then if user ~= "" and pass ~= "" then if guiCheckBoxGetSelected(remember) then triggerServerEvent("remember",localPlayer,user,pass) else triggerServerEvent("login",localPlayer,user,pass) end else outputChatBox("* You Must Write Username Or Password",255,0,0) end elseif ( source == reg ) then if user ~= "" and pass ~= "" then triggerServerEvent("reg",localPlayer,user,pass) else triggerEvent("addNotification", getLocalPlayer()," الرجاء التأكد من كلمة المرور او اسم المستخدم",2) end end end ) addEvent("onCl",true) addEventHandler("onCl",root, function () guiSetVisible(wnd,false) showCursor(false) guiSetInputEnabled(false) triggerEvent("addNotification", getLocalPlayer(),"",1) triggerEvent("addNotification", getLocalPlayer(),"",1) Show() end ) function setPlayerXYZ(x,y,z) local player = getLocalPlayer() setElementData(player,"x",x) setElementData(player,"y",y) setElementData(player,"z",z) end text = "" dx = false skin = {{46,""},{104,""},{124,""}} num = 1 place = { {"البداية الرئيسية",-4496.9311523438,-2629.4548339844,46.657073974609,-6038.07178, -1211.89038, 4.27837, -4761.966796875, -2609.5629882813, 5.5015625953674}, {"الدايري",1873.07971, 825.39416, 29.59185,1797.5855712891,830.97955322266,10.664346694946,1848.1938476563,807.23809814453,10.6810131073}, {"الطعس",-2541.21655, -2897.66601, 18.39924,-2479.4760742188,-2830.7487792969,3,-2479.4760742188,-2830.7487792969,3}, {"الشارع الطويل",-3070.94921, -3083.84301, 45.22809,-3072.5554199219,-3000.345703125,5,-3072.5554199219,-3000.345703125,5}, } function Show() smoothMoveCamera(2070.6166992188 ,1007.6680908203 ,60.8203125 ,2060.6166992188 ,1007.6680908203 ,60.8203125 ,2025.6166992188 ,1007.6680908203 ,10.8203125,2021.6166992188 ,1007.6680908203 ,10.8203125,6000) ped = createPed(skin[1][1],2021.6166992188 ,1007.6680908203 ,10.1 ,370) bindKey("arrow_l","down",left) bindKey("arrow_r","down",right) bindKey("enter","down",enter) text = skin[1][2] end function left() if num == 1 then num = #skin else num = num - 1 end setElementModel(ped,skin[num][1]) text = skin[num][2] playSoundFrontEnd(32) end function right() if num == #skin then num = 1 else num = num + 1 end setElementModel(ped,skin[num][1]) text = skin[num][2] playSoundFrontEnd(32) end addEventHandler('onClientRender',root,re) function r_s() if ( getElementModel(ped) == 1 ) then setElementModel(ped,2) model = 2 else model = getElementModel(ped) + 1 setElementModel(ped,model) end end function l_s() if ( getElementModel(ped) == 2 ) then setElementModel(ped,1) model = 1 else model = getElementModel(ped) - 1 setElementModel(ped,model) end end function enter() triggerEvent("addNotification", getLocalPlayer(),"",1) playSoundFrontEnd(33) destroyElement(ped) unbindKey("arrow_l") unbindKey("arrow_r") unbindKey("enter") setTimer(fadeCamera, 1000, 1, true) setElementData(localPlayer,"skin",skin[num][1]) num = 1 text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) dx = true bindKey("arrow_l","down",Pleft) bindKey("arrow_r","down",Pright) bindKey("enter","down",Penter) end addEventHandler("onClientRender",root, function () local size = {guiGetScreenSize()} if dx == true then dxDrawText("\n( " .. text .. " )",1,0,size[1] + 1,size[2],tocolor(0,0,0,255),3,"default-bold","center","top",false,false,false,true) dxDrawText("\n( " .. text .. " )",0,0,size[1],size[2],tocolor(255,166,0,255),3,"default-bold","center","top",false,false,false,true) end end ) function Pleft() if num == 1 then num = #place else num = num - 1 end text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) playSoundFrontEnd(32) end function Pright() if num == #place then num = 1 else num = num + 1 end text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) playSoundFrontEnd(32) end function Penter() playSoundFrontEnd(33) unbindKey("arrow_l") unbindKey("arrow_r") unbindKey("enter") triggerEvent("addNotification", getLocalPlayer(),"",1) triggerEvent("addNotification", getLocalPlayer(),"",3) showPlayerHudComponent('radar',true) showChat(true) dx = false text = "" setPlayerXYZ(place[num][8],place[num][9],place[num][10]) triggerServerEvent("SpawnPlayer",localPlayer) stopSound(sound) end fileDelete("Client.lua") بالنسبة لصاحب الموضوع جرب Edited July 2, 2017 by #MR.NaiF Link to comment
Hassan Posted July 2, 2017 Author Share Posted July 2, 2017 24 minutes ago, #MR.NaiF said: onPlayerLogin stopSound playSound متعملش نفسك برو بس دا كلاينت و دا سيرفر @Talis font = guiCreateFont("Font.ttf", 10) local sound = playSound ( "muse/noovl.mp3" ) local sm = {} sm.moov = 0 sm.object1, sm.object2 = nil, nil local function removeCamHandler () if(sm.moov == 1) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end function camRender () if sm.object1 and isElement(sm.object1) then local x1, y1, z1 = getElementPosition ( sm.object1 ) local x2, y2, z2 = getElementPosition ( sm.object2 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end end 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" ) addEventHandler ( "onClientPreRender", getRootElement(), camRender ) 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 function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "img.png", relative2 ) mainBackgroundLabel = guiCreateLabel ( 55, 0, 450, 100, titleBarText2, false, mainBackground ) guiSetFont ( mainBackgroundLabel, Font ) font = guiCreateFont("Font.ttf", 10) guiLabelSetColor(mainBackgroundLabel, 0, 233, 255) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end addEventHandler("onClientResourceStart",resourceRoot, function () setTimer(function () if isPedInVehicle(localPlayer) then destroyElement(getPedOccupiedVehicle(localPlayer)) end dx = true setCameraMatrix(2070.6166992188 ,1007.6680908203 ,60.8203125 ,2060.6166992188 ,1007.6680908203 ,60.8203125) showCursor(true) guiSetInputEnabled(true) showChat(false) setElementDimension(localPlayer,0) setElementData(localPlayer,"new",false) end,500,1) end ) guiSetFont(mainBackgroundLabel, font) wnd = guiCreateWindow(247, 138, 789, 522, "",false,wnd) guiSetFont(wnd, font) guiCreateWindow(wnd, 66, 240, 12) guiSetProperty(wnd,"CaptionColour","ff0069c7") logownd = guiCreateStaticImage(20, 25, 759, 291, "logo.png", false, wnd) user_l = guiCreateLabel(336, 358, 91, 15, "♥ User Name ♥", false, wnd) guiSetFont(user_l, font) guiLabelSetColor(user_l, 147, 229, 51) user = guiCreateEdit(290, 379, 184, 27, "", false, wnd) pass_l = guiCreateLabel(336, 413, 91, 15, "♥ PassWord ♥", false, wnd) guiSetFont(pass_l, font) guiLabelSetColor(pass_l, 241, 71, 207) pass = guiCreateEdit(289, 431, 184, 27, "", false, wnd) guiEditSetMasked(pass,true) reg = guiCreateButton(270, 465, 87, 23, "♥ Register ♥", false, wnd) guiSetFont(reg, font) guiSetProperty(reg, "NormalTextColour", "FF26D5CB") --------------------------------------------------------------------------------- login = guiCreateButton(399, 465, 87, 23, "♥ Login ♥", false, wnd) guiSetFont(login, font) guiSetProperty(login, "NormalTextColour", "FF26D5CB") centerWindow(wnd) triggerServerEvent("onGetSave",localPlayer) addEventHandler("onClientMouseEnter",guiRoot,function() if ( source == login ) then guiSetText(login,"♥ Login ♥") elseif ( source == reg ) then guiSetText(reg,"♥ Register ♥") elseif ( source == ex ) then guiSetText(ex,"") end end) showPlayerHudComponent('radar',false) addEventHandler("onClientMouseLeave",guiRoot,function() if ( source == login ) then guiSetText(login,"♥ Login ♥") elseif ( source == reg ) then guiSetText(reg,"♥ Register ♥") elseif ( source == ex ) then guiSetText(ex,"") end end) showPlayerHudComponent('radar',false) 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) if ( source == login ) then if user ~= "" and pass ~= "" then if guiCheckBoxGetSelected(remember) then triggerServerEvent("remember",localPlayer,user,pass) else triggerServerEvent("login",localPlayer,user,pass) end else outputChatBox("* You Must Write Username Or Password",255,0,0) end elseif ( source == reg ) then if user ~= "" and pass ~= "" then triggerServerEvent("reg",localPlayer,user,pass) else triggerEvent("addNotification", getLocalPlayer()," الرجاء التأكد من كلمة المرور او اسم المستخدم",2) end end end ) addEvent("onCl",true) addEventHandler("onCl",root, function () guiSetVisible(wnd,false) showCursor(false) guiSetInputEnabled(false) triggerEvent("addNotification", getLocalPlayer(),"",1) triggerEvent("addNotification", getLocalPlayer(),"",1) Show() end ) function setPlayerXYZ(x,y,z) local player = getLocalPlayer() setElementData(player,"x",x) setElementData(player,"y",y) setElementData(player,"z",z) end text = "" dx = false skin = {{46,""},{104,""},{124,""}} num = 1 place = { {"البداية الرئيسية",-4496.9311523438,-2629.4548339844,46.657073974609,-6038.07178, -1211.89038, 4.27837, -4761.966796875, -2609.5629882813, 5.5015625953674}, {"الدايري",1873.07971, 825.39416, 29.59185,1797.5855712891,830.97955322266,10.664346694946,1848.1938476563,807.23809814453,10.6810131073}, {"الطعس",-2541.21655, -2897.66601, 18.39924,-2479.4760742188,-2830.7487792969,3,-2479.4760742188,-2830.7487792969,3}, {"الشارع الطويل",-3070.94921, -3083.84301, 45.22809,-3072.5554199219,-3000.345703125,5,-3072.5554199219,-3000.345703125,5}, } function Show() smoothMoveCamera(2070.6166992188 ,1007.6680908203 ,60.8203125 ,2060.6166992188 ,1007.6680908203 ,60.8203125 ,2025.6166992188 ,1007.6680908203 ,10.8203125,2021.6166992188 ,1007.6680908203 ,10.8203125,6000) ped = createPed(skin[1][1],2021.6166992188 ,1007.6680908203 ,10.1 ,370) bindKey("arrow_l","down",left) bindKey("arrow_r","down",right) bindKey("enter","down",enter) text = skin[1][2] end function left() if num == 1 then num = #skin else num = num - 1 end setElementModel(ped,skin[num][1]) text = skin[num][2] playSoundFrontEnd(32) end function right() if num == #skin then num = 1 else num = num + 1 end setElementModel(ped,skin[num][1]) text = skin[num][2] playSoundFrontEnd(32) end addEventHandler('onClientRender',root,re) function r_s() if ( getElementModel(ped) == 1 ) then setElementModel(ped,2) model = 2 else model = getElementModel(ped) + 1 setElementModel(ped,model) end end function l_s() if ( getElementModel(ped) == 2 ) then setElementModel(ped,1) model = 1 else model = getElementModel(ped) - 1 setElementModel(ped,model) end end function enter() triggerEvent("addNotification", getLocalPlayer(),"",1) playSoundFrontEnd(33) destroyElement(ped) unbindKey("arrow_l") unbindKey("arrow_r") unbindKey("enter") setTimer(fadeCamera, 1000, 1, true) setElementData(localPlayer,"skin",skin[num][1]) num = 1 text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) dx = true bindKey("arrow_l","down",Pleft) bindKey("arrow_r","down",Pright) bindKey("enter","down",Penter) end addEventHandler("onClientRender",root, function () local size = {guiGetScreenSize()} if dx == true then dxDrawText("\n( " .. text .. " )",1,0,size[1] + 1,size[2],tocolor(0,0,0,255),3,"default-bold","center","top",false,false,false,true) dxDrawText("\n( " .. text .. " )",0,0,size[1],size[2],tocolor(255,166,0,255),3,"default-bold","center","top",false,false,false,true) end end ) function Pleft() if num == 1 then num = #place else num = num - 1 end text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) playSoundFrontEnd(32) end function Pright() if num == #place then num = 1 else num = num + 1 end text = place[num][1] setCameraMatrix(place[num][2],place[num][3],place[num][4],place[num][5],place[num][6],place[num][7]) playSoundFrontEnd(32) end function Penter() playSoundFrontEnd(33) unbindKey("arrow_l") unbindKey("arrow_r") unbindKey("enter") triggerEvent("addNotification", getLocalPlayer(),"",1) triggerEvent("addNotification", getLocalPlayer(),"",3) showPlayerHudComponent('radar',true) showChat(true) dx = false text = "" setPlayerXYZ(place[num][8],place[num][9],place[num][10]) triggerServerEvent("SpawnPlayer",localPlayer) stopSound(sound) end fileDelete("Client.lua") بالنسبة لصاحب الموضوع جرب كفووووووو يا اخ نايف كفوووووووووووو ياااا شنببب اشكرك بجد المود اتشتغل ميه ميه شكراا 1 Link to comment
1337.Ibrahim Posted July 3, 2017 Share Posted July 3, 2017 (edited) @MR.NaiF تعرفني ؟ اعرفك ؟ Edited July 3, 2017 by Talis 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