-
Posts
1,992 -
Joined
-
Last visited
-
Days Won
4
Everything posted by 3NAD
-
احذف ذا السطرين GUIEditor_Image[1] = guiCreateStaticImage(33,32,104,66,"images/1.png",false,wel) wel1 = guiCreateButton(32,100,104,34,"~~Wheels~~1",false,wel)
-
local markerCH = createMarker ( 1535.5216064453, -1685.9595947266, 12.55108, "cylinder", 1.4, 255, 255, 255, 255 ); local _closeTime = 10 local _openTime = 2 local _timers = { }; addEventHandler( "onMarkerHit", markerCH, function ( player ) if getElementType ( player ) == "player" then if not isPedInVehicle ( player ) then local _team = getPlayerTeam ( player ); if _team then if _team == getTeamFromName ( "Police" ) then if checkMarkerData ( source ) == "Lock" then outputChatBox ( "Marker Locked", player, 255, 0, 0, true ); return false end setElementInterior ( player, 15, 2215.1999511719, -1150.5999755859, 1025.8000488281 ); setElementDimension ( player, 15 ); end end end end end , false ); checkMarkerData = function ( marker ) if isElement ( marker ) then local Data = getElementData ( marker, "status" ) if Data then return Data end return "n/a" end end changeMarkerValue = function ( marker, value ) if isElement ( marker ) then if isTimer ( _timers [ marker ] ) then killTimer ( _timers [ marker ] ) end setElementData ( marker, "status", value ) if tostring ( value ) == "UnLock" then outputChatBox ( "Marker Opened", root, 255, 255, 0, true ) _timers [ marker ] = setTimer ( changeMarkerValue, _openTime* 60* 1000, 1, markerCH, "Lock" ) elseif tostring ( value ) == "Lock" then outputChatBox ( "Marker Closed", root, 255, 255, 0, true ) _timers [ marker ] = setTimer ( changeMarkerValue, _closeTime* 60* 1000, 1, markerCH, "UnLock" ) end end end addEventHandler ( "onResourceStart", resourceRoot, function ( ) changeMarkerValue ( markerCH, "Lock" ) _timers [ markerCH ] = setTimer ( changeMarkerValue, _closeTime* 60* 1000, 1, markerCH, "UnLock" ) end )
-
_timers [ markerCH ] = setTimer ( changeMarkerValue, _openTime* 60* 1000, 1, markerCH, "UnLock" )
-
ماشاء الله عليك ذكي طيب صلحها ولك الأجر
-
لم يتم التجربة local markerCH = createMarker( 1535.5216064453, -1685.9595947266, 12.55108, "cylinder", 1.4, 255, 255, 255, 255 ); local _closeTime = 10 local _openTime = 2 local _timers = { }; addEventHandler( "onPlayerMarkerHit", root, function ( marker ) if marker == markerCH and not isPedInVehicle( source ) then local _team = getPlayerTeam( source ); if _team then if getTeamName( _team ) == "اسم الفريق" then if checkMarkerData then if tostring ( checkMarkerData ) == "Lock" then outputChatBox ( "Marker Locked", source, 255, 0, 0, true ); return false end end setElementInterior ( source, 15, 2215.1999511719, -1150.5999755859, 1025.8000488281 ); setElementDimension ( source, 15 ); end end end end ); checkMarkerData = function ( marker ) if isElement ( marker ) then local Data = getElementData ( marker, "status" ) if Data then return Data end return false end end changeMarkerValue = function ( marker, value ) if isElement ( marker ) then if checkMarkerData then if tostring ( checkMarkerData ) ~= tostring ( value ) then setElementData ( marker, "status", value ) if tostring ( value ) == "UnLock" then if isTimer ( _timers [ marker ] ) then killTimer ( _timers [ marker ] ) end _timers [ marker ] = setTimer ( changeMarkerValue, _openTime* 60* 1000, 1, markerCH, "Lock" ) elseif tostring ( value ) == "Lock" then if isTimer ( _timers [ marker ] ) then killTimer ( _timers [ marker ] ) end _timers [ marker ] = setTimer ( changeMarkerValue, _closeTime* 60* 1000, 1, markerCH, "UnLock" ) end return true end end setElementData ( marker, "status", value ) end end addEventHandler ( "onResourceStart", resourceRoot, function ( ) changeMarkerValue ( markerCH, "Lock" ) _timers [ marker ] = setTimer ( changeMarkerValue, _openTime* 60* 1000, 1, markerCH, "UnLock" ) end )
-
لم يتم التجربة changeImage = function ( value ) if isTimer ( showTimer ) then killTimer ( showTimer ) guiSetVisible ( gui, false ) end if tostring ( value ) == "DisableCH" then gui = DisableCH show = "EnableCH" elseif tostring ( value ) == "EnableCH" then gui = EnableCH show = "DisableCH" end if isElement ( gui ) then if not guiGetVisible ( gui ) then guiSetVisible ( gui, true ) showTimer = setTimer ( guiSetVisible, 1000, 1, gui, false ) end end end
-
من الطبيعي ان يجيك لاق .. لو تلاحظ ان قيمة تكرار تشغيل الوظيفة هو 50 يعني أقل من جزء من الثانية
-
لم يتم التجربة bg = guiCreateStaticImage(760, 1025, 400, 50, "images/blank.png", false) DisableCH = guiCreateStaticImage(760, 1025, 400, 50, "images/CHD.png", false) EnableCH = guiCreateStaticImage(760, 1025, 400, 50, "images/CHE.png", false) guiSetVisible ( DisableCH, false ) guiSetVisible ( EnableCH, false ) show = "DisableCH" changeImage = function ( value ) if not isTimer ( showTimer ) then if tostring ( value ) == "DisableCH" then gui = DisableCH show = "EnableCH" elseif tostring ( value ) == "EnableCH" then gui = EnableCH show = "DisableCH" end if isElement ( gui ) then if not guiGetVisible ( gui ) then guiSetVisible ( gui, true ) showTimer = setTimer ( guiSetVisible, 1000, 1, gui, false ) end end end end bindKey ( "f1", "down", function ( ) changeImage ( show ) end ) --[[ function showHide ( ) if guiGetVisible ( bg ) == true then showCursor(false) guiSetVisible( bg ,false) guiSetVisible( DisableCH ,false) guiSetVisible( EnableCH ,false) else outputChatBox("CarHide Enabled", 255,136,0, true) end end ]]
-
من الطبيعي ان يجيك لاق .. لو تلاحظ ان قيمة تكرار تشغيل الوظيفة هو 50 يعني أقل من جزء من الثانية
-
addCommandHandler ( "Admins", function ( player, cmd, text ) if text then local playerAccount = getPlayerAccount ( player ) if playerAccount and not isGuestAccount ( playerAccount ) then if isObjectInACLGroup ( "user."..getAccountName ( playerAccount ), aclGetGroup ( "Admin" ) ) then for _, v in ipairs ( getElementsByType ( "player" ) ) do local playersAccount = getPlayerAccount ( v ) if playersAccount and not isGuestAccount ( playersAccount ) then if isObjectInACLGroup ( "user."..getAccountName ( playersAccount ), aclGetGroup ( "Admin" ) ) then outputChatBox ( getPlayerName ( player )..": "..text, v ) end end end end end end end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, v in ipairs ( getElementsByType ( "player" ) ) do bindKey ( v, "u", "down", "chatbox", "Admins" ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "u", "down", "chatbox", "Admins" ) end )
-
local marker = createMarker ( .. ) -- الحين الماركر ماله داتا ... يعني كأنه صآير كذآ -- getElementData ( ... ) == "" -- false او -- ماله قيمة setElementData ( marker, "stats", "open" ) -- ندخل له قيمة -- setElementData ( element, "data name", value ) -- stats اسم الداتا اللي حفظنا فيه المعلومة هو function onHit ( hitElement ) if source == marker then -- أثبات ان عنصر الإيفنت هو الماركر اللي مساع if getElementType ( hitElement ) == "player" then -- getElementData ( element, "data name" ) -- جلب داتا مخزن من قبل local markerData = getElementData ( marker, "stats" ) if markerData then -- إثبات وجود الداتا if markerData == "lock" then -- إثبات ان الداتا تطابق كلمة لوك -- حط اي شيء تبي من اكواد return false -- انهي الوظيفة بطلنا ماعاد نبي شيء elseif markerData == "open" then -- إثبات ان الداتا تطابق كلمة اوبن ------- اكواد end end end end end addEventHandler ( "onMarkerHit", root, onHit ) function changeData ( ) -- الوظيفة هذي مالها اي فايدة بدون تآيمر او ايفنت او اي شيء يشغلها setElementData ( marker, "stats", "open" ) setTimer ( setElementData, 1* 60* 1000, 1, marker, "stats", "lock" ) -- نعين تآيمر داخلي يشتغل مرة وحدة بعد مرور دقيقة من تشغيل الوظيفة end setTimer ( changeData, 5* 60* 1000, 0 ) -- مؤقت تكرار تشغل الوظيفة المحددة تقدر تحول الوقت عن طريق الكود التالي -- الوظيفة ليست من صنعي getTimeByMilliSeconds = function ( number ) if ( number ) then sec = math.fmod ( math.floor( number / 1000 ), 60 ) min = math.floor( math.floor( number / 1000 ) / 60 ) return string.format ( '%02d:%02d', min, sec ) end end مثال علاها : timer = setTimer ( function ( ) end, 60000, 1 ) local remaining, _, __ = getTimerDetails ( timer ) outputChatBox ( "Remaining Time: "..getTimeByMilliSeconds ( remaining ), root, 255, 255, 0 )
-
تقدر تشرط علآه إن كان التآيمر موجود if isTimer ( .... ) then -- إذا كان التآيمر موجود -- نفذ التالي طآل عمرك else -- إذا مآكان التآيمر موجود outputChatBox ( "مابه تآيمر يآلطيب" ) -- end -- إنهي الشرط
-
بالعربي الفصيح ........... %القيمة مو إجبآرية تحط كلمة وهالكلمة لآزم 100 تقفل الماركر .. false / true بالردود اللي فوق اختاروا كلمة انا بختآر شيء ثاني ........ كيفي setElementData ( marker, "MarkerStats", "Locked" ) if getElementData ( marker, "MarkerStats" ) == "Locked" then return false -- إلغي يا عزيزي end setElementData ( marker, "MarkerStats", "Not Locked" ) if getElementData ( marker, "MarkerStats" ) == "Not Locked" then setElementPosition ( ....... ) -- كمل يا عزيزي end
-
تقدر تقفل عمل الماركر باستخدام الداتا if getElementData ( marker, ...... ) then return false end والمؤقت اللي هو التايمر setTimer ( function ( ) setElementData ( marker, ...... ) end , 10000, 1 )
-
فنكشن جديد getMaps ( type ) - type = "DM" or "DD" .... etc Enad = { }; getMaps = function ( value ) if value then Enad[value] = { } for i, v in ipairs ( getResources ( ) ) do local resourceName = getResourceName ( v ) if string.find ( string.upper ( resourceName ), "["..value.."]", 1, true ) then table.insert ( Enad[value], { MapName = resourceName } ) end end return Enad[value] end end Ex.: addEventHandler ( "onResourceStart", resourceRoot, function ( ) local Maps = getMaps ( "DM" ) if #Maps > 0 then for i = 1, #Maps do if Maps [ i ] then outputChatBox ( Maps [ i ].MapName, root, 255, 255, 0, true ) end end else outputChatBox ( "* There are no maps", root, 255, 0, 0, true ) end end )
-
لـ تفآدي الأخطاء .. veh = "vehicle" setTimer ( function ( ) for k, v in ipairs ( getElementsByType ( veh ) ) do if isVehicleDamageProof ( v ) ~= true then setVehicleDamageProof ( v, true ) end end end , 20000, 0 )
-
كيف تقآرن اسعار ديلوكس بـأسعار سيرفرات خاصة الـ 250 لاعب = حوالي 125 ريال تقريباً الـ 125 ريال ممكن تجيب لك خادم صغير وزين إذا يستحمل الـ 70 لاعب Delux-host MTA Servers : 12 $ 2.50 24 $ 4.99 36 $ 7.49 50 $ 8.13 75 $ 10.40 100 $ 11.70 150 $ 13.00 200 $ 26.00 250 $ 32.50 VPS إستضافة http://www.hostv.com/packages/cloudvps Ram : 1.5 GB $ 30.00 Ram : 2 GB $ 40.00 VPS إستضافة http://vps.net/cloud-servers Ram : 1.5 GB $ 34.27 Ram : 2 GB $ 68.54 + ينقل إلى قسم الخوادم
-
لم يتم التجربة .. Images = { "سبحان الله"; "والحمد لله"; -- " اسم ملف الصورة بدون الصيغة " }; showImage = function ( value ) if value then local image = value..".png" guiStaticImageLoadImage ( Image, image ) end end Image = guiCreateImage ( ........ ) setTimer ( showImage, 5000, 0, Images [ math.random ( #Images ) ] )
-
؟ if بدون أداة الشرط else كيف تستخدم
-
سو فنكشن يفجر بإستخدام الإحداثيات العشوائية .. بدون ايفنت ولا شيء مثل كذا function explode ( ) -- اكواد -- اكود end والتآيمر يكون خآرجي setTimer ( explode, ............., ..... )
-
تقدر تحول الجزء من الثانية إلى دقيقة بالشكل التالي minutes = 10 setTimer ( xx, minutes* 60* 1000, 0 ) يعني انك تضرب 10 × 60 × 1000
-
التايمر واحد والإحداثيات متعددة Ex.: Pos = { [1] = { 50, 50, 10 }; [2] = { 140, 520, 30 }; [3] = { x, y, z }; }; tableSize = #Pos -- حجم الجدول ممكن يكون رقم 3 ممكن يكون 2 على حسب القيم اللي انت حاطهم بالجدول random = math.random ( tableSize ) -- تعيين قيمة عشوائية من الرقم اللي طلعناه من حجم الجدول randomValue = Pos [ random ] -- آخر شيء تعيين معرف لـ القيمة المحددة من الجدول عن طريق الأكواد السابقة ------------------- النتائج randomValue[1] -- x الإحداثي randomValue[2] -- y الإحداثي randomValue[3] -- z الإحداثي
-
هذا قسم لـ التعليم مآني معطيك شيء كآمل .... if guiGetVisible ( myWindow ) then -- إذا كانت النافذة مرئية guiSetVisible ( myWindow, false ) -- قم بإخفائها end ماني شايف شيء صعب .. انت تسوي شرط لو كانت النافذة مفتوحة اخفيها اظن الكود جاهز مجرد تضيف اسماء النوافذ وتمشي امورك addEventHandler ( "onClientGUIClick", root, function ( ) if source == stats then -- إذا كان عنصر الإيفنت == زر ستاتس افعل التالي if guiGetVisible ( Carshop ) then -- ظاهرة افعل التالي Carshop لما تكون النافذة guiSetVisible ( Carshop, false ) -- Carshop قم بـ إخفاء النافذة end -- إنهاء شرط الإظهار guiSetVisible ( Stats, true ) -- إظهار نافذة ستاتس guiBringToFront ( Stats ) -- جعل النافذة في المقدمة elseif ( source == car ) then -- ولما يكون ( عنصر الإيفنت == زر كار ) افعل التالي if guiGetVisible ( Stats ) then guiSetVisible ( Stats, false ) end guiSetVisible ( Carshop, true ) guiBringToFront ( Carshop ) elseif source == ......... then -- مثل السابق -- وظايف تريد تطبيقها end end )