Jump to content

الباند م يجي بالشات


Recommended Posts

الكود

function banAPlayer(thePlayer, commandName, targetPlayer, hours, ...)
	if exports["integration"]:isPlayerTrialAdmin(thePlayer) then
		if not (targetPlayer) or not (hours) or not tonumber(hours) or tonumber(hours)<0 or not (...) then
			outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick / ID] [Time in Hours, 0 = Infinite] [Reason]", thePlayer, 255, 194, 14)
		else
			local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
			local targetPlayerSerial = getPlayerSerial(targetPlayer)
			local targetPlayerIP = getPlayerIP(targetPlayer)
			hours = tonumber(hours)

			if not (targetPlayer) then
			elseif (hours>168) then
				outputChatBox("You cannot ban for more than 7 days (168 Hours).", thePlayer, 255, 194, 14)
			else
				local thePlayerPower = exports.global:getPlayerAdminLevel(thePlayer)
				local targetPlayerPower = exports.global:getPlayerAdminLevel(targetPlayer)
				reason = table.concat({...}, " ")

				if (targetPlayerPower <= thePlayerPower) then -- Check the admin isn't banning someone higher rank them him
					local hiddenAdmin = getElementData(thePlayer, "hiddenadmin")
					local playerName = getPlayerName(thePlayer)
					local accountID = getElementData(targetPlayer, "account:id")
					local username = getElementData(targetPlayer, "account:username") or "N/A"

					local seconds = ((hours*60)*60)
					local rhours = hours
					-- text value
					if (hours==0) then
						hours = "Permanent"
					elseif (hours==1) then
						hours = "1 Hour"
					else
						hours = hours .. " Hours"
					end

					if hours == "Permanent" then
						reason = reason .. " (" .. hours .. ")"
					else
						reason = reason .. " (" .. hours .. ")"
					end

					
					exports['admin-system']:addAdminHistory(targetPlayer, thePlayer, reason, 2 , rhours)
					local banId = nil
					if (seconds == 0) then
						banId = addToBan(accountID, targetPlayerSerial, targetPlayerIP, getElementData(thePlayer, "account:id"), reason)
						if banId and tonumber(banId) then
							lastBan = mysql:query_fetch_assoc("SELECT * FROM bans WHERE id='"..banId.."'")
							if lastBanTimer and isTimer(lastBanTimer) then
								killTimer(lastBanTimer)
								lastBanTimer = nil
							end
							lastBanTimer = setTimer(function()
								lastBan = nil
							end, 1000*60*5,1) --5 minutes
						end
					else
						addBan(nil, nil, targetPlayerSerial, thePlayer, reason, seconds)
					end

					local adminUsername = getElementData(thePlayer, "account:username")
					local adminUserID = getElementData(thePlayer, "account:id")
					local adminTitle = exports.global:getPlayerAdminTitle(thePlayer)
					makeForumThread(targetPlayerName or "N/A", username, hours, adminTitle , playerName, thePlayer, reason, adminUsername, adminUserID, banId )
					for key, value in ipairs(getElementsByType("player")) do
						if getPlayerSerial(value) == targetPlayerSerial then
							kickPlayer(value, thePlayer, reason)
						end
					end

					adminTitle = exports.global:getAdminTitle1(thePlayer)
					if (hiddenAdmin==1) then
						adminTitle = "A hidden admin"
					end

					if string.lower(commandName) == "sban" then
						exports.global:sendMessageToAdmins("[SILENT-BAN] " .. adminTitle .. " silently banned " .. targetPlayerName .. ". (" .. hours .. ")")
						exports.global:sendMessageToAdmins("[SILENT-BAN] Reason: " .. reason .. ".")
					elseif string.lower(commandName) == "forceapp" then
						outputChatBox("[FA] "..adminTitle .. " " .. playerName .. " forced app " .. targetPlayerName .. ".", root, 255,0,0,)
						hours = "Permanent"
						reason = "Failure to meet server standard. Please improve yourself then appeal on forums"
						outputChatBox("[FA]: Reason: " .. reason .. "." ,root, 255,0,0, true)
					else
						outputChatBox("[BAN] " .. adminTitle .. " banned " .. targetPlayerName .. ". (" .. hours .. ")", root, 255,0,0)
						outputChatBox("[BAN] Reason: " .. reason .. ".", root, 255,0,0, true)
					end
			end
		end
	end
