EH10 Posted January 13, 2014 Share Posted January 13, 2014 السلام عليكم ممكن فنكشات اذا كتب باف8 توزيع وقت ياخي وقت 15 ساعة بعدين لما يكتب ثاني مره يقول تم اخذ ساعات من قبل وبعد يومين تكتب يعطيك Link to comment
The Killer Posted January 13, 2014 Share Posted January 13, 2014 addCommandHandler("all", function (player,cmd,Time) if tonumber(Time) then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then outputChatBox("" .. getPlayerName(player) .. " ] Has Give All The Players [ " .. Time .. " hours ] ", root,0,255,0, true) for k, v in ipairs (getElementsByType("player")) do t[ v ][ "hour" ] = tonumber( t[ v ][ "hour" ] or 0 ) + Time end else outputChatBox("You Are Not in Console.", player, 255, 0, 0, true) end end end ) ضيف الكود لمود الساعات واكتب all و رقم الساعات Link to comment
EH10 Posted January 13, 2014 Author Share Posted January 13, 2014 addCommandHandler("all", function (player,cmd,Time) if tonumber(Time) then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then outputChatBox("" .. getPlayerName(player) .. " ] Has Give All The Players [ " .. Time .. " hours ] ", root,0,255,0, true) for k, v in ipairs (getElementsByType("player")) do t[ v ][ "hour" ] = tonumber( t[ v ][ "hour" ] or 0 ) + Time end else outputChatBox("You Are Not in Console.", player, 255, 0, 0, true) end end end ) ضيف الكود لمود الساعات واكتب all و رقم الساعات يابعد قلبي انا ابي فنكشات اذا كذا اذا اي واحد من الاعضاء كتب وقت يعطية هو بس لحالة واذا كتب ثاني مره يقول لقد تم توزيع اليك وقت وبعد يومين يقدر ياخذ كذا Link to comment
The Killer Posted January 13, 2014 Share Posted January 13, 2014 setElementData getElementData Link to comment
EH10 Posted January 13, 2014 Author Share Posted January 13, 2014 setElementData getElementData مشكور بس ذول اضيفهم مع كودك ؟ Link to comment
EH10 Posted January 13, 2014 Author Share Posted January 13, 2014 اذا ممكن تعدلي على كود والكونسل يقدر يسوي ثنين يعني يقدر يكتب اسم الشخص والوقت ويتحول له وقت ويقدر يكتب الجميع ويكتب الوقت ويتحول للجميع Link to comment
K1NG Posted January 13, 2014 Share Posted January 13, 2014 السلام عليكم ممكن فنكشاتاذا كتب باف8 توزيع وقت ياخي وقت 15 ساعة بعدين لما يكتب ثاني مره يقول تم اخذ ساعات من قبل وبعد يومين تكتب يعطيك addCommandHandler isGuestAccount getPlayerAccount getAccountData setElementData getElementData setTimer setAccountData اذا ممكن تعدلي على كود والكونسل يقدر يسوي ثنين يعني يقدر يكتب اسم الشخص والوقت ويتحول له وقت ويقدر يكتب الجميع ويكتب الوقت ويتحول للجميع عطيتك ياه فوقبس امسك --[[ ]] exports.scoreboard:addScoreboardColumn('Online Time') 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 ][ '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, "Online Time", 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,'Online Time' ) setAccountData ( playeraccount, "Online Time", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "Online Time" ) if ( time ) then setElementData ( source, "Online Time", time ) else setElementData ( source, "Online Time",0 ) setAccountData ( playeraccount, "Online Time",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) addCommandHandler("give", function (player,cmd,PlayerName,Time) if PlayerName and Time then local thePlayer = getPlayerFromName(PlayerName) if isElement(thePlayer) then if tonumber(Time) then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then t[thePlayer]["hour"] = tonumber(Time) outputChatBox("#fff000.:[#00ff00 * You Have Successfully Give #ff0000" .. getPlayerName(thePlayer) .. "#00ff00 [ " .. Time .. " hours ] #fff000]:.",player,0,255,0, true) outputChatBox("#fff000.:[ * #ff0000" .. getPlayerName(player) .. " #00ff00 Has Successfully Give You #ff0000 [ " .. Time .. " hours ] #fff000]:.", thePlayer, 0, 255, 0, true) else outputChatBox("#fff000.:[ #ff0000You Are Not in #00ff00Console#ff0000 Group #fff000]:.", player, 255, 0, 0, true) end else outputChatBox("#fff000.:[ #ff0000* Error in Time #fff000]:.",player,255,0,0, true) end else outputChatBox("#fff000.:[ #FF0000* Player Not Found #fff000]:.",player,255,0,0, true) end else outputChatBox("#fff000.:[ #ff0000* give #fff000]:.",player,255,0,0, true) end end ) --- addCommandHandler("all", function (player,cmd,Time) if tonumber(Time) then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then outputChatBox("" .. getPlayerName(player) .. " ] Has Give All The Players [ " .. Time .. " hours ] ", root,0,255,0, true) for k, v in ipairs (getElementsByType("player")) do t[ v ][ "hour" ] = tonumber( t[ v ][ "hour" ] or 0 ) + Time end else outputChatBox("You Are Not in Console.", player, 255, 0, 0, true) end end end ) ضيف الكود لمود الساعات واكتب all و رقم الساعات Link to comment
EH10 Posted January 13, 2014 Author Share Posted January 13, 2014 السلام عليكم ممكن فنكشاتاذا كتب باف8 توزيع وقت ياخي وقت 15 ساعة بعدين لما يكتب ثاني مره يقول تم اخذ ساعات من قبل وبعد يومين تكتب يعطيك addCommandHandler isGuestAccount getPlayerAccount getAccountData setElementData getElementData setTimer setAccountData اذا ممكن تعدلي على كود والكونسل يقدر يسوي ثنين يعني يقدر يكتب اسم الشخص والوقت ويتحول له وقت ويقدر يكتب الجميع ويكتب الوقت ويتحول للجميع عطيتك ياه فوقبس امسك --[[ ]] exports.scoreboard:addScoreboardColumn('Online Time') 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 ][ '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, "Online Time", 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,'Online Time' ) setAccountData ( playeraccount, "Online Time", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "Online Time" ) if ( time ) then setElementData ( source, "Online Time", time ) else setElementData ( source, "Online Time",0 ) setAccountData ( playeraccount, "Online Time",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) addCommandHandler("give", function (player,cmd,PlayerName,Time) if PlayerName and Time then local thePlayer = getPlayerFromName(PlayerName) if isElement(thePlayer) then if tonumber(Time) then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then t[thePlayer]["hour"] = tonumber(Time) outputChatBox("#fff000.:[#00ff00 * You Have Successfully Give #ff0000" .. getPlayerName(thePlayer) .. "#00ff00 [ " .. Time .. " hours ] #fff000]:.",player,0,255,0, true) outputChatBox("#fff000.:[ * #ff0000" .. getPlayerName(player) .. " #00ff00 Has Successfully Give You #ff0000 [ " .. Time .. " hours ] #fff000]:.", thePlayer, 0, 255, 0, true) else outputChatBox("#fff000.:[ #ff0000You Are Not in #00ff00Console#ff0000 Group #fff000]:.", player, 255, 0, 0, true) end else outputChatBox("#fff000.:[ #ff0000* Error in Time #fff000]:.",player,255,0,0, true) end else outputChatBox("#fff000.:[ #FF0000* Player Not Found #fff000]:.",player,255,0,0, true) end else outputChatBox("#fff000.:[ #ff0000* give #fff000]:.",player,255,0,0, true) end end ) --- addCommandHandler("all", function (player,cmd,Time) if tonumber(Time) then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then outputChatBox("" .. getPlayerName(player) .. " ] Has Give All The Players [ " .. Time .. " hours ] ", root,0,255,0, true) for k, v in ipairs (getElementsByType("player")) do t[ v ][ "hour" ] = tonumber( t[ v ][ "hour" ] or 0 ) + Time end else outputChatBox("You Are Not in Console.", player, 255, 0, 0, true) end end end ) ضيف الكود لمود الساعات واكتب all و رقم الساعات شكرا لك وشكرا لكلير 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