|M.r|LooFe| Posted March 16, 2018 Share Posted March 16, 2018 السسلام عليكم يعيال كيفكم انا اليوم صممت مود وابيه ما يظهر الى في العالم الوهمي 140 لما يخش اللاعب من المود عل عالم ذا تظهرله اللوحة مو من زر طبعا اول ما يخش تظهر بوجهه Link to comment
|M.r|LooFe| Posted March 16, 2018 Author Share Posted March 16, 2018 بس؟؟؟ وش الحدث وش الاكواد الثانية هات بس الفنكشنات Link to comment
Ram, Posted March 16, 2018 Share Posted March 16, 2018 36 minutes ago, |M.r|LooFe| said: السسلام عليكم يعيال كيفكم انا اليوم صممت مود وابيه ما يظهر الى في العالم الوهمي 140 لما يخش اللاعب من المود عل عالم ذا تظهرله اللوحة مو من زر طبعا اول ما يخش تظهر بوجهه وضح ؟ , ايش المود ؟ ايش الي يظهر ؟ اي زر ؟ اطرح الاكواد Link to comment
|M.r|LooFe| Posted March 16, 2018 Author Share Posted March 16, 2018 2 minutes ago, AbU - W6N said: وضح ؟ , ايش المود ؟ ايش الي يظهر ؟ اي زر ؟ اطرح الاكواد مهمة هجولة لما يخش تظهر اللوحة بوجهه يختار وزنية طبعا كل شي جاهز بس ابي كود يفتح اللوحة مجرد ما كتب دخول وخش المهمة Link to comment
Ram, Posted March 16, 2018 Share Posted March 16, 2018 1 minute ago, |M.r|LooFe| said: مهمة هجولة لما يخش تظهر اللوحة بوجهه يختار وزنية طبعا كل شي جاهز بس ابي كود يفتح اللوحة مجرد ما كتب دخول وخش المهمة :\ طيب شوف اذا كنت تستخدم " "onClientPlayerChat" تقدر عن طريق الكلنت نفسه تسوي guiSetVisible واذا كنت ب سيرفر سايد triggerClientEvent لا تنسى اللايك Link to comment
|M.r|LooFe| Posted March 16, 2018 Author Share Posted March 16, 2018 تعريف العالم الوهمي احطهه؟ Link to comment
Ram, Posted March 16, 2018 Share Posted March 16, 2018 2 minutes ago, |M.r|LooFe| said: تعريف العالم الوهمي احطهه؟ مافي ضروره اذا مو عارف اطرح الاكواد اسويها لك Link to comment
|M.r|LooFe| Posted March 16, 2018 Author Share Posted March 16, 2018 هذي محاولتي --client addEvent("openGuiDrift",true) addEventHandler("openGuiDrift",root, function () guiSetVisible(wnd, not guiGetVisible ( wnd ) ) showCursor ( guiGetVisible ( wnd ) ) end ) --server triggerClientEvent("openGuiDrift",localPlayer) طبعا الترايقر حطيطه عند "onClientPlayerChat" Link to comment
Ram, Posted March 16, 2018 Share Posted March 16, 2018 5 minutes ago, |M.r|LooFe| said: هذي محاولتي --client addEvent("openGuiDrift",true) addEventHandler("openGuiDrift",root, function () guiSetVisible(wnd, not guiGetVisible ( wnd ) ) showCursor ( guiGetVisible ( wnd ) ) end ) --server triggerClientEvent("openGuiDrift",localPlayer) طبعا الترايقر حطيطه عند "onClientPlayerChat" كيف سويت ترايقر للكلنت وسويت افنت خاصة بالكلنت ب سيرفر سايد؟ اطرح اكواد السيرفر والكلنت معلوم ما راح يشتغل + الترايقر من السيرفر للكلنت ينكتب كذا triggerClientEvent(المتغير,"Event",المتغير) Link to comment
|M.r|LooFe| Posted March 16, 2018 Author Share Posted March 16, 2018 --server outputChatBox("#610B0B.:#585858[ #610B0BDrift_Mission By |M.r|LooFe|#585858 ]#610B0B:.",root,255,255,0,true) addEventHandler( 'onPlayerCommand', getRootElement( ), function( cmd ) if ( getElementData( source,"Mission" ) == true and cmd == 'admin' ) then cancelEvent( ) outputChatBox("* Admin : لايمكنك إستخدام اللوحة في المهمات",source,255,0,0) end end ) spawns = {} setElementData(resourceRoot,"map1","no") setElementData(resourceRoot,"winMoney1","0") addEventHandler("onPlayerChat",getRootElement(),function(message) if tostring(message) == "دخول" and checkDuel(source) == "prestart" and ( not checkExistPlrOnDuel(source) ) then triggerClientEvent("openGuiDrift",localPlayer) online = countPlayersOnDerby() if tonumber(online)+1 < 32 then setData(source,"Mission","yes") setData(source,"onCrossMap1","yes") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA تم اضافتك في المهمة , انتظر حتى يبدأ القيم #800000#",source,255,255,0,true) setD(source) spawnOnMap(source) else outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA امتلئت المهمة , الرجاء انتظار القيم القآدم #800000#",source,0,255,0,true) end end end) function checkDuel(p) if tostring(getElementData(resourceRoot,"map1")) == "yes" then outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA المهمة شغالة حاليا #800000#",p,255,255,0,true) elseif tostring(getElementData(resourceRoot,"map1")) == "no" then outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA المهمة غير شغالة حاليا #800000#",p,255,255,0,true) end return tostring(getElementData(resourceRoot,"map1")) end function checkExistPlrOnDuel(p) per = getElementData(p,"onCrossMap1") if tostring(per) == "yes" then return true else return false end end function setData(element,key,vlr) setElementData(element,key,vlr) end function setD(element) setElementDimension(element,140) end function spawnOnMap(p) count = countPlayersOnDerby() spawned = "no" for i,data in pairs(spawns)do if tonumber(data.id) == tonumber(count) then spawned = "yes" v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz) setElementDimension(v,140) setElementFrozen(v,true) setElementData(v,"creatorShoter","yes") break end end if spawned == "no" then randomS = math.random("1","32") for i,data in pairs(spawns)do if tonumber(data.id) == tonumber(randomS) then v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz) setElementDimension(v,140) setElementFrozen(v,true) setElementData(v,"creatorShoter","yes") break end end end toggleControl(p,"enter_exit", false ) warpPedIntoVehicle(p,v) setCameraTarget(p,p) end function countPlayersOnDerby() c = -1 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 end end return tonumber(c) end function eventCheck () if checkExistPlrOnDuel(source) then toggleControl(source,"enter_exit",true ) setData(source,"onCrossMap1","no") checkEnd() end end addEventHandler("onPlayerWasted",getRootElement(),eventCheck) addEventHandler("onPlayerQuit",getRootElement(),eventCheck) addEventHandler("onPlayerJoin",getRootElement(),function() setData(source,"onCrossMap1","no") end) for i,p in pairs(getElementsByType("player"))do setData(p,"onCrossMap1","no") end function checkEnd() c = 0 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 winner = p end end if tonumber(c) == 1 then givePlayerMoney(winner,tonumber(getElementData(resourceRoot,"winMoney1"))) n = string.gsub(getPlayerName(winner), "#%x%x%x%x%x%x", "") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF: #610B0B[ #6E6E6E" .. n .. " #610B0B] #FFFAAA مبروك للفائز في مهمة الدرفت",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setElementData(resourceRoot,"map1","no") endDerby() setTimer(newDuel,30000,1) end end function newDuel() for i,p in pairs(getElementsByType("player"))do setData(p,"onCrossMap1","no") end setElementData(resourceRoot,"map1","prestart") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA للدخول الى مهمة الدرفت اكتب في الشات دخول",getRootElement(),255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) RMoney = math.random("50000","300000") setElementData(resourceRoot,"winMoney1",tonumber(RMoney)) setTimer(checkPlrs,30000,1) end function checkPlrs () c = 0 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 end end if tonumber(c) > 1 then setElementData(resourceRoot,"map1","yes") for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then setElementCollisionsEnabled(getPedOccupiedVehicle(p),true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA لقد بدأ الدرفت يمكنك الانطلاق",p,0,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setElementFrozen(getPedOccupiedVehicle(p),false) end end else endDerby() setElementData(resourceRoot,"map1","no") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA ! لم يبدأ الدرفت لعدم توفر لاعبين",getRootElement(),255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setTimer(newDuel,60000,1) end end setTimer(newDuel,3000,1) function onStartLoadSpawns () file = fileOpen("map1.map") localFile = fileOpen("map1.xml") fileWrite(localFile,"") data = fileRead(file,999999) fileWrite(localFile,data) fileClose(localFile) xml = xmlLoadFile("map1.xml") c = 0 for i,data in pairs(xmlNodeGetChildren(xml)) do if xmlNodeGetName(data) == "spawnpoint" then c = c+1 v,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"vehicle"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ") table.insert(spawns,{id = c,model = v,x = xx,y = yy,z = zz,rx = rxx,ry = ryy,rz = rzz}) end end for i,data in pairs(xmlNodeGetChildren(xml)) do if xmlNodeGetName(data) == "object" then m,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"model"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ") object = createObject(m,xx,yy,zz,rxx,ryy,rzz) setElementDimension(object,140) end end end setTimer(onStartLoadSpawns,3000,1) function endDerby() for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then killPed(p) end end for i,v in pairs(getElementsByType("vehicle"))do if getElementData(v,"creatorShoter") then destroyElement(v) end end end setTimer(function() for i,p in pairs(getElementsByType("player"))do sea(p) resetHan(p) checkVeh(p) checkModel(p) end end,1000,0) function sea(p) if checkExistPlrOnDuel(p) then x,y,z = getElementPosition(p) if tonumber(z) <= 0 then killPed(p) end end end function checkVeh(p) if (tonumber(getElementDimension(p)) == 140) and not (isPedInVehicle(p))then killPed(p) end end function resetHan(p) if checkExistPlrOnDuel(p) then setVehicleHandling (getPedOccupiedVehicle(p), true ) end end function checkModel(p) if checkExistPlrOnDuel(p) and isPedInVehicle(p) then if tonumber(getElementModel(getPedOccupiedVehicle(p))) ~= 411 then killPed(p) end end end -------------------- -- client addEventHandler("onClientRender",getRootElement(),function() if tostring(getElementData(getLocalPlayer(),"onCrossMap1")) == "yes" then setWorldSpecialPropertyEnabled("aircars", false) setWorldSpecialPropertyEnabled("extrajump", false) setWorldSpecialPropertyEnabled("hovercars", false) end end) local Keys,Dim = {"F1","F2","F3","F4","F5","F6","F7","F9","F10","p","m","j","`","]","[","/","F","enter","shift","x","b","k","o"} , 140 ; addEventHandler ( "onClientKey" , root , function ( key , press ) if ( press and getElementDimension ( localPlayer ) == Dim ) then for k,v in ipairs ( Keys ) do if ( v == key ) then cancelEvent() end end end end ) ; addEvent("openGuiDrift",true) addEventHandler("openGuiDrift",root, function () guiSetVisible(wnd, not guiGetVisible ( wnd ) ) showCursor ( guiGetVisible ( wnd ) ) end ) addEventHandler("onClientGUIClick",root, function () if source == ex then if(guiGetVisible(اسم اللوحة) == false)then end guiSetVisible(اسم اللوحة,false) showCursor(false) guiSetInputEnabled(false) end end) Link to comment
Ram, Posted March 16, 2018 Share Posted March 16, 2018 1 hour ago, |M.r|LooFe| said: --server outputChatBox("#610B0B.:#585858[ #610B0BDrift_Mission By |M.r|LooFe|#585858 ]#610B0B:.",root,255,255,0,true) addEventHandler( 'onPlayerCommand', getRootElement( ), function( cmd ) if ( getElementData( source,"Mission" ) == true and cmd == 'admin' ) then cancelEvent( ) outputChatBox("* Admin : لايمكنك إستخدام اللوحة في المهمات",source,255,0,0) end end ) spawns = {} setElementData(resourceRoot,"map1","no") setElementData(resourceRoot,"winMoney1","0") addEventHandler("onPlayerChat",getRootElement(),function(message) if tostring(message) == "دخول" and checkDuel(source) == "prestart" and ( not checkExistPlrOnDuel(source) ) then triggerClientEvent("openGuiDrift",localPlayer) online = countPlayersOnDerby() if tonumber(online)+1 < 32 then setData(source,"Mission","yes") setData(source,"onCrossMap1","yes") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA تم اضافتك في المهمة , انتظر حتى يبدأ القيم #800000#",source,255,255,0,true) setD(source) spawnOnMap(source) else outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA امتلئت المهمة , الرجاء انتظار القيم القآدم #800000#",source,0,255,0,true) end end end) function checkDuel(p) if tostring(getElementData(resourceRoot,"map1")) == "yes" then outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA المهمة شغالة حاليا #800000#",p,255,255,0,true) elseif tostring(getElementData(resourceRoot,"map1")) == "no" then outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA المهمة غير شغالة حاليا #800000#",p,255,255,0,true) end return tostring(getElementData(resourceRoot,"map1")) end function checkExistPlrOnDuel(p) per = getElementData(p,"onCrossMap1") if tostring(per) == "yes" then return true else return false end end function setData(element,key,vlr) setElementData(element,key,vlr) end function setD(element) setElementDimension(element,140) end function spawnOnMap(p) count = countPlayersOnDerby() spawned = "no" for i,data in pairs(spawns)do if tonumber(data.id) == tonumber(count) then spawned = "yes" v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz) setElementDimension(v,140) setElementFrozen(v,true) setElementData(v,"creatorShoter","yes") break end end if spawned == "no" then randomS = math.random("1","32") for i,data in pairs(spawns)do if tonumber(data.id) == tonumber(randomS) then v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz) setElementDimension(v,140) setElementFrozen(v,true) setElementData(v,"creatorShoter","yes") break end end end toggleControl(p,"enter_exit", false ) warpPedIntoVehicle(p,v) setCameraTarget(p,p) end function countPlayersOnDerby() c = -1 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 end end return tonumber(c) end function eventCheck () if checkExistPlrOnDuel(source) then toggleControl(source,"enter_exit",true ) setData(source,"onCrossMap1","no") checkEnd() end end addEventHandler("onPlayerWasted",getRootElement(),eventCheck) addEventHandler("onPlayerQuit",getRootElement(),eventCheck) addEventHandler("onPlayerJoin",getRootElement(),function() setData(source,"onCrossMap1","no") end) for i,p in pairs(getElementsByType("player"))do setData(p,"onCrossMap1","no") end function checkEnd() c = 0 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 winner = p end end if tonumber(c) == 1 then givePlayerMoney(winner,tonumber(getElementData(resourceRoot,"winMoney1"))) n = string.gsub(getPlayerName(winner), "#%x%x%x%x%x%x", "") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF: #610B0B[ #6E6E6E" .. n .. " #610B0B] #FFFAAA مبروك للفائز في مهمة الدرفت",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setElementData(resourceRoot,"map1","no") endDerby() setTimer(newDuel,30000,1) end end function newDuel() for i,p in pairs(getElementsByType("player"))do setData(p,"onCrossMap1","no") end setElementData(resourceRoot,"map1","prestart") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA للدخول الى مهمة الدرفت اكتب في الشات دخول",getRootElement(),255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) RMoney = math.random("50000","300000") setElementData(resourceRoot,"winMoney1",tonumber(RMoney)) setTimer(checkPlrs,30000,1) end function checkPlrs () c = 0 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 end end if tonumber(c) > 1 then setElementData(resourceRoot,"map1","yes") for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then setElementCollisionsEnabled(getPedOccupiedVehicle(p),true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA لقد بدأ الدرفت يمكنك الانطلاق",p,0,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setElementFrozen(getPedOccupiedVehicle(p),false) end end else endDerby() setElementData(resourceRoot,"map1","no") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA ! لم يبدأ الدرفت لعدم توفر لاعبين",getRootElement(),255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setTimer(newDuel,60000,1) end end setTimer(newDuel,3000,1) function onStartLoadSpawns () file = fileOpen("map1.map") localFile = fileOpen("map1.xml") fileWrite(localFile,"") data = fileRead(file,999999) fileWrite(localFile,data) fileClose(localFile) xml = xmlLoadFile("map1.xml") c = 0 for i,data in pairs(xmlNodeGetChildren(xml)) do if xmlNodeGetName(data) == "spawnpoint" then c = c+1 v,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"vehicle"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ") table.insert(spawns,{id = c,model = v,x = xx,y = yy,z = zz,rx = rxx,ry = ryy,rz = rzz}) end end for i,data in pairs(xmlNodeGetChildren(xml)) do if xmlNodeGetName(data) == "object" then m,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"model"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ") object = createObject(m,xx,yy,zz,rxx,ryy,rzz) setElementDimension(object,140) end end end setTimer(onStartLoadSpawns,3000,1) function endDerby() for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then killPed(p) end end for i,v in pairs(getElementsByType("vehicle"))do if getElementData(v,"creatorShoter") then destroyElement(v) end end end setTimer(function() for i,p in pairs(getElementsByType("player"))do sea(p) resetHan(p) checkVeh(p) checkModel(p) end end,1000,0) function sea(p) if checkExistPlrOnDuel(p) then x,y,z = getElementPosition(p) if tonumber(z) <= 0 then killPed(p) end end end function checkVeh(p) if (tonumber(getElementDimension(p)) == 140) and not (isPedInVehicle(p))then killPed(p) end end function resetHan(p) if checkExistPlrOnDuel(p) then setVehicleHandling (getPedOccupiedVehicle(p), true ) end end function checkModel(p) if checkExistPlrOnDuel(p) and isPedInVehicle(p) then if tonumber(getElementModel(getPedOccupiedVehicle(p))) ~= 411 then killPed(p) end end end -------------------- -- client addEventHandler("onClientRender",getRootElement(),function() if tostring(getElementData(getLocalPlayer(),"onCrossMap1")) == "yes" then setWorldSpecialPropertyEnabled("aircars", false) setWorldSpecialPropertyEnabled("extrajump", false) setWorldSpecialPropertyEnabled("hovercars", false) end end) local Keys,Dim = {"F1","F2","F3","F4","F5","F6","F7","F9","F10","p","m","j","`","]","[","/","F","enter","shift","x","b","k","o"} , 140 ; addEventHandler ( "onClientKey" , root , function ( key , press ) if ( press and getElementDimension ( localPlayer ) == Dim ) then for k,v in ipairs ( Keys ) do if ( v == key ) then cancelEvent() end end end end ) ; addEvent("openGuiDrift",true) addEventHandler("openGuiDrift",root, function () guiSetVisible(wnd, not guiGetVisible ( wnd ) ) showCursor ( guiGetVisible ( wnd ) ) end ) addEventHandler("onClientGUIClick",root, function () if source == ex then if(guiGetVisible(اسم اللوحة) == false)then end guiSetVisible(اسم اللوحة,false) showCursor(false) guiSetInputEnabled(false) end end) ما اشوف لوحة ب إسم wnd + --server outputChatBox("#610B0B.:#585858[ #610B0BDrift_Mission By |M.r|LooFe|#585858 ]#610B0B:.",root,255,255,0,true) addEventHandler( 'onPlayerCommand', getRootElement( ), function( cmd ) if ( getElementData( source,"Mission" ) == true and cmd == 'admin' ) then cancelEvent( ) outputChatBox("* Admin : لايمكنك إستخدام اللوحة في المهمات",source,255,0,0) end end ) spawns = {} setElementData(resourceRoot,"map1","no") setElementData(resourceRoot,"winMoney1","0") addEventHandler("onPlayerChat",getRootElement(),function(message) if tostring(message) == "دخول" and checkDuel(source) == "prestart" and ( not checkExistPlrOnDuel(source) ) then online = countPlayersOnDerby() if tonumber(online)+1 < 32 then setData(source,"Mission","yes") setData(source,"onCrossMap1","yes") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA تم اضافتك في المهمة , انتظر حتى يبدأ القيم #800000#",source,255,255,0,true) setD(source) triggerClientEvent(source,"openGuiDrift",source) spawnOnMap(source) else outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA امتلئت المهمة , الرجاء انتظار القيم القآدم #800000#",source,0,255,0,true) end end end) function checkDuel(p) if tostring(getElementData(resourceRoot,"map1")) == "yes" then outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA المهمة شغالة حاليا #800000#",p,255,255,0,true) elseif tostring(getElementData(resourceRoot,"map1")) == "no" then outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA المهمة غير شغالة حاليا #800000#",p,255,255,0,true) end return tostring(getElementData(resourceRoot,"map1")) end function checkExistPlrOnDuel(p) per = getElementData(p,"onCrossMap1") if tostring(per) == "yes" then return true else return false end end function setData(element,key,vlr) setElementData(element,key,vlr) end function setD(element) setElementDimension(element,140) end function spawnOnMap(p) count = countPlayersOnDerby() spawned = "no" for i,data in pairs(spawns)do if tonumber(data.id) == tonumber(count) then spawned = "yes" v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz) setElementDimension(v,140) setElementFrozen(v,true) setElementData(v,"creatorShoter","yes") break end end if spawned == "no" then randomS = math.random("1","32") for i,data in pairs(spawns)do if tonumber(data.id) == tonumber(randomS) then v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz) setElementDimension(v,140) setElementFrozen(v,true) setElementData(v,"creatorShoter","yes") break end end end toggleControl(p,"enter_exit", false ) warpPedIntoVehicle(p,v) setCameraTarget(p,p) end function countPlayersOnDerby() c = -1 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 end end return tonumber(c) end function eventCheck () if checkExistPlrOnDuel(source) then toggleControl(source,"enter_exit",true ) setData(source,"onCrossMap1","no") checkEnd() end end addEventHandler("onPlayerWasted",getRootElement(),eventCheck) addEventHandler("onPlayerQuit",getRootElement(),eventCheck) addEventHandler("onPlayerJoin",getRootElement(),function() setData(source,"onCrossMap1","no") end) for i,p in pairs(getElementsByType("player"))do setData(p,"onCrossMap1","no") end function checkEnd() c = 0 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 winner = p end end if tonumber(c) == 1 then givePlayerMoney(winner,tonumber(getElementData(resourceRoot,"winMoney1"))) n = string.gsub(getPlayerName(winner), "#%x%x%x%x%x%x", "") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF: #610B0B[ #6E6E6E" .. n .. " #610B0B] #FFFAAA مبروك للفائز في مهمة الدرفت",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setElementData(resourceRoot,"map1","no") endDerby() setTimer(newDuel,30000,1) end end function newDuel() for i,p in pairs(getElementsByType("player"))do setData(p,"onCrossMap1","no") end setElementData(resourceRoot,"map1","prestart") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA للدخول الى مهمة الدرفت اكتب في الشات دخول",getRootElement(),255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) RMoney = math.random("50000","300000") setElementData(resourceRoot,"winMoney1",tonumber(RMoney)) setTimer(checkPlrs,30000,1) end function checkPlrs () c = 0 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 end end if tonumber(c) > 1 then setElementData(resourceRoot,"map1","yes") for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then setElementCollisionsEnabled(getPedOccupiedVehicle(p),true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA لقد بدأ الدرفت يمكنك الانطلاق",p,0,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setElementFrozen(getPedOccupiedVehicle(p),false) end end else endDerby() setElementData(resourceRoot,"map1","no") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA ! لم يبدأ الدرفت لعدم توفر لاعبين",getRootElement(),255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setTimer(newDuel,60000,1) end end setTimer(newDuel,3000,1) function onStartLoadSpawns () file = fileOpen("map1.map") localFile = fileOpen("map1.xml") fileWrite(localFile,"") data = fileRead(file,999999) fileWrite(localFile,data) fileClose(localFile) xml = xmlLoadFile("map1.xml") c = 0 for i,data in pairs(xmlNodeGetChildren(xml)) do if xmlNodeGetName(data) == "spawnpoint" then c = c+1 v,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"vehicle"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ") table.insert(spawns,{id = c,model = v,x = xx,y = yy,z = zz,rx = rxx,ry = ryy,rz = rzz}) end end for i,data in pairs(xmlNodeGetChildren(xml)) do if xmlNodeGetName(data) == "object" then m,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"model"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ") object = createObject(m,xx,yy,zz,rxx,ryy,rzz) setElementDimension(object,140) end end end setTimer(onStartLoadSpawns,3000,1) function endDerby() for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then killPed(p) end end for i,v in pairs(getElementsByType("vehicle"))do if getElementData(v,"creatorShoter") then destroyElement(v) end end end setTimer(function() for i,p in pairs(getElementsByType("player"))do sea(p) resetHan(p) checkVeh(p) checkModel(p) end end,1000,0) function sea(p) if checkExistPlrOnDuel(p) then x,y,z = getElementPosition(p) if tonumber(z) <= 0 then killPed(p) end end end function checkVeh(p) if (tonumber(getElementDimension(p)) == 140) and not (isPedInVehicle(p))then killPed(p) end end function resetHan(p) if checkExistPlrOnDuel(p) then setVehicleHandling (getPedOccupiedVehicle(p), true ) end end function checkModel(p) if checkExistPlrOnDuel(p) and isPedInVehicle(p) then if tonumber(getElementModel(getPedOccupiedVehicle(p))) ~= 411 then killPed(p) end end end -------------------- -- client addEventHandler("onClientRender",getRootElement(),function() if tostring(getElementData(getLocalPlayer(),"onCrossMap1")) == "yes" then setWorldSpecialPropertyEnabled("aircars", false) setWorldSpecialPropertyEnabled("extrajump", false) setWorldSpecialPropertyEnabled("hovercars", false) end end) local Keys,Dim = {"F1","F2","F3","F4","F5","F6","F7","F9","F10","p","m","j","`","]","[","/","F","enter","shift","x","b","k","o"} , 140 ; addEventHandler ( "onClientKey" , root , function ( key , press ) if ( press and getElementDimension ( localPlayer ) == Dim ) then for k,v in ipairs ( Keys ) do if ( v == key ) then cancelEvent() end end end end ) ; addEvent("openGuiDrift",true) addEventHandler("openGuiDrift",root, function () guiSetVisible(wnd,true ) showCursor ( true ) end ) addEventHandler("onClientGUIClick",root, function () if source == ex then if(guiGetVisible(اسم اللوحة) == false)then end guiSetVisible(اسم اللوحة,false) showCursor(false) guiSetInputEnabled(false) end end) Try 1 Link to comment
|M.r|LooFe| Posted March 16, 2018 Author Share Posted March 16, 2018 لسا موب حاطط اللوحة اجهز فالاكواد ! Link to comment
Ram, Posted March 16, 2018 Share Posted March 16, 2018 2 hours ago, |M.r|LooFe| said: لسا موب حاطط اللوحة اجهز فالاكواد ! جرب الكود الي رسلته لك ذا --server outputChatBox("#610B0B.:#585858[ #610B0BDrift_Mission By |M.r|LooFe|#585858 ]#610B0B:.",root,255,255,0,true) addEventHandler( 'onPlayerCommand', getRootElement( ), function( cmd ) if ( getElementData( source,"Mission" ) == true and cmd == 'admin' ) then cancelEvent( ) outputChatBox("* Admin : لايمكنك إستخدام اللوحة في المهمات",source,255,0,0) end end ) spawns = {} setElementData(resourceRoot,"map1","no") setElementData(resourceRoot,"winMoney1","0") addEventHandler("onPlayerChat",getRootElement(),function(message) if tostring(message) == "دخول" and checkDuel(source) == "prestart" and ( not checkExistPlrOnDuel(source) ) then online = countPlayersOnDerby() if tonumber(online)+1 < 32 then setData(source,"Mission","yes") setData(source,"onCrossMap1","yes") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA تم اضافتك في المهمة , انتظر حتى يبدأ القيم #800000#",source,255,255,0,true) setD(source) triggerClientEvent(source,"openGuiDrift",source) spawnOnMap(source) else outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA امتلئت المهمة , الرجاء انتظار القيم القآدم #800000#",source,0,255,0,true) end end end) function checkDuel(p) if tostring(getElementData(resourceRoot,"map1")) == "yes" then outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA المهمة شغالة حاليا #800000#",p,255,255,0,true) elseif tostring(getElementData(resourceRoot,"map1")) == "no" then outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA المهمة غير شغالة حاليا #800000#",p,255,255,0,true) end return tostring(getElementData(resourceRoot,"map1")) end function checkExistPlrOnDuel(p) per = getElementData(p,"onCrossMap1") if tostring(per) == "yes" then return true else return false end end function setData(element,key,vlr) setElementData(element,key,vlr) end function setD(element) setElementDimension(element,140) end function spawnOnMap(p) count = countPlayersOnDerby() spawned = "no" for i,data in pairs(spawns)do if tonumber(data.id) == tonumber(count) then spawned = "yes" v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz) setElementDimension(v,140) setElementFrozen(v,true) setElementData(v,"creatorShoter","yes") break end end if spawned == "no" then randomS = math.random("1","32") for i,data in pairs(spawns)do if tonumber(data.id) == tonumber(randomS) then v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz) setElementDimension(v,140) setElementFrozen(v,true) setElementData(v,"creatorShoter","yes") break end end end toggleControl(p,"enter_exit", false ) warpPedIntoVehicle(p,v) setCameraTarget(p,p) end function countPlayersOnDerby() c = -1 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 end end return tonumber(c) end function eventCheck () if checkExistPlrOnDuel(source) then toggleControl(source,"enter_exit",true ) setData(source,"onCrossMap1","no") checkEnd() end end addEventHandler("onPlayerWasted",getRootElement(),eventCheck) addEventHandler("onPlayerQuit",getRootElement(),eventCheck) addEventHandler("onPlayerJoin",getRootElement(),function() setData(source,"onCrossMap1","no") end) for i,p in pairs(getElementsByType("player"))do setData(p,"onCrossMap1","no") end function checkEnd() c = 0 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 winner = p end end if tonumber(c) == 1 then givePlayerMoney(winner,tonumber(getElementData(resourceRoot,"winMoney1"))) n = string.gsub(getPlayerName(winner), "#%x%x%x%x%x%x", "") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF: #610B0B[ #6E6E6E" .. n .. " #610B0B] #FFFAAA مبروك للفائز في مهمة الدرفت",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setElementData(resourceRoot,"map1","no") endDerby() setTimer(newDuel,30000,1) end end function newDuel() for i,p in pairs(getElementsByType("player"))do setData(p,"onCrossMap1","no") end setElementData(resourceRoot,"map1","prestart") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA للدخول الى مهمة الدرفت اكتب في الشات دخول",getRootElement(),255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) RMoney = math.random("50000","300000") setElementData(resourceRoot,"winMoney1",tonumber(RMoney)) setTimer(checkPlrs,30000,1) end function checkPlrs () c = 0 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 end end if tonumber(c) > 1 then setElementData(resourceRoot,"map1","yes") for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then setElementCollisionsEnabled(getPedOccupiedVehicle(p),true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA لقد بدأ الدرفت يمكنك الانطلاق",p,0,255,0,true) outputChatBox(" ",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setElementFrozen(getPedOccupiedVehicle(p),false) end end else endDerby() setElementData(resourceRoot,"map1","no") outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA ! لم يبدأ الدرفت لعدم توفر لاعبين",getRootElement(),255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:",root,255,255,0,true) outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true) setTimer(newDuel,60000,1) end end setTimer(newDuel,3000,1) function onStartLoadSpawns () file = fileOpen("map1.map") localFile = fileOpen("map1.xml") fileWrite(localFile,"") data = fileRead(file,999999) fileWrite(localFile,data) fileClose(localFile) xml = xmlLoadFile("map1.xml") c = 0 for i,data in pairs(xmlNodeGetChildren(xml)) do if xmlNodeGetName(data) == "spawnpoint" then c = c+1 v,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"vehicle"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ") table.insert(spawns,{id = c,model = v,x = xx,y = yy,z = zz,rx = rxx,ry = ryy,rz = rzz}) end end for i,data in pairs(xmlNodeGetChildren(xml)) do if xmlNodeGetName(data) == "object" then m,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"model"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ") object = createObject(m,xx,yy,zz,rxx,ryy,rzz) setElementDimension(object,140) end end end setTimer(onStartLoadSpawns,3000,1) function endDerby() for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then killPed(p) end end for i,v in pairs(getElementsByType("vehicle"))do if getElementData(v,"creatorShoter") then destroyElement(v) end end end setTimer(function() for i,p in pairs(getElementsByType("player"))do sea(p) resetHan(p) checkVeh(p) checkModel(p) end end,1000,0) function sea(p) if checkExistPlrOnDuel(p) then x,y,z = getElementPosition(p) if tonumber(z) <= 0 then killPed(p) end end end function checkVeh(p) if (tonumber(getElementDimension(p)) == 140) and not (isPedInVehicle(p))then killPed(p) end end function resetHan(p) if checkExistPlrOnDuel(p) then setVehicleHandling (getPedOccupiedVehicle(p), true ) end end function checkModel(p) if checkExistPlrOnDuel(p) and isPedInVehicle(p) then if tonumber(getElementModel(getPedOccupiedVehicle(p))) ~= 411 then killPed(p) end end end -------------------- -- client addEventHandler("onClientRender",getRootElement(),function() if tostring(getElementData(getLocalPlayer(),"onCrossMap1")) == "yes" then setWorldSpecialPropertyEnabled("aircars", false) setWorldSpecialPropertyEnabled("extrajump", false) setWorldSpecialPropertyEnabled("hovercars", false) end end) local Keys,Dim = {"F1","F2","F3","F4","F5","F6","F7","F9","F10","p","m","j","`","]","[","/","F","enter","shift","x","b","k","o"} , 140 ; addEventHandler ( "onClientKey" , root , function ( key , press ) if ( press and getElementDimension ( localPlayer ) == Dim ) then for k,v in ipairs ( Keys ) do if ( v == key ) then cancelEvent() end end end end ) ; addEvent("openGuiDrift",true) addEventHandler("openGuiDrift",root, function () guiSetVisible(wnd,true ) showCursor ( true ) end ) addEventHandler("onClientGUIClick",root, function () if source == ex then if(guiGetVisible(اسم اللوحة) == false)then end guiSetVisible(اسم اللوحة,false) showCursor(false) guiSetInputEnabled(false) end end) لا تبخل علينا ب اللايك ي كبير <3 2 Link to comment
abdalaziz Posted March 16, 2018 Share Posted March 16, 2018 Just now, AbU - W6N said: جرب الكود الي رسلته لك ذا --serveroutputChatBox("#610B0B.:#585858[ #610B0BDrift_Mission By |M.r|LooFe|#585858 ]#610B0B:.",root,255,255,0,true)addEventHandler( 'onPlayerCommand', getRootElement( ),function( cmd ) if ( getElementData( source,"Mission" ) == true and cmd == 'admin' ) then cancelEvent( ) outputChatBox("* Admin : لايمكنك إستخدام اللوحة في المهمات",source,255,0,0) endend )spawns = {}setElementData(resourceRoot,"map1","no")setElementData(resourceRoot,"winMoney1","0")addEventHandler("onPlayerChat",getRootElement(),function(message)if tostring(message) == "دخول" and checkDuel(source) == "prestart" and ( not checkExistPlrOnDuel(source) ) thenonline = countPlayersOnDerby()if tonumber(online)+1 < 32 thensetData(source,"Mission","yes")setData(source,"onCrossMap1","yes")outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA تم اضافتك في المهمة , انتظر حتى يبدأ القيم #800000#",source,255,255,0,true)setD(source)triggerClientEvent(source,"openGuiDrift",source)spawnOnMap(source)elseoutputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA امتلئت المهمة , الرجاء انتظار القيم القآدم #800000#",source,0,255,0,true)endend end)function checkDuel(p)if tostring(getElementData(resourceRoot,"map1")) == "yes" thenoutputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA المهمة شغالة حاليا #800000#",p,255,255,0,true)elseif tostring(getElementData(resourceRoot,"map1")) == "no" thenoutputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA المهمة غير شغالة حاليا #800000#",p,255,255,0,true)endreturn tostring(getElementData(resourceRoot,"map1"))endfunction checkExistPlrOnDuel(p)per = getElementData(p,"onCrossMap1")if tostring(per) == "yes" thenreturn trueelsereturn falseendendfunction setData(element,key,vlr)setElementData(element,key,vlr)endfunction setD(element)setElementDimension(element,140)endfunction spawnOnMap(p)count = countPlayersOnDerby()spawned = "no"for i,data in pairs(spawns)doif tonumber(data.id) == tonumber(count) thenspawned = "yes"v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz)setElementDimension(v,140)setElementFrozen(v,true)setElementData(v,"creatorShoter","yes")breakendendif spawned == "no" thenrandomS = math.random("1","32")for i,data in pairs(spawns)doif tonumber(data.id) == tonumber(randomS) thenv = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz)setElementDimension(v,140)setElementFrozen(v,true)setElementData(v,"creatorShoter","yes")breakend endendtoggleControl(p,"enter_exit", false ) warpPedIntoVehicle(p,v)setCameraTarget(p,p)endfunction countPlayersOnDerby()c = -1for i,p in pairs(getElementsByType("player"))doif checkExistPlrOnDuel(p) thenc = c+1endend return tonumber(c)endfunction eventCheck ()if checkExistPlrOnDuel(source) thentoggleControl(source,"enter_exit",true ) setData(source,"onCrossMap1","no")checkEnd()endendaddEventHandler("onPlayerWasted",getRootElement(),eventCheck)addEventHandler("onPlayerQuit",getRootElement(),eventCheck)addEventHandler("onPlayerJoin",getRootElement(),function()setData(source,"onCrossMap1","no")end)for i,p in pairs(getElementsByType("player"))dosetData(p,"onCrossMap1","no")endfunction checkEnd()c = 0for i,p in pairs(getElementsByType("player"))doif checkExistPlrOnDuel(p) thenc = c+1winner = pend endif tonumber(c) == 1 thengivePlayerMoney(winner,tonumber(getElementData(resourceRoot,"winMoney1")))n = string.gsub(getPlayerName(winner), "#%x%x%x%x%x%x", "")outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true)outputChatBox(" ",root,255,255,0,true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF: #610B0B[ #6E6E6E" .. n .. " #610B0B] #FFFAAA مبروك للفائز في مهمة الدرفت",root,255,255,0,true)outputChatBox(" ",root,255,255,0,true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true)setElementData(resourceRoot,"map1","no")endDerby()setTimer(newDuel,30000,1)endendfunction newDuel()for i,p in pairs(getElementsByType("player"))dosetData(p,"onCrossMap1","no")endsetElementData(resourceRoot,"map1","prestart")outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true)outputChatBox(" ",root,255,255,0,true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA للدخول الى مهمة الدرفت اكتب في الشات دخول",getRootElement(),255,255,0,true)outputChatBox(" ",root,255,255,0,true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true)RMoney = math.random("50000","300000")setElementData(resourceRoot,"winMoney1",tonumber(RMoney))setTimer(checkPlrs,30000,1)endfunction checkPlrs ()c = 0for i,p in pairs(getElementsByType("player"))doif checkExistPlrOnDuel(p) thenc = c+1end endif tonumber(c) > 1 thensetElementData(resourceRoot,"map1","yes")for i,p in pairs(getElementsByType("player"))doif checkExistPlrOnDuel(p) thensetElementCollisionsEnabled(getPedOccupiedVehicle(p),true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true)outputChatBox(" ",root,255,255,0,true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA لقد بدأ الدرفت يمكنك الانطلاق",p,0,255,0,true)outputChatBox(" ",root,255,255,0,true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true)setElementFrozen(getPedOccupiedVehicle(p),false)end endelseendDerby()setElementData(resourceRoot,"map1","no")outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:",root,255,255,0,true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#FFFAAA ! لم يبدأ الدرفت لعدم توفر لاعبين",getRootElement(),255,255,0,true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:",root,255,255,0,true)outputChatBox("#585858[ #610B0BDrift_Mission #585858] #FFFFFF:#610B0B =====================================",root,255,255,0,true)setTimer(newDuel,60000,1)endendsetTimer(newDuel,3000,1)function onStartLoadSpawns ()file = fileOpen("map1.map")localFile = fileOpen("map1.xml")fileWrite(localFile,"")data = fileRead(file,999999)fileWrite(localFile,data)fileClose(localFile)xml = xmlLoadFile("map1.xml")c = 0for i,data in pairs(xmlNodeGetChildren(xml)) doif xmlNodeGetName(data) == "spawnpoint" thenc = c+1v,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"vehicle"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ")table.insert(spawns,{id = c,model = v,x = xx,y = yy,z = zz,rx = rxx,ry = ryy,rz = rzz})endendfor i,data in pairs(xmlNodeGetChildren(xml)) doif xmlNodeGetName(data) == "object" thenm,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"model"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ")object = createObject(m,xx,yy,zz,rxx,ryy,rzz)setElementDimension(object,140)end endendsetTimer(onStartLoadSpawns,3000,1)function endDerby()for i,p in pairs(getElementsByType("player"))doif checkExistPlrOnDuel(p) thenkillPed(p)end endfor i,v in pairs(getElementsByType("vehicle"))doif getElementData(v,"creatorShoter") thendestroyElement(v)end endendsetTimer(function()for i,p in pairs(getElementsByType("player"))dosea(p)resetHan(p)checkVeh(p)checkModel(p)endend,1000,0)function sea(p)if checkExistPlrOnDuel(p) thenx,y,z = getElementPosition(p)if tonumber(z) <= 0 thenkillPed(p)endendendfunction checkVeh(p)if (tonumber(getElementDimension(p)) == 140) and not (isPedInVehicle(p))thenkillPed(p)endendfunction resetHan(p)if checkExistPlrOnDuel(p) thensetVehicleHandling (getPedOccupiedVehicle(p), true )endendfunction checkModel(p)if checkExistPlrOnDuel(p) and isPedInVehicle(p) thenif tonumber(getElementModel(getPedOccupiedVehicle(p))) ~= 411 then killPed(p)end endend---------------------- clientaddEventHandler("onClientRender",getRootElement(),function()if tostring(getElementData(getLocalPlayer(),"onCrossMap1")) == "yes" thensetWorldSpecialPropertyEnabled("aircars", false)setWorldSpecialPropertyEnabled("extrajump", false)setWorldSpecialPropertyEnabled("hovercars", false)endend)local Keys,Dim = {"F1","F2","F3","F4","F5","F6","F7","F9","F10","p","m","j","`","]","[","/","F","enter","shift","x","b","k","o"} , 140 ;addEventHandler ( "onClientKey" , root , function ( key , press ) if ( press and getElementDimension ( localPlayer ) == Dim ) then for k,v in ipairs ( Keys ) do if ( v == key ) then cancelEvent()endendendend ) ;addEvent("openGuiDrift",true)addEventHandler("openGuiDrift",root,function ()guiSetVisible(wnd,true ) showCursor ( true )end)addEventHandler("onClientGUIClick",root, function () if source == ex then if(guiGetVisible(اسم اللوحة) == false)then endguiSetVisible(اسم اللوحة,false)showCursor(false)guiSetInputEnabled(false)end end) لا تبخل علينا ب اللايك ي كبير <3 مبروك حبي 80 لايك 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