end
addCommandHandler("pban", banAPlayer, false, false)
addCommandHandler("sban", banAPlayer, false, false)

 

Edited by i,xAhmed
Link to comment
					if string.lower(commandName) == "sban" then
						exports.global:sendMessageToAdmins("[SILENT-BAN] " .. adminTitle .. " silently banned " .. targetPlayerName .. ". (" .. hours .. ")")
						exports.global:sendMessageToAdmins("[SILENT-BAN] Reason: " .. reason .. ".")
					elseif string.lower(commandName) == "forceapp" then
						outputChatBox("[FA] "..adminTitle .. " " .. playerName .. " forced app " .. targetPlayerName .. ".", root, 255,0,0)
						hours = "Permanent"
						reason = "Failure to meet server standard. Please improve yourself then appeal on forums.owlgaming.net"
						outputChatBox("[FA]: Reason: " .. reason .. "." ,root, 255,0,0)
					else
						outputChatBox("[BAN] " .. adminTitle .. " banned " .. targetPlayerName .. ". (" .. hours .. ")", root, 255,0,0)
						outputChatBox("[BAN] Reason: " .. reason .. ".", root, 255,0,0)
					end

 

 

 

					if string.lower(commandName) == "sban" then
						exports.global:sendMessageToAdmins("[SILENT-BAN] " .. adminTitle .. " silently banned " .. targetPlayerName .. ". (" .. hours .. ")")
						exports.global:sendMessageToAdmins("[SILENT-BAN] Reason: " .. reason .. ".")
					elseif string.lower(commandName) == "forceapp" then
						outputChatBox("[FA] "..adminTitle .. " " .. playerName .. " forced app " .. targetPlayerName .. ".", root, 255,0,0, true)
						hours = "Permanent"
						reason = "Failure to meet server standard. Please improve yourself then appeal on forums.owlgaming.net"
						outputChatBox("[FA]: Reason: " .. reason .. "." ,root, 255,0,0, true)
					else
						outputChatBox("[BAN] " .. adminTitle .. " banned " .. targetPlayerName .. ". (" .. hours .. ")", root, 255,0,0, true)
						outputChatBox("[BAN] Reason: " .. reason .. ".", root, 255,0,0, true)
					end

 

Link to comment
8 minutes ago, +Source|> said:

					if string.lower(commandName) == "sban" then
						exports.global:sendMessageToAdmins("[SILENT-BAN] " .. adminTitle .. " silently banned " .. targetPlayerName .. ". (" .. hours .. ")")
						exports.global:sendMessageToAdmins("[SILENT-BAN] Reason: " .. reason .. ".")
					elseif string.lower(commandName) == "forceapp" then
						outputChatBox("[FA] "..adminTitle .. " " .. playerName .. " forced app " .. targetPlayerName .. ".", root, 255,0,0)
						hours = "Permanent"
						reason = "Failure to meet server standard. Please improve yourself then appeal on forums.owlgaming.net"
						outputChatBox("[FA]: Reason: " .. reason .. "." ,root, 255,0,0)
					else
						outputChatBox("[BAN] " .. adminTitle .. " banned " .. targetPlayerName .. ". (" .. hours .. ")", root, 255,0,0)
						outputChatBox("[BAN] Reason: " .. reason .. ".", root, 255,0,0)
					end

 

 

 


					if string.lower(commandName) == "sban" then
						exports.global:sendMessageToAdmins("[SILENT-BAN] " .. adminTitle .. " silently banned " .. targetPlayerName .. ". (" .. hours .. ")")
						exports.global:sendMessageToAdmins("[SILENT-BAN] Reason: " .. reason .. ".")
					elseif string.lower(commandName) == "forceapp" then
						outputChatBox("[FA] "..adminTitle .. " " .. playerName .. " forced app " .. targetPlayerName .. ".", root, 255,0,0, true)
						hours = "Permanent"
						reason = "Failure to meet server standard. Please improve yourself then appeal on forums.owlgaming.net"
						outputChatBox("[FA]: Reason: " .. reason .. "." ,root, 255,0,0, true)
					else
						outputChatBox("[BAN] " .. adminTitle .. " banned " .. targetPlayerName .. ". (" .. hours .. ")", root, 255,0,0, true)
						outputChatBox("[BAN] Reason: " .. reason .. ".", root, 255,0,0, true)
					end

 

