Mr.Mostafa Posted June 5, 2018 Share Posted June 5, 2018 سلام عليكم ابي اسوي لو الشخص كتب كلمة - وكتب علطول بعدها كلمة يقوله الرجاء الانتظار 5- 4 - 3 - 2 - 1 محاولتي function convertMilliseconds( i ) if ( i ) then sec = math.fmod( math.floor( i / 1000 ), 60 ) return string.format( '%2d', sec ) end end local timer2 = convertMilliseconds( getTimerDetails( timer[root] ) ) outputChatBox( "Don't repeat yourself!!! wait ".. timer2 .."", source, 255, 0, 0 ) Link to comment
#Major . Posted June 5, 2018 Share Posted June 5, 2018 2 hours ago, Mr.Mostafa said: [root] ؟؟ Link to comment
+Source|> Posted June 5, 2018 Share Posted June 5, 2018 3 hours ago, Mr.Mostafa said: سلام عليكم ابي اسوي لو الشخص كتب كلمة - وكتب علطول بعدها كلمة يقوله الرجاء الانتظار 5- 4 - 3 - 2 - 1 محاولتي function convertMilliseconds( i ) if ( i ) then sec = math.fmod( math.floor( i / 1000 ), 60 ) return string.format( '%2d', sec ) end end local timer2 = convertMilliseconds( getTimerDetails( timer[root] ) ) outputChatBox( "Don't repeat yourself!!! wait ".. timer2 .."", source, 255, 0, 0 ) timer = {} function convertMilliseconds( i ) if ( i ) then sec = math.fmod( math.floor( i / 1000 ), 60 ) return string.format( '%2d', sec ) end end local timer2 = convertMilliseconds( getTimerDetails( timer[root] ) ) outputChatBox( "Don't repeat yourself!!! wait [ ".. timer2 .." ]", source, 255, 0, 0, true ) timer[root] = setTimer( function() end, 5000, 1 ) Link to comment
Mr.Mostafa Posted June 8, 2018 Author Share Posted June 8, 2018 On ٥/٦/٢٠١٨ at 10:36, +Source|> said: timer = {} function convertMilliseconds( i ) if ( i ) then sec = math.fmod( math.floor( i / 1000 ), 60 ) return string.format( '%2d', sec ) end end local timer2 = convertMilliseconds( getTimerDetails( timer[root] ) ) outputChatBox( "Don't repeat yourself!!! wait [ ".. timer2 .." ]", source, 255, 0, 0, true ) timer[root] = setTimer( function() end, 5000, 1 ) ما اشتغل Link to comment
+Source|> Posted June 8, 2018 Share Posted June 8, 2018 8 minutes ago, Mr.Mostafa said: ما اشتغل انت اكيد مسويه غلط ارسل التاجات خاص Link to comment
Mr.Mostafa Posted June 8, 2018 Author Share Posted June 8, 2018 Just now, +Source|> said: انت اكيد مسويه غلط ارسل التاجات خاص هو مود لحاله - مب بمود التاجات Link to comment
+Source|> Posted June 8, 2018 Share Posted June 8, 2018 Just now, Mr.Mostafa said: هو مود لحاله - مب بمود التاجات لازم تحطه بمود التاجات Link to comment
Mr.Mostafa Posted June 8, 2018 Author Share Posted June 8, 2018 Just now, +Source|> said: لازم تحطه بمود التاجات طيب هو لحاله الحين وشغال عادي Link to comment
Mr.Mostafa Posted June 8, 2018 Author Share Posted June 8, 2018 Just now, +Source|> said: شغال زين يعني ؟ يب بس حقت ال 5 ثواني مب ظابطة Link to comment
+Source|> Posted June 8, 2018 Share Posted June 8, 2018 Just now, Mr.Mostafa said: يب بس حقت ال 5 ثواني مب ظابطة حط اكوادك Link to comment
Mr.Mostafa Posted June 8, 2018 Author Share Posted June 8, 2018 1 minute ago, +Source|> said: حط اكوادك local gPlayerTickCount = { } local gPlayerSpams = { } local gPlayerMessage = { } local gPlayerMsgNum = { } local gPlayerMuteTimer = { } local gSettings = { } addEventHandler( "onPlayerChat", getRootElement( ), function( message ) if not gPlayerSpams[ source ] then gPlayerSpams[ source ] = true gPlayerTickCount[ source ] = getTickCount( ) gPlayerMessage[ source ] = message else if getTickCount( ) - gPlayerTickCount[ source ] > gSettings.delay then gPlayerMsgNum[ source ] = 0 gPlayerMessage[ source ] = nil; gPlayerTickCount[ source ] = getTickCount( ) return else if gPlayerMsgNum[ source ] >= gSettings.msgNum then gPlayerTickCount[ source ] = getTickCount( ) cancelEvent( ) if gSettings.mutePlayers then mutePlayer( source ); end elseif message == gPlayerMessage[ source ] then cancelEvent( ) outputChatBox( "Don't repeat yourself!!!", source, 255, 0, 0 ) end gPlayerMsgNum[ source ] = gPlayerMsgNum[ source ] + 1 end end gPlayerMessage[ source ] = message end ) function mutePlayer( player ) setPlayerMuted( player, true ); gPlayerMuteTimer[ player ] = setTimer( unmutePlayer, gSettings.muteTime * 1000, 1, player ); outputChatBox( "Don't flood the chat!!! You are now muted for " .. gSettings.muteTime .." seconds.", player, 255, 0, 0 ) end function unmutePlayer( player ) setPlayerMuted( player, false ); outputChatBox( "You can talk again. Remeber, do NOT spam!", player, 255, 0, 0 ); end addEventHandler( "onPlayerJoin", getRootElement( ), function( ) gPlayerMsgNum[ source ] = 0 end ) addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), function( ) gSettings.delay = get( "@differenceBetweenMessages_ms" ) gSettings.msgNum = get( "@messagesNumber" ) gSettings.mutePlayers = ( get( "@mutePlayers" ) == "true" ) and true or false; gSettings.muteTime = get( "@muteTime" ); for _, plr in pairs( getElementsByType( "player" ) ) do gPlayerMsgNum[ plr ] = 0 end end ) addEventHandler( "onResourceStop", getResourceRootElement(), function( ) local players = getElementsByType( "player" ); for i, plr in pairs( players ) do if isPlayerMuted( plr ) then setPlayerMuted( plr, false ); end end end ) 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