|M.r|LooFe| Posted October 4, 2017 Share Posted October 4, 2017 السلام عليكم شباب كيفكم عندي مود الساعات بسيرفري يلي هو حق مستر مودي الاونر الثاني بالغلط وزع على الكل 9999999999999ساعه لمهم مو عارف كيف احذفهم يوم جربت احذفهم صارو -999999999999999 يا ريت تقولولي كيف بأسرع وقت ممكن انا موقف المود Link to comment
|M.r|LooFe| Posted October 4, 2017 Author Share Posted October 4, 2017 51 minutes ago, Talis said: ههههه جرب حط ٠ جربت هس ما ظبطت Link to comment
|M.r|LooFe| Posted October 4, 2017 Author Share Posted October 4, 2017 1 minute ago, #,+( _xiRoc[K]; > said: اطرح اكواد مود الساعات يخي مود مستر مودي هو نفسه Link to comment
Rockyz Posted October 4, 2017 Share Posted October 4, 2017 اقلك اطرح مود الساعات ماقصد توزيع الساعات Link to comment
|M.r|LooFe| Posted October 4, 2017 Author Share Posted October 4, 2017 1 hour ago, #,+( _xiRoc[K]; > said: اقلك اطرح مود الساعات ماقصد توزيع الساعات وش مود الساعات ؟ اخي انا ظبطت المود حطيط غيره لكنننن في مشكلةةةةةةةةةةة رجاءا حلللل يوم اسحب من الكل ساعات يكرر ويوم اعطيهم ساعات يكرر ويوم ارستر لمود الساعات تروح وانا ما ابي هذا الشي يصير ذا الكود exports.scoreboard:addScoreboardColumn('PlayTime') addEvent("addTime",true) addEvent("removeTime",true) addEvent("ToServer",true) local t = { } local w = {} addEventHandler("ToServer",root, function (word,get,time) if word and tonumber(get) and tonumber(time) then table.insert(w,{word,get}) setTimer(function () for _,v in ipairs(w) do if v[1] == word and v[2] == get then table.remove(w,i) end end end,time*60*60*1000,1) end end ) addEventHandler("onConsole",root, function (msg) for _,v in ipairs(w) do if msg == v[1] then local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then if not getAccountData ( playeraccount, "time-"..msg) then addPlayerTime(source,v[2]) setAccountData( playeraccount, "time-"..msg,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA مبروك تم اعطائك ساعات", source, 0, 255, 0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) else outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA لقد قمت بالاستلام من قبل", source, 255, 0, 0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) end end end end end ) addEventHandler("addTime",root, function (to,time) if to == "all" then for _,v in ipairs(getElementsByType("player")) do addPlayerTime(v,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم توزيع "..time.." ساعه لجميع اللاعبين",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end else plr = getPlayerFromName(to) if plr then addPlayerTime(plr,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA لقد تمت اضافة "..time.." لحسابك",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end end end ) addEventHandler("removeTime",root, function (to,time) if to == "all" then for _,v in ipairs(getElementsByType("player")) do removePlayerTime(v,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم حذف "..time.." ساعة من جمييع الاعبين",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end else plr = getPlayerFromName(to) if plr then removePlayerTime(plr,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم حذف "..time.." ساعه من حسابك ",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end end end ) function addPlayerTime(plr,time) time = math.floor(time) t[plr]['hour'] = tonumber(t[plr]['hour'] or 0) + time end function removePlayerTime(plr,time) time = math.floor(time) t[plr]['hour'] = tonumber(t[plr]['hour'] or 0) - time end function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "PlayTime", tostring( hour )..':'..tostring( min )..':'..tostring( sec ) ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'PlayTime' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "PlayTime-hour", tostring(hour) ) setAccountData ( playeraccount, "PlayTime-min", tostring(min) ) setAccountData ( playeraccount, "PlayTime-sec", tostring(sec) ) setAccountData ( playeraccount, "PlayTime", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "PlayTime" ) local hou = getAccountData ( playeraccount, "PlayTime-hour") local min = getAccountData ( playeraccount, "PlayTime-min") local sec = getAccountData ( playeraccount, "PlayTime-sec") if ( time ) then setElementData ( source, "PlayTime", time ) t[ source ]["hour"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "PlayTime",0 ) setAccountData ( playeraccount, "PlayTime",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) --[[ local PlayTimeSerialsTable_X = { --- سريالات اللي يقدرو يفتحو لوحة توزيع الساعات ["C508418E676002A7C652EE02C14D4C02"] = true, ["5B84916F1B6B09A907C5FD981566CB42"] = true, } addCommandHandler("لوحة",-- هنا كلمة فتح اللوحة function(player) local serial = getPlayerSerial(player) if PlayTimeSerialsTable_X[serial] then triggerClientEvent( player, 'PlayTime:OpenPanel', root, true ); else outputChatBox('',player,255,0,0,true) end end ) ]] addCommandHandler("لوحة",-- الكلمة من اف8 function (player) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)),aclGetGroup("Console")) then-- القروب triggerClientEvent(player,"PlayTime:OpenPanel",player) else outputChatBox("",player,255,0,0) end end ) Link to comment
MR.StoRm Posted October 4, 2017 Share Posted October 4, 2017 51 minutes ago, |M.r|LooFe| said: اخي انا ظبطت المود حطيط غيره لكنننن في مشكلةةةةةةةةةةة رجاءا حلللل يوم اسحب من الكل ساعات يكرر ويوم اعطيهم ساعات يكرر ويوم ارستر لمود الساعات تروح وانا ما ابي هذا الشي يصير ذا الكود exports.scoreboard:addScoreboardColumn('PlayTime') addEvent("addTime",true) addEvent("removeTime",true) addEvent("ToServer",true) local t = { } local w = {} addEventHandler("ToServer",root, function (word,get,time) if word and tonumber(get) and tonumber(time) then table.insert(w,{word,get}) setTimer(function () for _,v in ipairs(w) do if v[1] == word and v[2] == get then table.remove(w,i) end end end,time*60*60*1000,1) end end ) addEventHandler("onConsole",root, function (msg) for _,v in ipairs(w) do if msg == v[1] then local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then if not getAccountData ( playeraccount, "time-"..msg) then addPlayerTime(source,v[2]) setAccountData( playeraccount, "time-"..msg,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA مبروك تم اعطائك ساعات", source, 0, 255, 0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) else outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA لقد قمت بالاستلام من قبل", source, 255, 0, 0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) end end end end end ) addEventHandler("addTime",root, function (to,time) if to == "all" then for _,v in ipairs(getElementsByType("player")) do addPlayerTime(v,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم توزيع "..time.." ساعه لجميع اللاعبين",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end else plr = getPlayerFromName(to) if plr then addPlayerTime(plr,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA لقد تمت اضافة "..time.." لحسابك",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end end end ) addEventHandler("removeTime",root, function (to,time) if to == "all" then for _,v in ipairs(getElementsByType("player")) do removePlayerTime(v,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم حذف "..time.." ساعة من جمييع الاعبين",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end else plr = getPlayerFromName(to) if plr then removePlayerTime(plr,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم حذف "..time.." ساعه من حسابك ",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end end end ) function addPlayerTime(plr,time) time = math.floor(time) t[plr]['hour'] = tonumber(t[plr]['hour'] or 0) + time end function removePlayerTime(plr,time) time = math.floor(time) t[plr]['hour'] = tonumber(t[plr]['hour'] or 0) - time end function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "PlayTime", tostring( hour )..':'..tostring( min )..':'..tostring( sec ) ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'PlayTime' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "PlayTime-hour", tostring(hour) ) setAccountData ( playeraccount, "PlayTime-min", tostring(min) ) setAccountData ( playeraccount, "PlayTime-sec", tostring(sec) ) setAccountData ( playeraccount, "PlayTime", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "PlayTime" ) local hou = getAccountData ( playeraccount, "PlayTime-hour") local min = getAccountData ( playeraccount, "PlayTime-min") local sec = getAccountData ( playeraccount, "PlayTime-sec") if ( time ) then setElementData ( source, "PlayTime", time ) t[ source ]["hour"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "PlayTime",0 ) setAccountData ( playeraccount, "PlayTime",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) --[[ local PlayTimeSerialsTable_X = { --- سريالات اللي يقدرو يفتحو لوحة توزيع الساعات ["C508418E676002A7C652EE02C14D4C02"] = true, ["5B84916F1B6B09A907C5FD981566CB42"] = true, } addCommandHandler("لوحة",-- هنا كلمة فتح اللوحة function(player) local serial = getPlayerSerial(player) if PlayTimeSerialsTable_X[serial] then triggerClientEvent( player, 'PlayTime:OpenPanel', root, true ); else outputChatBox('',player,255,0,0,true) end end ) ]] addCommandHandler("لوحة",-- الكلمة من اف8 function (player) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)),aclGetGroup("Console")) then-- القروب triggerClientEvent(player,"PlayTime:OpenPanel",player) else outputChatBox("",player,255,0,0) end end ) try : exports.scoreboard:addScoreboardColumn('PlayTime') addEvent("addTime",true) addEvent("removeTime",true) addEvent("ToServer",true) local t = { } local w = {} addEventHandler("ToServer",root, function (word,get,time) if word and tonumber(get) and tonumber(time) then table.insert(w,{word,get}) setTimer(function () for _,v in ipairs(w) do if v[1] == word and v[2] == get then table.remove(w,i) end end end,time*60*60*1000,1) end end ) addEventHandler("onConsole",root, function (msg) for _,v in ipairs(w) do if msg == v[1] then local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then if not getAccountData ( playeraccount, "time-"..msg) then addPlayerTime(source,v[2]) setAccountData( playeraccount, "time-"..msg,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم توزيع "..v[2].." لجميع اللاعبين ", source, 0, 255, 0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) else outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA لقد قمت بالاستلام من قبل", source, 255, 0, 0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) end else outputChatBox ( 'يجب عليك التسجيل اولا' ) end end end end ) addEventHandler("addTime",root, function (to,time) if to == "all" then for _,v in ipairs(getElementsByType("player")) do addPlayerTime(v,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",v,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم توزيع "..time.." ساعه لجميع اللاعبين",v,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",v,255,255,0,true) end else local plr = getPlayerFromName(to) if plr then addPlayerTime(plr,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA لقد تمت اضافة "..time.." لحسابك",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end end end ) addEventHandler("removeTime",root, function (to,time) if to == "all" then for _,v in ipairs(getElementsByType("player")) do removePlayerTime(v,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",v,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم حذف "..time.." ساعة من جمييع الاعبين",v,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",v,255,255,0,true) end else local plr = getPlayerFromName(to) if plr then removePlayerTime(plr,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم حذف "..time.." ساعه من حسابك ",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end end end ) function addPlayerTime(plr,time) time = math.floor(time) t[plr]['hour'] = tonumber(t[plr]['hour'] or 0) + time end function removePlayerTime(plr,time) time = math.floor(time) t[plr]['hour'] = tonumber(t[plr]['hour'] or 0) - time end function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "PlayTime", tostring( hour )..':'..tostring( min )..':'..tostring( sec ) ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'PlayTime' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "PlayTime-hour", tostring(hour) ) setAccountData ( playeraccount, "PlayTime-min", tostring(min) ) setAccountData ( playeraccount, "PlayTime-sec", tostring(sec) ) setAccountData ( playeraccount, "PlayTime", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "PlayTime" ) local hou = getAccountData ( playeraccount, "PlayTime-hour") local min = getAccountData ( playeraccount, "PlayTime-min") local sec = getAccountData ( playeraccount, "PlayTime-sec") if ( time ) then setElementData ( source, "PlayTime", time ) t[ source ]["hour"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "PlayTime",0 ) setAccountData ( playeraccount, "PlayTime",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) addEventHandler ( "onPlayerLogout", root, function ( acc ) local sValue = getElementData( source,'PlayTime' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( acc, "PlayTime-hour", tostring(hour) ) setAccountData ( acc, "PlayTime-min", tostring(min) ) setAccountData ( acc, "PlayTime-sec", tostring(sec) ) setAccountData ( acc, "PlayTime", tostring(sValue) ) t[ source ]["hour"] = 0 t[ source ]["min"] = 0 t[ source ]["sec"] = 0 end ) addEventHandler("onResourceStart", resourceRoot, function () for k,v in ipairs ( getElementsByType ( "player" ) ) do if not ( isGuestAccount ( getPlayerAccount ( v ) ) ) then if ( getAccountData ( getPlayerAccount ( v ), "PlayTime" ) ) then local hou = getAccountData ( getPlayerAccount ( v ), "PlayTime-hour") local min = getAccountData ( getPlayerAccount ( v ), "PlayTime-min") local sec = getAccountData ( getPlayerAccount ( v ), "PlayTime-sec") if not ( t [ v ] ) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ]["hour"] = tonumber(hou) t[ v ]["min"] = tonumber(min) t[ v ]["sec"] = tonumber(sec) end end end end) addEventHandler("onResourceStop", resourceRoot, function () for k,v in ipairs ( getElementsByType ( "player" ) ) do if not ( isGuestAccount ( getPlayerAccount ( v ) ) ) then local sValue = getElementData( v,'PlayTime' ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) local min = tonumber( t[ v ][ 'min' ] or 0 ) local sec = tonumber( t[ v ][ 'sec' ] or 0 ) setAccountData ( getPlayerAccount ( v ), "PlayTime-hour", tostring(hour) ) setAccountData ( getPlayerAccount ( v ), "PlayTime-min", tostring(min) ) setAccountData ( getPlayerAccount ( v ), "PlayTime-sec", tostring(sec) ) setAccountData ( getPlayerAccount ( v ), "PlayTime", tostring(sValue) ) end end end) --[[ local PlayTimeSerialsTable_X = { --- سريالات اللي يقدرو يفتحو لوحة توزيع الساعات ["C508418E676002A7C652EE02C14D4C02"] = true, ["5B84916F1B6B09A907C5FD981566CB42"] = true, } addCommandHandler("لوحة",-- هنا كلمة فتح اللوحة function(player) local serial = getPlayerSerial(player) if PlayTimeSerialsTable_X[serial] then triggerClientEvent( player, 'PlayTime:OpenPanel', root, true ); else outputChatBox('',player,255,0,0,true) end end ) ]] addCommandHandler("لوحة",-- الكلمة من اف8 function (player) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)),aclGetGroup("Console")) then-- القروب triggerClientEvent(player,"PlayTime:OpenPanel",player) else outputChatBox("",player,255,0,0) end end ) Link to comment
|M.r|LooFe| Posted October 4, 2017 Author Share Posted October 4, 2017 18 hours ago, MR.StoRm said: try : exports.scoreboard:addScoreboardColumn('PlayTime')addEvent("addTime",true)addEvent("removeTime",true)addEvent("ToServer",true)local t = { }local w = {}addEventHandler("ToServer",root,function (word,get,time) if word and tonumber(get) and tonumber(time) thentable.insert(w,{word,get})setTimer(function () for _,v in ipairs(w) do if v[1] == word and v[2] == get then table.remove(w,i) end endend,time*60*60*1000,1)endend)addEventHandler("onConsole",root, function (msg) for _,v in ipairs(w) do if msg == v[1] then local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then if not getAccountData ( playeraccount, "time-"..msg) then addPlayerTime(source,v[2]) setAccountData( playeraccount, "time-"..msg,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم توزيع "..v[2].." لجميع اللاعبين ", source, 0, 255, 0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) else outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA لقد قمت بالاستلام من قبل", source, 255, 0, 0,true) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",source,255,255,0,true) end else outputChatBox ( 'يجب عليك التسجيل اولا' ) end end end end )addEventHandler("addTime",root, function (to,time) if to == "all" then for _,v in ipairs(getElementsByType("player")) do addPlayerTime(v,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",v,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم توزيع "..time.." ساعه لجميع اللاعبين",v,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",v,255,255,0,true) end else local plr = getPlayerFromName(to) if plr then addPlayerTime(plr,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA لقد تمت اضافة "..time.." لحسابك",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end end end )addEventHandler("removeTime",root, function (to,time) if to == "all" then for _,v in ipairs(getElementsByType("player")) do removePlayerTime(v,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",v,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم حذف "..time.." ساعة من جمييع الاعبين",v,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",v,255,255,0,true) end else local plr = getPlayerFromName(to) if plr then removePlayerTime(plr,time) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) outputChatBox ("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA تم حذف "..time.." ساعه من حسابك ",plr,255,0,0,true ) outputChatBox("#585858[ #610B0BTawze-System #585858] #FFFFFF:#FFFAAA =====================================",plr,255,255,0,true) end end end ) function addPlayerTime(plr,time) time = math.floor(time) t[plr]['hour'] = tonumber(t[plr]['hour'] or 0) + time end function removePlayerTime(plr,time) time = math.floor(time) t[plr]['hour'] = tonumber(t[plr]['hour'] or 0) - time endfunction checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2endsetTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "PlayTime", tostring( hour )..':'..tostring( min )..':'..tostring( sec ) ) end end, 1000, 0)function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'PlayTime' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "PlayTime-hour", tostring(hour) ) setAccountData ( playeraccount, "PlayTime-min", tostring(min) ) setAccountData ( playeraccount, "PlayTime-sec", tostring(sec) ) setAccountData ( playeraccount, "PlayTime", tostring(sValue) ) end t[ source ] = nilendfunction onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "PlayTime" ) local hou = getAccountData ( playeraccount, "PlayTime-hour") local min = getAccountData ( playeraccount, "PlayTime-min") local sec = getAccountData ( playeraccount, "PlayTime-sec") if ( time ) then setElementData ( source, "PlayTime", time ) t[ source ]["hour"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "PlayTime",0 ) setAccountData ( playeraccount, "PlayTime",0 ) end endendaddEventHandler ( "onPlayerQuit", root, onPlayerQuit )addEventHandler ( "onPlayerLogin", root, onPlayerLogin )addEventHandler ( "onPlayerLogout", root, function ( acc ) local sValue = getElementData( source,'PlayTime' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( acc, "PlayTime-hour", tostring(hour) ) setAccountData ( acc, "PlayTime-min", tostring(min) ) setAccountData ( acc, "PlayTime-sec", tostring(sec) ) setAccountData ( acc, "PlayTime", tostring(sValue) ) t[ source ]["hour"] = 0 t[ source ]["min"] = 0 t[ source ]["sec"] = 0end )addEventHandler("onResourceStart", resourceRoot, function () for k,v in ipairs ( getElementsByType ( "player" ) ) do if not ( isGuestAccount ( getPlayerAccount ( v ) ) ) then if ( getAccountData ( getPlayerAccount ( v ), "PlayTime" ) ) then local hou = getAccountData ( getPlayerAccount ( v ), "PlayTime-hour") local min = getAccountData ( getPlayerAccount ( v ), "PlayTime-min") local sec = getAccountData ( getPlayerAccount ( v ), "PlayTime-sec") if not ( t [ v ] ) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ]["hour"] = tonumber(hou) t[ v ]["min"] = tonumber(min) t[ v ]["sec"] = tonumber(sec) end end endend)addEventHandler("onResourceStop", resourceRoot, function () for k,v in ipairs ( getElementsByType ( "player" ) ) do if not ( isGuestAccount ( getPlayerAccount ( v ) ) ) then local sValue = getElementData( v,'PlayTime' ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) local min = tonumber( t[ v ][ 'min' ] or 0 ) local sec = tonumber( t[ v ][ 'sec' ] or 0 ) setAccountData ( getPlayerAccount ( v ), "PlayTime-hour", tostring(hour) ) setAccountData ( getPlayerAccount ( v ), "PlayTime-min", tostring(min) ) setAccountData ( getPlayerAccount ( v ), "PlayTime-sec", tostring(sec) ) setAccountData ( getPlayerAccount ( v ), "PlayTime", tostring(sValue) ) end endend)--[[local PlayTimeSerialsTable_X = { --- سريالات اللي يقدرو يفتحو لوحة توزيع الساعات["C508418E676002A7C652EE02C14D4C02"] = true,["5B84916F1B6B09A907C5FD981566CB42"] = true,}addCommandHandler("لوحة",-- هنا كلمة فتح اللوحة function(player) local serial = getPlayerSerial(player) if PlayTimeSerialsTable_X[serial] then triggerClientEvent( player, 'PlayTime:OpenPanel', root, true ); else outputChatBox('',player,255,0,0,true) endend)]]addCommandHandler("لوحة",-- الكلمة من اف8 function (player) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)),aclGetGroup("Console")) then-- القروب triggerClientEvent(player,"PlayTime:OpenPanel",player) else outputChatBox("",player,255,0,0) end end) مشكور يغلق@ 1 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