م ضبط الكود

 حطيت الكود كامل فوق

Link to comment
6 minutes ago, i,xAhmed said:

م ضبط الكود

 حطيت الكود كامل فوق

function banAPlayer(thePlayer, commandName, targetPlayer, hours, ...)
	if exports["integration"]:isPlayerTrialAdmin(thePlayer) then
		if not (targetPlayer) or not (hours) or not tonumber(hours) or tonumber(hours)<0 or not (...) then
			outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick / ID] [Time in Hours, 0 = Infinite] [Reason]", thePlayer, 255, 194, 14, true)
		else
			local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
			local targetPlayerSerial = getPlayerSerial(targetPlayer)
			local targetPlayerIP = getPlayerIP(targetPlayer)
			hours = tonumber(hours)

			if not (targetPlayer) then
			elseif (hours>168) then
				outputChatBox("You cannot ban for more than 7 days (168 Hours).", thePlayer, 255, 194, 14, true)
			else
				local thePlayerPower = exports.global:getPlayerAdminLevel(thePlayer)
				local targetPlayerPower = exports.global:getPlayerAdminLevel(targetPlayer)
				reason = table.concat({...}, " ")

				if (targetPlayerPower <= thePlayerPower) then -- Check the admin isn't banning someone higher rank them him
					local hiddenAdmin = getElementData(thePlayer, "hiddenadmin")
					local playerName = getPlayerName(thePlayer)
					local accountID = getElementData(targetPlayer, "account:id")
					local username = getElementData(targetPlayer, "account:username") or "N/A"

					local seconds = ((hours*60)*60)
					local rhours = hours
					-- text value
					if (hours==0) then
						hours = "Permanent"
					elseif (hours==1) then
						hours = "1 Hour"
					else
						hours = hours .. " Hours"
					end

					if hours == "Permanent" then
						reason = reason .. " (" .. hours .. ")"
					else
						reason = reason .. " (" .. hours .. ")"
					end

					
					exports['admin-system']:addAdminHistory(targetPlayer, thePlayer, reason, 2 , rhours)
					local banId = nil
					if (seconds == 0) then
						banId = addToBan(accountID, targetPlayerSerial, targetPlayerIP, getElementData(thePlayer, "account:id"), reason)
						if banId and tonumber(banId) then
							lastBan = mysql:query_fetch_assoc("SELECT * FROM bans WHERE id='"..banId.."'")
							if lastBanTimer and isTimer(lastBanTimer) then
								killTimer(lastBanTimer)
								lastBanTimer = nil
							end
							lastBanTimer = setTimer(function()
								lastBan = nil
							end, 1000*60*5,1) --5 minutes
						end
					else
						addBan(nil, nil, targetPlayerSerial, thePlayer, reason, seconds)
					end

					local adminUsername = getElementData(thePlayer, "account:username")
					local adminUserID = getElementData(thePlayer, "account:id")
					local adminTitle = exports.global:getPlayerAdminTitle(thePlayer)
					makeForumThread(targetPlayerName or "N/A", username, hours, adminTitle , playerName, thePlayer, reason, adminUsername, adminUserID, banId )
					for key, value in ipairs(getElementsByType("player")) do
						if getPlayerSerial(value) == targetPlayerSerial then
							kickPlayer(value, thePlayer, reason)
						end
					end

					adminTitle = exports.global:getAdminTitle1(thePlayer)
					if (hiddenAdmin==1) then
						adminTitle = "A hidden admin"
					end

					if string.lower(commandName) == "sban" then
						exports.global:sendMessageToAdmins("[SILENT-BAN] " .. adminTitle .. " silently banned " .. targetPlayerName .. ". (" .. hours .. ")")
						exports.global:sendMessageToAdmins("[SILENT-BAN] Reason: " .. reason .. ".")
					elseif string.lower(commandName) == "forceapp" then
						outputChatBox("[FA] "..adminTitle .. " " .. playerName .. " forced app " .. targetPlayerName .. ".", root, 255,0,0, true )
						hours = "Permanent"
						reason = "Failure to meet server standard. Please improve yourself then appeal on forums"
						outputChatBox("[FA]: Reason: " .. reason .. "." ,root, 255,0,0, true)
					else
						outputChatBox("[BAN] " .. adminTitle .. " banned " .. targetPlayerName .. ". (" .. hours .. ")", root, 255,0,0, true)
						outputChatBox("[BAN] Reason: " .. reason .. ".", root, 255,0,0, true)
					end
			end
		end
	end
