Mr.OppS Posted May 4, 2017 Share Posted May 4, 2017 هـذا الكود اذا شخص يكرار 5 مرات او يكـتـب كلمة باف8 اكثير من 5 مرات يأخذ طرد من سيرفر أريـد اذا صاحب سيرفر كرار بشات 5 مرات لا ياخذ طرد !! اريد فقط 2 رتـب لاتاخذ طرد!!! والباقي ياخذ الكــود : local komutkontrol = {} function antikomutspam() if (not komutkontrol[source]) then komutkontrol[source] = 1 elseif (komutkontrol[source] == 5) then outputChatBox("#ff0000" ..getPlayerName(source).. " سبام ممنوع! ",root,0,0,0,true) kickPlayer(source,"Sopt Spam !!") else komutkontrol[source] = komutkontrol[source] + 1 end end addEventHandler("onPlayerCommand", root, antikomutspam) setTimer(function() komutkontrol = {} end, 1000, 0) Link to comment
^iiEcoo'x_) Posted May 4, 2017 Share Posted May 4, 2017 local aGroup = { 'Console' , 'HeahAdmin' } local komutkontrol = {} function antikomutspam() for _ , group in ipairs ( aGroup ) do if ( isObjectInACLGroup("user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( group ) ) ) then return end end if (not komutkontrol[source]) then komutkontrol[source] = 1 elseif (komutkontrol[source] == 5) then outputChatBox("#ff0000" ..getPlayerName(source).. " سبام ممنوع! ",root,0,0,0,true) kickPlayer(source,"Sopt Spam !!") else komutkontrol[source] = komutkontrol[source] + 1 end end addEventHandler("onPlayerCommand", root, antikomutspam) setTimer(function() komutkontrol = {} end, 1000, 0) 1 Link to comment
MR.StoRm Posted May 4, 2017 Share Posted May 4, 2017 52 minutes ago, #_iMr.[E]coo said: local aGroup = { 'Console' , 'HeahAdmin' } local komutkontrol = {} function antikomutspam() for _ , group in ipairs ( aGroup ) do if ( isObjectInACLGroup("user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( group ) ) ) then return end end if (not komutkontrol[source]) then komutkontrol[source] = 1 elseif (komutkontrol[source] == 5) then outputChatBox("#ff0000" ..getPlayerName(source).. " سبام ممنوع! ",root,0,0,0,true) kickPlayer(source,"Sopt Spam !!") else komutkontrol[source] = komutkontrol[source] + 1 end end addEventHandler("onPlayerCommand", root, antikomutspam) setTimer(function() komutkontrol = {} end, 1000, 0) ناقص إيند لسطر 8 ..@#_iMr.[E]coo Link to comment
^iiEcoo'x_) Posted May 4, 2017 Share Posted May 4, 2017 3 minutes ago, MR.StoRm said: ناقص إيند لسطر 8 ..@#_iMr.[E]coo لا لا ما في Link to comment
MR.StoRm Posted May 4, 2017 Share Posted May 4, 2017 Just now, #_iMr.[E]coo said: لا لا ما في اللوب ما يحتاج إيند ؟؟ ! Link to comment
^iiEcoo'x_) Posted May 4, 2017 Share Posted May 4, 2017 Just now, MR.StoRm said: اللوب ما يحتاج إيند ؟؟ ! مسويله اند ، بس لاحظ السطر الذي تحته ، اقراه بتمعن Link to comment
MR.StoRm Posted May 4, 2017 Share Posted May 4, 2017 1 minute ago, #_iMr.[E]coo said: مسويله اند ، بس لاحظ السطر الذي تحته ، اقراه بتمعن وال if التي فوق الإيند ؟؟ Link to comment
^iiEcoo'x_) Posted May 4, 2017 Share Posted May 4, 2017 if ( isObjectInACLGroup("user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( group ) ) ) then return end Link to comment
MR.StoRm Posted May 4, 2017 Share Posted May 4, 2017 I did not pay attention so I'm sorry .. !@#_iMr.[E]coo 1 Link to comment
Master_MTA Posted May 4, 2017 Share Posted May 4, 2017 4 hours ago, #_iMr.[E]coo said: local aGroup = { 'Console' , 'HeahAdmin' } local komutkontrol = {} function antikomutspam() for _ , group in ipairs ( aGroup ) do if ( isObjectInACLGroup("user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( group ) ) ) then return end end if (not komutkontrol[source]) then komutkontrol[source] = 1 elseif (komutkontrol[source] == 5) then outputChatBox("#ff0000" ..getPlayerName(source).. " سبام ممنوع! ",root,0,0,0,true) kickPlayer(source,"Sopt Spam !!") else komutkontrol[source] = komutkontrol[source] + 1 end end addEventHandler("onPlayerCommand", root, antikomutspam) setTimer(function() komutkontrol = {} end, 1000, 0) u must add break to stop the loop Link to comment
Abdul KariM Posted May 4, 2017 Share Posted May 4, 2017 توقف اللوب return مايحتاج يسوي بريك لأن Link to comment
Master_MTA Posted May 5, 2017 Share Posted May 5, 2017 23 hours ago, Abdul KariM said: توقف اللوب return مايحتاج يسوي بريك لأن ما شفتها +_+ Link to comment
Mr.OppS Posted May 6, 2017 Author Share Posted May 6, 2017 On 5/4/2017 at 16:46, #_iMr.[E]coo said: local aGroup = { 'Console' , 'HeahAdmin' } local komutkontrol = {} function antikomutspam() for _ , group in ipairs ( aGroup ) do if ( isObjectInACLGroup("user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( group ) ) ) then return end end if (not komutkontrol[source]) then komutkontrol[source] = 1 elseif (komutkontrol[source] == 5) then outputChatBox("#ff0000" ..getPlayerName(source).. " سبام ممنوع! ",root,0,0,0,true) kickPlayer(source,"Sopt Spam !!") else komutkontrol[source] = komutkontrol[source] + 1 end end addEventHandler("onPlayerCommand", root, antikomutspam) setTimer(function() komutkontrol = {} end, 1000, 0) ,,,,, كلمة مبدع قليلة في حقك أشكرك, جزيلآ الشكر أخيِ Link to comment
^iiEcoo'x_) Posted May 6, 2017 Share Posted May 6, 2017 2 hours ago, King SpY said: ,,,,, كلمة مبدع قليلة في حقك أشكرك, جزيلآ الشكر أخيِ العفو 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