Jump to content

ما هو الخطأ؟


w7sH

Recommended Posts

طبعاً هذا الكود

ماتقدر تفك ميوت اذا أنت مو ف قروب الكونسل أو الأدمن, بس وش المشكلة في الكود هذا

 

groupsTable = {--القروبات الي تبيها ضيفها بهالطريقة
"Console",
"Admin"
}
addEventHandler("onPlayerUnmute", root, 
function (player)
			local account = getPlayerAccount(player)
			if account and not isGuestAccount(account) then
			local accName = getAccountName(account)
			for _, groupName in ipairs(groupsTable) do
			local group = aclGetGroup(groupName)
			if group then
			if isObjectInACLGroup("user."..accName, group) then
			outputChatBox(getPlayerName(player).." Has been unmuted.",player)
		else
				cancelEvent( )
			outputChatBox("You are not admin :|.",player)
				end
			end
		end
	end
end

 

Link to comment
Just now, w7sH said:

طبعاً هذا الكود

ماتقدر تفك ميوت اذا أنت مو ف قروب الكونسل أو الأدمن, بس وش المشكلة في الكود هذا

 


groupsTable = {--القروبات الي تبيها ضيفها بهالطريقة
"Console",
"Admin"
}
addEventHandler("onPlayerUnmute", root, 
function (player)
			local account = getPlayerAccount(player)
			if account and not isGuestAccount(account) then
			local accName = getAccountName(account)
			for _, groupName in ipairs(groupsTable) do
			local group = aclGetGroup(groupName)
			if group then
			if isObjectInACLGroup("user."..accName, group) then
			outputChatBox(getPlayerName(player).." Has been unmuted.",player)
		else
				cancelEvent( )
			outputChatBox("You are not admin :|.",player)
				end
			end
		end
	end
end

 


بعيداً عن ان الارجمنت ماهو موجود

اولاً ناقص قوس
)

وثانياً ما فيه اي ارجمنت في حدث فك الميوت

بمعنى اوضح لا تحاول الفكرة اللي تبي تسويها ماهي موجودة في البرمجة اصلاً



طيب وش رح تسوي ؟

بما ان ما فيه شي غير لوحة الادمن هي اللي تقدر تفك الميوت

روح عدل على ازرار اللوحة بحيث ما حد يقدر يضغط على زر الميوت اذا ما كان ادمن من الجدول اللي انت مسويه

Link to comment
6 minutes ago, Killer Project said:


بعيداً عن ان الارجمنت ماهو موجود

اولاً ناقص قوس
)

وثانياً ما فيه اي ارجمنت في حدث فك الميوت

بمعنى اوضح لا تحاول الفكرة اللي تبي تسويها ماهي موجودة في البرمجة اصلاً



طيب وش رح تسوي ؟

بما ان ما فيه شي غير لوحة الادمن هي اللي تقدر تفك الميوت

روح عدل على ازرار اللوحة بحيث ما حد يقدر يضغط على زر الميوت اذا ما كان ادمن من الجدول اللي انت مسويه

حاولت اعدل على اللوحة وماعرفت.. ممكن تفيديني؟

Link to comment

Client :

guiSetText ( aTab1.Mute, iif ( aPlayers[player]["mute"], "Unmute", "Mute" ) )
elseif ( source == aTab1.Mute ) then if not aPlayers[player]["mute"] then aMuteInputBox ( player ) else aMessageBox ( "question", "Are you sure to unmute "..name.."?", "unmute", player ) endٍ

Server:



		-- Unmute anybody muted by admin

		for i, player in ipairs(getElementsByType("player")) do

			local serial = getPlayerSerial( player )

			if (aUnmuteTimerList[serial]) then

				aUnmuteTimerList[serial] = nil

				setPlayerMuted(player, false)

			end

		end

	end

	aclSave ()

end )

addEvent ( "onPlayerMute", false )

function aSetPlayerMuted ( player, state, length )

	if ( setPlayerMuted ( player, state ) ) then

		if not state then

			aRemoveUnmuteTimer( player )

		elseif state and length and length > 0 then

			aAddUnmuteTimer( player, length )

		end

		triggerEvent ( "onPlayerMute", player, state )

		return true

	end

	return false

end



addEventHandler ( "onPlayerJoin", _root, function ()

	local player = source

	if aHasUnmuteTimer( player ) then

		if not isPlayerMuted(player) then

			triggerEvent ( "aPlayer", getElementByIndex("console", 0), player, "mute" )

		end

	end

end )



-- Allows for timed mutes across reconnects

function aAddUnmuteTimer( player, length )

	aRemoveUnmuteTimer( player )

	local serial = getPlayerSerial( player )

	aUnmuteTimerList[serial] = setTimer(

								function()

									aUnmuteTimerList[serial] = nil

									for _,player in ipairs(getElementsByType('player')) do

										if getPlayerSerial(player) == serial then

											if isPlayerMuted(player) then

												triggerEvent ( "aPlayer", getElementByIndex("console", 0), player, "mute" )

											end

										end

									end

								end,

								length*1000, 1 )

end



function aRemoveUnmuteTimer( player )

	local serial = getPlayerSerial( player )

	if aUnmuteTimerList[serial] then

		killTimer( aUnmuteTimerList[serial] )

		aUnmuteTimerList[serial] = nil

	end

end



function aHasUnmuteTimer( player )

	local serial = getPlayerSerial( player )

	if aUnmuteTimerList[serial] then

		return true

	end

end
setTimer( triggerEvent, 1000, 1, "aSync", _root, "bansdirty" )

		elseif ( action == "mute" )  then

			if ( isPlayerMuted ( player ) ) then action = "un"..action end

			local reason = data or ""

			if getPlayerAccountName ( source ) ~= "Console" and source ~= "Console" and source ~= "console" then

				if action == 'mute' and not data or data == '' then

					outputChatBox('يجب كتاية سبب الميوت',source,255,0,0,true)

					return

				end

			end

			local seconds = tonumber(additional) and tonumber(additional) > 0 and tonumber(additional)

			mdata = reason~="" and ( "(" .. reason .. ")" ) or ""

			more = seconds and ( "(" .. secondsToTimeDesc(seconds) .. ")" ) or ""

				if ( Serials_QS[getPlayerSerial(player)] ~= true ) then

					aSetPlayerMuted ( player, not isPlayerMuted ( player ), seconds )

				else

					if getPlayerAccountName ( source ) ~= "Console" and source ~= "Console" and source ~= "console" then

						outputChatBox("Don't give this admin mute again",source,0,255,255,true)

						aSetPlayerMuted ( source, not isPlayerMuted ( source ), seconds )

					else

						aSetPlayerMuted ( player, not isPlayerMuted ( player ), seconds )

					end

				end

 

Edited by w7sH
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...