end
end
addCommandHandler("pban", banAPlayer, false, false)
addCommandHandler("sban", banAPlayer, false, false)

 

Link to comment

لم تزبط معنا :( , اخ

8 minutes ago, +Source|> said:

function banAPlayer(thePlayer, commandName, targetPlayer, hours, ...)	if exports["integration"]:isPlayerTrialAdmin(thePlayer) then		if not (targetPlayer) or not (hours) or not tonumber(hours) or tonumber(hours)<0 or not (...) then			outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick / ID] [Time in Hours, 0 = Infinite] [Reason]", thePlayer, 255, 194, 14, true)		else			local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)			local targetPlayerSerial = getPlayerSerial(targetPlayer)			local targetPlayerIP = getPlayerIP(targetPlayer)			hours = tonumber(hours)			if not (targetPlayer) then			elseif (hours>168) then				outputChatBox("You cannot ban for more than 7 days (168 Hours).", thePlayer, 255, 194, 14, true)			else				local thePlayerPower = exports.global:getPlayerAdminLevel(thePlayer)				local targetPlayerPower = exports.global:getPlayerAdminLevel(targetPlayer)				reason = table.concat({...}, " ")				if (targetPlayerPower <= thePlayerPower) then -- Check the admin isn't banning someone higher rank them him					local hiddenAdmin = getElementData(thePlayer, "hiddenadmin")					local playerName = getPlayerName(thePlayer)					local accountID = getElementData(targetPlayer, "account:id")					local username = getElementData(targetPlayer, "account:username") or "N/A"					local seconds = ((hours*60)*60)					local rhours = hours					-- text value					if (hours==0) then						hours = "Permanent"					elseif (hours==1) then						hours = "1 Hour"					else						hours = hours .. " Hours"					end					if hours == "Permanent" then						reason = reason .. " (" .. hours .. ")"					else						reason = reason .. " (" .. hours .. ")"					end										exports['admin-system']:addAdminHistory(targetPlayer, thePlayer, reason, 2 , rhours)					local banId = nil					if (seconds == 0) then						banId = addToBan(accountID, targetPlayerSerial, targetPlayerIP, getElementData(thePlayer, "account:id"), reason)						if banId and tonumber(banId) then							lastBan = mysql:query_fetch_assoc("SELECT * FROM bans WHERE id='"..banId.."'")							if lastBanTimer and isTimer(lastBanTimer) then								killTimer(lastBanTimer)								lastBanTimer = nil							end							lastBanTimer = setTimer(function()								lastBan = nil							end, 1000*60*5,1) --5 minutes						end					else						addBan(nil, nil, targetPlayerSerial, thePlayer, reason, seconds)					end					local adminUsername = getElementData(thePlayer, "account:username")					local adminUserID = getElementData(thePlayer, "account:id")					local adminTitle = exports.global:getPlayerAdminTitle(thePlayer)					makeForumThread(targetPlayerName or "N/A", username, hours, adminTitle , playerName, thePlayer, reason, adminUsername, adminUserID, banId )					for key, value in ipairs(getElementsByType("player")) do						if getPlayerSerial(value) == targetPlayerSerial then							kickPlayer(value, thePlayer, reason)						end					end					adminTitle = exports.global:getAdminTitle1(thePlayer)					if (hiddenAdmin==1) then						adminTitle = "A hidden admin"					end					if string.lower(commandName) == "sban" then						exports.global:sendMessageToAdmins("[SILENT-BAN] " .. adminTitle .. " silently banned " .. targetPlayerName .. ". (" .. hours .. ")")						exports.global:sendMessageToAdmins("[SILENT-BAN] Reason: " .. reason .. ".")					elseif string.lower(commandName) == "forceapp" then						outputChatBox("[FA] "..adminTitle .. " " .. playerName .. " forced app " .. targetPlayerName .. ".", root, 255,0,0, true )						hours = "Permanent"						reason = "Failure to meet server standard. Please improve yourself then appeal on forums"						outputChatBox("[FA]: Reason: " .. reason .. "." ,root, 255,0,0, true)					else						outputChatBox("[BAN] " .. adminTitle .. " banned " .. targetPlayerName .. ". (" .. hours .. ")", root, 255,0,0, true)						outputChatBox("[BAN] Reason: " .. reason .. ".", root, 255,0,0, true)					end			end		end	endendendaddCommandHandler("pban", banAPlayer, false, false)addCommandHandler("sban", banAPlayer, false, false)

 

