Jump to content

x[ مساعدة ]x في حماية من طرد


Recommended Posts




هـذا الكود اذا شخص يكرار 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
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) 

 

  • Like 1
Link to comment
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
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
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) 

 

,,,,, كلمة مبدع قليلة في حقك
أشكرك, جزيلآ الشكر أخيِ:x

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...