Jump to content

3NAD

Members
  • Posts

    1,992
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by 3NAD

  1. طيب حط بارامترhttps://wiki.multitheftauto.com/wiki/OnMarkerHit ----- Parameters [*]hitElement: The element that hit the marker [*]matchingDimension: True if the element is in the same dimension as the marker he hit ----- انت بتحتاج اول بارامتر , لو تلاحظ بعد الترجمة يقولك هو الإلمنت اللي لمس الماركر . function ( ) end function ( hitElement ) end بعد ماضفته داخل القوس تقدر تستخدم كـ عنصر في الأكواد getPlayerName ( hitElement )
  2. انت تبي تجيب اسم الماركر ؟
  3. يعني كذا local name = getPlayerName(localPlayer) localPlayer -- للكلنت فقط
  4. Insults = { -- Note: USE lowercase LETTERS -- Format: { "Insult Word", "Replace Word" }, { ":O", "cow" }, } function chatL ( msg ) for k,v in ipairs (Insults) do if string.find( string.lower ( msg ),v[1]) then msg = msg:gsub ( msg, v[2] ) end end cancelEvent ( ) local plrTeam = getPlayerTeam ( source ) if plrTeam then local r, g, b = getTeamColor ( plrTeam ) outputChatBox ( getPlayerName ( source )..": #ffffff"..msg, root, r, g, b, true ) else local r, g, b = getPlayerNametagColor ( source ) outputChatBox ( getPlayerName ( source )..": #ffffff"..msg, root, r, g, b, true ) end end addEventHandler ( "onPlayerChat", root, chatL ) مو مرتاح لـ كود البحث عن الكلمات احس فيه غلط صغير ..
  5. مايحتاج جدول .. ضيف شرط if ( serial == "" ) or ( serial == "" ) or ( serial == "" ) then end
  6. 3NAD

    AntiSpam

    This will be definition, Not ( matching / comparing ) on Conditional clause. You must make it like this: if xxx == 1 then
  7. 3NAD

    [Question]

    if ( isPlayerMuted ( player ) ) then if isObjectInACLGroup ( "user." .. getPlayerAccountName ( source ), aclGetGroup ( "Console" ) ) then action = "un"..action else return end end
  8. 3NAD

    AntiSpam

    xDD ?? if g_MessageCount = 1 then
  9. 3NAD

    [Question]

    admin/server/admin_server.lua find this line: if ( isPlayerMuted ( player ) ) then action = "un"..action end replace it: if ( isPlayerMuted ( player ) ) then return end
  10. 3NAD

    AntiSpam

    Hmm.. i don't think so. But the 'spam code' will block any repeated messages. And you can make table to block some words.
  11. if tonumber ( text ) > 0 then end
  12. 3NAD

    AntiSpam

    I think you can block it with 'onPlayerCommand'. if find 'bind' then cancelEvent
  13. 3NAD

    AntiSpam

    bind .. say b will be under "onPlayerChat". so the previous code will do that.
  14. 3NAD

    AntiSpam

    ----Anti-Spam-Script-by-HyPeX-- ----Locals---- MuteTimePerMins = 5 ------------------------------- ----Messages of Startup---- outputChatBox ("#00aaff[AntiSpam]: Script v2.0 by HyPeX Started.",root, 255, 255, 255, true) outputChatBox ("#00aaff[AntiSpam]: Special Thanks to 3NAD for helping me.",root, 255, 255, 255, true) outputChatBox ("#00aaff[AntiSpam]: Aviable commands: sleft",root , 255, 255, 255, true) ------------------------------- ----Functions--- function credits(onPlayerJoin) outputChatBox ( "Anti-Spam Script By HyPeX Loaded", source, 55, 125, 255 ) end addEventHandler("onPlayerJoin", root, credits) SpamTable = { }; AntiSpam = function ( msg, type ) if not SpamTable[source] then SpamTable[source] = { Timer = { }; Command = { }; Mute = { }; MuteTime = { }; }; end if type == 0 then if SpamTable[source] then if SpamTable[source].Mute == true then outputChatBox("[AntiSpam]: Type /sleft to get your time left muted.", source, 0, 170, 255) return end if SpamTable[source].Command == msg then if isTimer ( SpamTable[source].Timer ) then if SpamTable[source].Mute ~= true then SpamTable[source].Mute = true SpamTable[source].MuteTime = setTimer ( function ( player ) if isElement ( player ) then UnMutePlayer ( player ) SpamTable[player].Mute = false end end, MuteTimePerMins*60*1000, 1, source ) setPlayerMuted(source, true) outputChatBox("[AntiSpam]: ".. (string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "")) .." has have been muted for flooding for "..MuteTimePerMins.." Mins.", source, 0, 170, 255) cancelEvent ( ) return end end cancelEvent ( ) outputChatBox ( "[AntiSpam]: You have been Warned.", source, 0, 170, 255, true ) outputChatBox ( "[AntiSpam]: If you Spam again withing 10 secs, you will be muted.", source, 0, 170, 255, true ) SpamTable[source].Timer = setTimer ( function ( player ) if isElement ( player ) then SpamTable[player].Command = nil end end, 10000, 1, source ) else SpamTable[source].Command = msg end end end end addEventHandler ( "onPlayerChat", root, AntiSpam ) function timerDetails ( source ) if SpamTable[source].MuteTime then if isTimer ( SpamTable[source].MuteTime ) then local remaining, executesRemaining, totalExecutes = getTimerDetails ( SpamTable[source].MuteTime ) outputChatBox ( "[AntiSpam]: Time left muted: "..string.format ( '%02d:%02d', math.floor(remaining/60/1000), math.fmod(math.floor(remaining/1000),60)), source, 0, 170, 255, true ) else outputChatBox ( "[AntiSpam]: You are not muted.", source, 0, 170, 255, true ) end end end addCommandHandler ( "sleft", timerDetails ) addEventHandler ( "onResourceStop", resourceRoot, function ( ) for i, v in ipairs ( getElementsByType ( "player" ) ) do onDeleteTables ( v ) end end ) onDeleteTables = function ( player ) if not player then player = source end SpamTable[player] = nil end addEventHandler ( "onPlayerQuit", root, onDeleteTables ) ----UnmutePlayer function UnMutePlayer(player) if isElement ( player ) then if isPlayerMuted( player ) then setPlayerMuted(player, false) else outputChatBox ( "[AntiSpam]:".. (string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", "")) .."is now unmuted!",player,0, 175 ,255 ) end end end ----Manage on quit or join function OnPlayerMutedLeft() local playerAccount = getPlayerAccount(source) if not isGuestAccount ( playerAccount ) then if isPlayerMuted( source ) or isTimer ( SpamTable[source].MuteTime )then local remaining, executesRemaining, totalExecutes = getTimerDetails ( SpamTable[source].MuteTime ) if remaining then setAccountData( playerAccount, "MutedTimeScript", tostring(remaining) ) setPlayerMuted( source, false) killTimer(SpamTable[source].MuteTime) end else setAccountData( playerAccount, "MutedtimeScript", false ) end end end addEventHandler("onPlayerQuit", root, OnPlayerMutedLeft) function OnPlayerMutedJoint ( _, acc ) local MutedLeft = getAccountData( acc, "MutedTimeScript" ) if MutedLeft then if not SpamTable[source] then SpamTable[source] = { Timer = { }; Command = { }; Mute = { }; MuteTime = { }; }; end setPlayerMuted(source, true) setTimer(UnMutePlayer, tonumber(MutedLeft), 1, source ) SpamTable[source].MuteTime = setTimer ( function ( player ) if isElement ( player ) then SpamTable[player].Mute = false end end, tonumber(MutedLeft), 1, source ) outputChatBox ( "[AntiSpam]: Welcome back, here's your time left muted:", source, 0, 170, 255, true ) outputChatBox ( "[AntiSpam]: Time left muted: "..string.format ( '%02d:%02d', math.floor(MutedLeft/60/1000), math.fmod(math.floor(MutedLeft/1000),60)), source, 0, 170, 255, true ) setAccountData( acc, "MutedTimeScript", false ) end end addEventHandler("onPlayerLogin", root, OnPlayerMutedJoint) ----Prevent Muted from changing nick function StopMuted() if isPlayerMuted( source ) or isTimer ( SpamTable[source].MuteTime ) then outputChatBox ( "[AntiSpam]:".. (string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "")) .."was kicked for trying to change his nick while muted!", source,0, 175 ,255 ) kickPlayer( source, AntiSpam, "You are muted dont change ur nick!" ) cancelEvent() end end addEventHandler("onPlayerChangeNick", getRootElement(), StopMuted) local disabledCmds = { [ "me" ] = true, [ "pm" ] = true } addEventHandler ( "onPlayerCommand", root, function ( cmd ) if disabledCmds [ cmd ] then if isPlayerMuted ( source ) or isTimer ( SpamTable[source].MuteTime) then outputChatBox ( "[AntiSpam]: ".. (string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "")) .." was kicked for trying to use commands while muted!", root, 0, 175 ,255 ) kickPlayer ( source, "AntiSpam: Dont try to use commands while muted!" ) end end end )
  15. 3NAD

    AntiSpam

    If you used 'local' It will be definition on his function, You can make it general definition by removing 'local' word
  16. 3NAD

    AntiSpam

    at second function, move this line: setAccountData( acc, "MutedTimeScript", false ) under outputChatBox Functions. And you need to definition 'remaining' word
  17. 3NAD

    AntiSpam

    Try this. function OnPlayerMutedLeft() local playerAccount = getPlayerAccount(source) if not isGuestAccount ( playerAccount ) then if isPlayerMuted( source ) or isTimer ( SpamTable[source].MuteTime )then local remaining, executesRemaining, totalExecutes = getTimerDetails ( SpamTable[source].MuteTime ) if remaining then setAccountData( playerAccount, "MutedTimeScript", tostring(remaining) ) setPlayerMuted( source, false) killTimer(SpamTable[source].MuteTime) end else setAccountData( playerAccount, "MutedtimeScript", false ) end end end addEventHandler("onPlayerQuit", root, OnPlayerMutedLeft) function OnPlayerMutedJoint ( _, acc ) local MutedLeft = getAccountData( acc, "MutedTimeScript" ) if MutedLeft then setPlayerMuted(source, true) setAccountData( acc, "MutedTimeScript", false ) setTimer(UnmutePlayer, tonumber(MutedLeft), 1 ) SpamTable[source].MuteTime = setTimer ( function ( player ) if isElement ( player ) then SpamTable[player].Mute = false end end, tonumber(MutedLeft), 1, source ) outputChatBox ( "[AntiSpam]: Welcome back, here's your time left muted:", source, 0, 170, 255, true ) outputChatBox ( "[AntiSpam]: Time left muted: "..string.format ( '%02d:%02d', math.floor(remaining/60/1000), math.fmod(math.floor(remaining/1000),60)), source, 0, 170, 255, true ) end end addEventHandler("onPlayerLogin", root, OnPlayerMutedJoint)
  18. 3NAD

    AntiSpam

    You can make this: Table = { } addCommandHandler ( "test", function ( player ) Table[player] = player end ) addEventHandler ( "onPlayerQuit", root, function ( ) if Table[source] then outputChatBox ( getPlayerName(source), root ) end end )
  19. king2 مافي شيء يشغل الوظيفة هذي GUIEditor_Image = {} GUIEditor_Image[1] = guiCreateStaticImage(4,3,790,589,"xxx.png",false) GUIEditor_Image[2] = guiCreateStaticImage(4,3,790,589,"xxx1.png",true) guiSetVisible ( GUIEditor_Image[2], false ) sound = playSound("xxx.mp3", true ) function king ( ) guiSetVisible ( GUIEditor_Image[1], false ) guiSetVisible ( GUIEditor_Image[2], true ) setTimer ( king2, 4000, 1 ) end setTimer ( king, 4000, 1 ) function king2 ( ) guiSetVisible ( GUIEditor_Image[2], false ) stopSound( sound ) end
  20. السطر ذا حطه داخل الوظيفة اللي راح تشتغل setTimer ( king2, 4000, 1 ) يعني بيصير تايمر جديد يوم تشتغل الوظيفة الأولى
  21. GUIEditor_Image[2] = guiCreateStaticImage(4,3,790,589,"xxx1.png",false) يآليت تراجع التآيمر .. لأنك حاط بعد 4 ثواني تشتغل الوظيفة الأولى - اخفاء الصورة 1 - اظهار الصورة 2 و تايمر ثاني بـ نفس التوقيت يشغل الوظيفة الثانية - اخفاء الصورة 2 يعني اظهرتها واخفيتها بـ نفس الوقت ذذ
×
×
  • Create New...