م ضبط يبند الشخص وكل شي بس السبب م يطلع بالشات للكل

Link to comment
1 hour ago, i,xAhmed said:

ابي السبب يجي بالشات للكل حتى اللاعبين

function banAPlayer(thePlayer, commandName, targetPlayer, hours, ...)
	if exports["integration"]:isPlayerTrialAdmin(thePlayer) then
		if not (targetPlayer) or not (hours) or not tonumber(hours) or tonumber(hours)<0 or not (...) then
			outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick / ID] [Time in Hours, 0 = Infinite] [Reason]", thePlayer, 255, 194, 14, true)
		else
			local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
			local targetPlayerSerial = getPlayerSerial(targetPlayer)
			local targetPlayerIP = getPlayerIP(targetPlayer)
			hours = tonumber(hours)

			if not (targetPlayer) then
			elseif (hours>168) then
				outputChatBox("You cannot ban for more than 7 days (168 Hours).", thePlayer, 255, 194, 14, true)
			else
				local thePlayerPower = exports.global:getPlayerAdminLevel(thePlayer)
				local targetPlayerPower = exports.global:getPlayerAdminLevel(targetPlayer)
				reason = table.concat({...}, " ")

				if (targetPlayerPower <= thePlayerPower) then -- Check the admin isn't banning someone higher rank them him
					local hiddenAdmin = getElementData(thePlayer, "hiddenadmin")
					local playerName = getPlayerName(thePlayer)
					local accountID = getElementData(targetPlayer, "account:id")
					local username = getElementData(targetPlayer, "account:username") or "N/A"

					local seconds = ((hours*60)*60)
					local rhours = hours
					-- text value
					if (hours==0) then
						hours = "Permanent"
					elseif (hours==1) then
						hours = "1 Hour"
					else
						hours = hours .. " Hours"
					end

					if hours == "Permanent" then
						reason = reason .. " (" .. hours .. ")"
					else
						reason = reason .. " (" .. hours .. ")"
					end

					
					exports['admin-system']:addAdminHistory(targetPlayer, thePlayer, reason, 2 , rhours)
					local banId = nil
					if (seconds == 0) then
						banId = addToBan(accountID, targetPlayerSerial, targetPlayerIP, getElementData(thePlayer, "account:id"), reason)
						if banId and tonumber(banId) then
							lastBan = mysql:query_fetch_assoc("SELECT * FROM bans WHERE id='"..banId.."'")
							if lastBanTimer and isTimer(lastBanTimer) then
								killTimer(lastBanTimer)
								lastBanTimer = nil
							end
							lastBanTimer = setTimer(function()
								lastBan = nil
							end, 1000*60*5,1) --5 minutes
						end
					else
						addBan(nil, nil, targetPlayerSerial, thePlayer, reason, seconds)
					end

					local adminUsername = getElementData(thePlayer, "account:username")
					local adminUserID = getElementData(thePlayer, "account:id")
					local adminTitle = exports.global:getPlayerAdminTitle(thePlayer)
					makeForumThread(targetPlayerName or "N/A", username, hours, adminTitle , playerName, thePlayer, reason, adminUsername, adminUserID, banId )
					for key, value in ipairs(getElementsByType("player")) do
						if getPlayerSerial(value) == targetPlayerSerial then
							kickPlayer(value, thePlayer, reason)
						end
					end

					adminTitle = exports.global:getAdminTitle1(thePlayer)
					if (hiddenAdmin==1) then
						adminTitle = "A hidden admin"
					end

					if string.lower(commandName) == "sban" then
						exports.global:sendMessageToAdmins("[SILENT-BAN] " .. adminTitle .. " silently banned " .. targetPlayerName .. ". (" .. hours .. ")")
						exports.global:sendMessageToAdmins("[SILENT-BAN] Reason: " .. reason .. ".")
					elseif string.lower(commandName) == "forceapp" then
						outputChatBox("[FA] "..adminTitle .. " " .. playerName .. " forced app " .. targetPlayerName .. ".", value, 255,0,0, true )
						hours = "Permanent"
						reason = "Failure to meet server standard. Please improve yourself then appeal on forums"
						outputChatBox("[FA]: Reason: " .. reason .. "." ,root, 255,0,0, true)
					else
						outputChatBox("[BAN] " .. adminTitle .. " banned " .. targetPlayerName .. ". (" .. hours .. ")", value, 255,0,0, true)
						outputChatBox("[BAN] Reason: " .. reason .. ".", value, 255,0,0, true)
					end
			end
		end
	end
