Sylence Posted March 19, 2016 Share Posted March 19, 2016 كيف اخلي اليقدر يتكلم فيه الشات الليس معه ساعات يعني المعاه 3 ساعات يقدر يتكلنم في الشات الما معه 3 ساعات ما يقدر يتكلم في شات t Link to comment
Ja[B]er[X]Pro Posted March 19, 2016 Share Posted March 19, 2016 كيف اخلي اليقدر يتكلم فيه الشات الليس معه ساعات يعنيالمعاه 3 ساعات يقدر يتكلنم في الشات الما معه 3 ساعات ما يقدر يتكلم في شات t اعتقد يجب تجيب داتا الساعات Link to comment
Sylence Posted March 19, 2016 Author Share Posted March 19, 2016 (edited) اوك مشكور Edited March 19, 2016 by Guest Link to comment
#Mr.Rajo~,< Posted March 19, 2016 Share Posted March 19, 2016 كيف اجيبو؟ من نفس السكربت حق الساعات Link to comment
Ja[B]er[X]Pro Posted March 19, 2016 Share Posted March 19, 2016 افتح سكربت الساعات ابحث عن فنكشن setElementData أو فنكشن getElementData وشوف وش اسم الداتا الخاصة به Link to comment
Sylence Posted March 19, 2016 Author Share Posted March 19, 2016 طيب انا عاوز مود ساعات في تاب + ممكن تعدلي عليه الداتا دي؟ Link to comment
Ja[B]er[X]Pro Posted March 19, 2016 Share Posted March 19, 2016 طيب انا عاوز مود ساعات في تاب + ممكن تعدلي عليه الداتا دي؟ افتح مود ساعات تاب وابحث عن setElementData وانسخ السطر وضعه هنا اسهل شيئ Link to comment
Sylence Posted March 19, 2016 Author Share Posted March 19, 2016 انا ما معي مود الساعات الفي تاب ممكن تدهولي ؟وتعدلي عليه Link to comment
Sylence Posted March 19, 2016 Author Share Posted March 19, 2016 اهو كود المود . --[[ RegarDs Robin [sGC] Social Gaming CommuniTy Enjoy The Script ]] exports.scoreboard:addScoreboardColumn('Played') local t = { } 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 ][ 'hours' ] = tonumber( t[ source ][ 'hours' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hours"] = 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 hours = tonumber( t[ v ][ 'hours' ] or 0 ) setElementData( v, "Time Played", tostring( hours ) .. ' Hours ' ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Time Played' ) local hours = tonumber( t[ source ][ 'hours' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "Time Played-hours", tostring(hours) ) setAccountData ( playeraccount, "Time Played-min", tostring(min) ) setAccountData ( playeraccount, "Time Played-sec", tostring(sec) ) setAccountData ( playeraccount, "Time Played", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "Time Played" ) local hou = getAccountData ( playeraccount, "Time Played-hours") local min = getAccountData ( playeraccount, "Time Played-min") local sec = getAccountData ( playeraccount, "Time Played-sec") if ( time ) then setElementData ( source, "Time Played", time ) t[ source ]["hours"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "Time Played",0 ) setAccountData ( playeraccount, "Time Played",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) + عاوز تعديل يعني في تاب هوا اسمه Time Played عاوز اسمه Played ولما بخلي اسمه Played بيبقا مش بيطلع ساعات خالص Link to comment
#DRAGON!FIRE Posted March 19, 2016 Share Posted March 19, 2016 --[[ RegarDs Robin [sGC] Social Gaming CommuniTy Enjoy The Script ]] exports.scoreboard:addScoreboardColumn('Played') local t = { } 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 ][ 'hours' ] = tonumber( t[ source ][ 'hours' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hours"] = 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 hours = tonumber( t[ v ][ 'hours' ] or 0 ) setElementData( v, "Played", tostring( hours ) .. ' Hours ' ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Played' ) local hours = tonumber( t[ source ][ 'hours' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "Time Played-hours", tostring(hours) ) setAccountData ( playeraccount, "Time Played-min", tostring(min) ) setAccountData ( playeraccount, "Time Played-sec", tostring(sec) ) setAccountData ( playeraccount, "Time Played", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "Time Played" ) local hou = getAccountData ( playeraccount, "Time Played-hours") local min = getAccountData ( playeraccount, "Time Played-min") local sec = getAccountData ( playeraccount, "Time Played-sec") if ( time ) then setElementData ( source, "Played", time ) t[ source ]["hours"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "Played",0 ) setAccountData ( playeraccount, "Time Played",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) 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