Jump to content

طلب فكشن --


Recommended Posts

السلام عليكم

معي بطن عاوز اخلي البتطن ده يشتغر في توقيتات

مثلا الساعة 12 الظهر

يشتغل البوطن و يقعد مده قدرها 5 دقائق و بعد كده

يشتغر بوطن تاني

---------------

التوقيتات مثلا توقيتات / مواعيد الصلاة

و هي

اذان الفجر 3:23

الشروق 5:02

اذان الظهر 11:51

اذان العصر 3:28

اذان المغرب 6:41

اذان العشاء 8:07

Link to comment
addCommandHandler("RealTime",  
function (Player) 
    local Time = getRealTime() -- نجيب جدول الوقت الحقيقي 
    local hour = Time["hour"] -- نجيب الساعة 
    local minute = Time["minute"] -- نجيب الدقيقة 
    outputChatBox(hour..":"..minute, Player, 255, 0, 255, true)--نطلعهم بلشات 
end 
) 

الاندكسات حقت الجدول هنا

:

https://wiki.multitheftauto.com/wiki/GetRealTime

Link to comment

بعرف ان الكود خرطبيتا

صح ولا ايه ؟؟

addCommandHandler("RealTime",  
function (Player) 
    local Time = getRealTime() -- نجيب جدول الوقت الحقيقي 
    local hour = Time["hour"] -- نجيب الساعة 
    local minute = Time["minute"] -- نجيب الدقيقة 
    outputChatBox(hour..":"..minute, Player, 255, 0, 255, true)--نطلعهم بلشات 
function ChangeMyButtonEnabled ( )  
  
        if time [03:23 
                 05:02 
                 11:51 
                 15:29 
                 18:41 
                 20:07] than 
                  
                  
        
        if ( guiGetEnabled (   GUIEditor.button[3] ) == true ) then       
                guiSetEnabled (   GUIEditor.button[4], false )  
         Timer = setTimer(function(  ) 
          
  
        else               
                guiSetEnabled (   GUIEditor.button[4], true )  
        end 
end 
  
MyButtin 1 = guiCreateWindow(32, 181, 137, 34, "قفل الشات :: الاذان ::", false)  
MyButton 2 = guiCreateButton(32, 250, 137, 34, "فتح الشات :: الاذان ::",true,)  
end 
end, 300000, 0) 

Link to comment

سويت لك فنكشن بسيط ..

فقط تحط الساعه و الدقيقة والثانية

function isTime ( hour , minute , second ) 
for i,args in ipairs ( { hour,minute,second } ) do 
if ( type ( args ) ~= "number" ) then  
return false 
end 
end 
if ( second == nil or second < 0 ) then second = 0 end  
local Real = getRealTime() 
local Hours,Minutes,Seconds = Real["hour"],Real["minute"],Real["second"] 
if ( Hours == hour and Minutes == minute and Seconds == second ) then  
return true  
else 
return false 
end 
end 
  
addCommandHandler("checkTime",  
function ( ) 
local Real = getRealTime() 
local Hours,Minutes,Seconds = Real["hour"],Real["minute"],Real["second"] 
if ( isTime ( 12 , 15 , 15 ) ) then  
outputChatBox("Yeah Time is : 12:15:15",255,255,255,true) 
else 
outputChatBox("Time is "..Hours..":"..Minutes..":"..Seconds.."",255,255,255,true) 
end 
end 
) 
  
Link to comment

-- server 
local prrTimes={ 
["fajr"]={h=4, m=0}, 
["duhr"]={h=12, m=0}, 
["asr"]={h=3, m=30}, 
["maghrib"]={h=5, m=25}, 
["isha"]={h=7, m=15}, 
} -- h = ساعة الاذان , m = دقيقة الاذان 
  
  
function loadTime() 
       local time=getRealTime() 
       local h=time.hour 
       local m=time.minute 
       for names, times in pairs( prrTimes ) do 
              local hours, minutes = unpack( times ) 
              if hours == h and minutes == m then 
                      local prayer = names 
                      triggerClientEvent(root, "onPrayerTime", root, prayer, hour, minute) 
                      killTimer( timer ) 
                      setTimer( function () setTimer( function() loadTime() end, 50, 0 ) end, 1000*60*10, 1) 
               end 
        end 
end 
  
timer=setTimer( function () loadTime() end , 50, 0 ) 
  
  
  
  
  
-- client 
  
  
  
  
  
  
window=guiCreateWindow( ... ) 
label=guiCreateLabel( ... ) 
  
  
addEvent("onPrayerTime", true) 
  
function createPrayerWindow() 
       if prayer == "fajr" then 
              guiSetText( label, "حان الآن موعد أذان الفجر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "duhr" then 
              guiSetText( label, "حان الآن موعد أذان الظهر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "asr" then 
              guiSetText( label, "حان الآن موعد أذان العصر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "maghrib" then 
              guiSetText( label, "حان الآن موعد أذان المغرب" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "isha" then 
              guiSetText( label, "حان الآن موعد أذان العشاء" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       end 
end 
  
  
addEventHandler("onPrayerTime", root, createPrayerWindow) 
  
Link to comment
-- server 
local prrTimes={ 
["fajr"]={h=4, m=0}, 
["duhr"]={h=12, m=0}, 
["asr"]={h=3, m=30}, 
["maghrib"]={h=5, m=25}, 
["isha"]={h=7, m=15}, 
} -- h = ساعة الاذان , m = دقيقة الاذان 
  
  
function loadTime() 
       local time=getRealTime() 
       local h=time.hour 
       local m=time.minute 
       for names, times in pairs( prrTimes ) do 
              local hours, minutes = unpack( times ) 
              if hours == h and minutes == m then 
                      local prayer = names 
                      triggerClientEvent(root, "onPrayerTime", root, prayer, hour, minute) 
                      killTimer( timer ) 
                      setTimer( function () setTimer( function() loadTime() end, 50, 0 ) end, 1000*60*10, 1) 
               end 
        end 
end 
  
timer=setTimer( function () loadTime() end , 50, 0 ) 
  
  
  
  
  
-- client 
  
  
  
  
  
  
window=guiCreateWindow( ... ) 
label=guiCreateLabel( ... ) 
  
  
addEvent("onPrayerTime", true) 
  
function createPrayerWindow() 
       if prayer == "fajr" then 
              guiSetText( label, "حان الآن موعد أذان الفجر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "duhr" then 
              guiSetText( label, "حان الآن موعد أذان الظهر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "asr" then 
              guiSetText( label, "حان الآن موعد أذان العصر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "maghrib" then 
              guiSetText( label, "حان الآن موعد أذان المغرب" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "isha" then 
              guiSetText( label, "حان الآن موعد أذان العشاء" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       end 
end 
  
  
addEventHandler("onPrayerTime", root, createPrayerWindow) 
  

تمام

طيب انا دلوقتي عامل لوحة تقفل الشات و تفتحو

الوحة شغالة تمام بس ازاي اضيف الكود

اخليه يشغل بطن 3 الي هو قفل الشات للاذان

و لما يخلص الوقت المحدد يفتح بطن 4

الي هو فتح الشات للاذان

صورة الوحة

1463221704141.png

http://store2.up-00.com/2016-05/1463221704141.png

Link to comment

انا صانع لوحة تفتح الشات و تقفل شوف الصورة بس عاوز اوقات الاذا الي انت عطتهوني كود

الكود الي انت ادتهوني عاوزو يشتغل علي زر قفل شات الاذان

يعني

لما تصير الساعة 12

يشغل بطن 3 الي هو قفل شات الاذان

و يكت الي في الكود

الي هو حان الان اذان الظهر

فهمت ؟ #

Link to comment

حد يفهم عليه

انا عامل مود قفل الشات و المود شغال بيقفل و كل شئ تمام

بس انا عامل زرين 2 بطن

و احد يقفل الشات تبع الاذان

و التاني يفتحو

كيف اضيف الكود الي فوق للزر الاول بتاع قفل الشات لللاذان ؟؟

Link to comment
حد يفهم عليه

انا عامل مود قفل الشات و المود شغال بيقفل و كل شئ تمام

بس انا عامل زرين 2 بطن

و احد يقفل الشات تبع الاذان

و التاني يفتحو

كيف اضيف الكود الي فوق للزر الاول بتاع قفل الشات لللاذان ؟؟

استعمل الداتا مثل ما قالك

#J2mes

setElementData 
getElementData 

Link to comment
-- server 
local prrTimes={ 
["fajr"]={h=4, m=0}, 
["duhr"]={h=12, m=0}, 
["asr"]={h=3, m=30}, 
["maghrib"]={h=5, m=25}, 
["isha"]={h=7, m=15}, 
} -- h = ساعة الاذان , m = دقيقة الاذان 
  
  
function loadTime() 
       local time=getRealTime() 
       local h=time.hour 
       local m=time.minute 
       for names, times in pairs( prrTimes ) do 
              local hours, minutes = unpack( times ) 
              if hours == h and minutes == m then 
                      local prayer = names 
                      triggerClientEvent(root, "onPrayerTime", root, prayer, hour, minute) 
                      killTimer( timer ) 
                      setTimer( function () setTimer( function() loadTime() end, 50, 0 ) end, 1000*60*10, 1) 
               end 
        end 
end 
  
timer=setTimer( function () loadTime() end , 50, 0 ) 
  
  
  
  
  
-- client 
  
  
  
  
  
  
window=guiCreateWindow( ... ) 
label=guiCreateLabel( ... ) 
  
  
addEvent("onPrayerTime", true) 
  
function createPrayerWindow() 
       if prayer == "fajr" then 
              guiSetText( label, "حان الآن موعد أذان الفجر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "duhr" then 
              guiSetText( label, "حان الآن موعد أذان الظهر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "asr" then 
              guiSetText( label, "حان الآن موعد أذان العصر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "maghrib" then 
              guiSetText( label, "حان الآن موعد أذان المغرب" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "isha" then 
              guiSetText( label, "حان الآن موعد أذان العشاء" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       end 
end 
  
  
addEventHandler("onPrayerTime", root, createPrayerWindow) 
  

كل الي اقدر اقولو دلوقتي

عاوز الكود الي فوق لما يشتغل يقفل الشات

يخلي الكونسول بس هو الي يتكلم

و لما تخلص المدة المحددة في المود

يفتح الشات تانني

Link to comment

مساعده ##

اوز الكود ده اول ما اشغل المود يشتغل

+

يقفل الشات

-- server 
local prrTimes={ 
["fajr"]={h=4, m=0}, 
["duhr"]={h=12, m=0}, 
["asr"]={h=3, m=30}, 
["maghrib"]={h=5, m=25}, 
["isha"]={h=7, m=15}, 
} -- h = ساعة الاذان , m = دقيقة الاذان 
  
  
function loadTime() 
       local time=getRealTime() 
       local h=time.hour 
       local m=time.minute 
       for names, times in pairs( prrTimes ) do 
              local hours, minutes = unpack( times ) 
              if hours == h and minutes == m then 
                      local prayer = names 
                      triggerClientEvent(root, "onPrayerTime", root, prayer, hour, minute) 
                      killTimer( timer ) 
                      setTimer( function () setTimer( function() loadTime() end, 50, 0 ) end, 1000*60*10, 1) 
               end 
        end 
end 
  
timer=setTimer( function () loadTime() end , 50, 0 ) 
  
  
  
  
  
-- client 
  
  
  
  
  
  
window=guiCreateWindow( ... ) 
label=guiCreateLabel( ... ) 
  
  
addEvent("onPrayerTime", true) 
  
function createPrayerWindow() 
       if prayer == "fajr" then 
              guiSetText( label, "حان الآن موعد أذان الفجر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "duhr" then 
              guiSetText( label, "حان الآن موعد أذان الظهر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "asr" then 
              guiSetText( label, "حان الآن موعد أذان العصر" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "maghrib" then 
              guiSetText( label, "حان الآن موعد أذان المغرب" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       elseif prayer == "isha" then 
              guiSetText( label, "حان الآن موعد أذان العشاء" ) 
              guiSetVisible( window, true ) 
              setTimer(guiSetVisible, 1000*60*5, 1, window, false) 
       end 
end 
  
  
addEventHandler("onPrayerTime", root, createPrayerWindow) 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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