end
end
addCommandHandler("pban", banAPlayer, false, false)
addCommandHandler("sban", banAPlayer, false, false)

جرب

Link to comment

لا تعدل اكواد ولا اشي

روح ملف لوحة الادمنية

بعدها confg

بعدها messages.xml

بعد ما تخش الملف

ابحث عن

    <group action="ban" r="255" g="0" b="0">
      <all>$player has been banned$by_admin_4all. $data2</all>
      <log>ADMIN: $admin has banned $player $data $data2</log>
    </group>

لحين كيف تطلع السبب فالشات؟؟؟

حد $data2

نحط $data

او تبدل الكود بهذا

    <group action="ban" r="255" g="0" b="0">
      <all>$player has been banned$by_admin_4all. $data2 $data</all>
      <log>ADMIN: $admin has banned $player $data $data2</log>
    </group>

 

Link to comment

تفضل , و لو تبي اي شي تعال واتساب انا موجود ;)
 

function banAPlayer(thePlayer, commandName, targetPlayer, hours, ...)
	if exports["integration"]:isPlayerTrialAdmin(thePlayer) then
		if not (targetPlayer) or not (hours) or not tonumber(hours) or tonumber(hours)<0 or not (...) then
			outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick / ID] [Time in Hours, 0 = Infinite] [Reason]", thePlayer, 255, 194, 14)
		else
			local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer)
			local targetPlayerSerial = getPlayerSerial(targetPlayer)
			local targetPlayerIP = getPlayerIP(targetPlayer)
			hours = tonumber(hours)

			if not (targetPlayer) then
			elseif (hours>168) then
				outputChatBox("You cannot ban for more than 7 days (168 Hours).", thePlayer, 255, 194, 14)
			else
				local thePlayerPower = exports.global:getPlayerAdminLevel(thePlayer)
				local targetPlayerPower = exports.global:getPlayerAdminLevel(targetPlayer)
				reason = table.concat({...}, " ")

				if (targetPlayerPower <= thePlayerPower) then -- Check the admin isn't banning someone higher rank them him
					local hiddenAdmin = getElementData(thePlayer, "hiddenadmin")
					local playerName = getPlayerName(thePlayer)
					local accountID = getElementData(targetPlayer, "account:id")
					local username = getElementData(targetPlayer, "account:username") or "N/A"

					local seconds = ((hours*60)*60)
					local rhours = hours
					-- text value
					if (hours==0) then
						hours = "Permanent"
					elseif (hours==1) then
						hours = "1 Hour"
					else
						hours = hours .. " Hours"
					end

					if hours == "Permanent" then
						reason = reason .. " (" .. hours .. ")"
					else
						reason = reason .. " (" .. hours .. ")"
					end

					
					exports['admin-system']:addAdminHistory(targetPlayer, thePlayer, reason, 2 , rhours)
					adminTitlexx = exports.global:getAdminTitle1(thePlayer)
					outputChatBox("[PLAYER-BAN] " .. adminTitlexx .. " banned " .. getPlayerName(targetPlayer) .. ". (" .. rhours .. ")",root,255,0,0)
                   outputChatBox("Reason : "..reason,root,255,0,0)
					local banId = nil
					if (seconds == 0) then
						banId = addToBan(accountID, targetPlayerSerial, targetPlayerIP, getElementData(thePlayer, "account:id"), reason)
						if banId and tonumber(banId) then
							lastBan = mysql:query_fetch_assoc("SELECT * FROM bans WHERE id='"..banId.."'")
							if lastBanTimer and isTimer(lastBanTimer) then
								killTimer(lastBanTimer)
								lastBanTimer = nil
							end
							lastBanTimer = setTimer(function()
								lastBan = nil
							end, 1000*60*5,1) --5 minutes
						end
					else
					adminTitlex = exports.global:getAdminTitle1(thePlayer)
             outputChatBox("[PLAYER-BAN] " .. adminTitlex .. " banned " .. targetPlayerName .. ". (" .. seconds .. ")",root,255,0,0)
              outputChatBox("Reason : "..reason,root,255,0,0)
						addBan(nil, nil, targetPlayerSerial, thePlayer, reason, seconds)
					end

					local adminUsername = getElementData(thePlayer, "account:username")
					local adminUserID = getElementData(thePlayer, "account:id")
					local adminTitle = exports.global:getPlayerAdminTitle(thePlayer)
					makeForumThread(targetPlayerName or "N/A", username, hours, adminTitle , playerName, thePlayer, reason, adminUsername, adminUserID, banId )
					for key, value in ipairs(getElementsByType("player")) do
						if getPlayerSerial(value) == targetPlayerSerial then
							kickPlayer(value, thePlayer, reason)
						end
					end

					adminTitle = exports.global:getAdminTitle1(thePlayer)
					if (hiddenAdmin==1) then
						adminTitle = "A hidden admin"
					end

					if string.lower(commandName) == "sban" then
						outputChatBox("[SILENT-BAN] " .. adminTitle .. " silently banned " .. targetPlayerName .. ". (" .. hours .. ")",root,255,0,0)
						outputChatBox("Reason: " .. reason .. ".",root,255,0,0)
					elseif string.lower(commandName) == "forceapp" then
						outputChatBox("[FA] "..adminTitle .. " " .. playerName .. " forced app " .. targetPlayerName .. ".", root, 255,0,0,)
						hours = "Permanent"
						reason = "Failure to meet server standard. Please improve yourself then appeal on forums"
						outputChatBox("[FA]: Reason: " .. reason .. "." ,root, 255,0,0, true)
					else
						outputChatBox("[BAN] " .. adminTitle .. " banned " .. targetPlayerName .. ". (" .. hours .. ")", root, 255,0,0)
						outputChatBox("[BAN] Reason: " .. reason .. ".", root, 255,0,0, true)
					end
			end
		end
	end
end
end
addCommandHandler("pban", banAPlayer, false, false)
addCommandHandler("sban", banAPlayer, false, false)

 

Edited by AbU - W6N
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...