Jump to content

ينقفل العاجل ولا يقدر آي احد يكتب لما يجي شخص يكتب العاجل يطلع بشات العاجل مقفل حليا لازم يرجع الصاحب السيرفر ويكتب الكلمه على شن يفتح xDسلام عليكم بدي كود يقفل العاجل كيف ؟ لما تكتب بي اف8 مثال


Recommended Posts

 
addCommandHandler("قفل", function( plr )
 local acc = getPlayerAccount( plr )
 local accName = getAccountName ( acc )
 if isGuestAccount(acc) then return end
 if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then 
if ( getElementData(plr, "ChatL") == true ) then
setElementData(plr, "ChatL", false)
outputChatBox("تم اغلاق العاجل",root,255,0,0,true) 
else
setElementData(plr, "ChatL", true)
outputChatBox("تم فتح العاجل",root,255,0,0,true)             
end 
else
outputChatBox ("You ! :o",plr,255,255,255,true)
end
end)

addCommandHandler("IM",function ( source,_,...)
if ( getElementData(source, "ChatL") == false ) then return outputChatBox("مغلق",source,255,0,0,true) end
local msg = table.concat({...} , " ")
if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)),aclGetGroup ('Console')) or
 isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)),aclGetGroup ('Msg')) or nil then
setElementData(resourceRoot,"Msg_",msg)
setElementData(resourceRoot,"Have_",true)
setElementData(resourceRoot,"By_",getPlayerName(source))
else
outputChatBox("انت لست ادمن",source,255,0,0,true) 
end
end)

 

Edited by #\_oskar_/#
Link to comment
  • Replies 53
  • Created
  • Last Reply

Top Posters In This Topic

 local allowedGroups = {"Console", "Msg"} --الكتابة فالعاجل
 
 addCommandHandler("قفل", function( plr )
 local acc = getPlayerAccount( plr )
 local accName = getAccountName ( acc )
 if isGuestAccount(acc) then return end
 if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then 
if ( getElementData(plr, "ChatL") == true ) then
setElementData(plr, "ChatL", false)
OutPut("تم اغلاق العاجل",root,255,0,0,true) 
addEventHandler("onPlayerDamage",root,plr)
addEventHandler("onClientPlayerDamage", localPlayer, cancelEvent)
else
setElementData(plr, "ChatL", true)
OutPut("تم فتح العاجل",root,255,0,0,true)      
addEventHandler("onPlayerDamage",root,plr)
addEventHandler("onClientPlayerDamage", localPlayer, cancelEvent)       
end 
else
end
end)

addCommandHandler("IM",function ( source,_,...)
if ( getElementData(source, "ChatL") == false ) then return outputChatBox("مغلق",source,255,0,0,true) end
local msg = table.concat({...} , " ")
if i, v in ipairs(allowedGroups) do
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup(v)) then
setElementData(resourceRoot,"Msg_",msg)
setElementData(resourceRoot,"Have_",true)
setElementData(resourceRoot,"By_",getPlayerName(source))
else
end
end)

وش الخطا؟

Link to comment
  • 4 weeks later...
On 2/7/2018 at 15:26, Rakan# said:

 
addCommandHandler("قفل", function( plr )
 local acc = getPlayerAccount( plr )
 local accName = getAccountName ( acc )
 if isGuestAccount(acc) then return end
 if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) 
 or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Msg" ) ) 
 then ---- الرتبة الي تقدر تقفل وتفك العاجل
 if ( getElementData(plr, "ChatL") == true ) then
 setElementData(plr, "ChatL", false)
 outputChatBox("تم اغلاق العاجل",root,255,0,0,true) 
 else
 setElementData(plr, "ChatL", true)
 outputChatBox("تم فتح العاجل",root,255,0,0,true) 
 			end 
 else
 outputChatBox (":O You :!",plr,255,0,0,true)
 		end
 	end 
)
		
addCommandHandler("IM",
		function ( source,_,...)
		 if ( getElementData(source, "ChatL") == true ) then
		    local msg = table.concat({...} , " ")
			
		 if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) 
 or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Msg" ) ) 
 then ---- الرتبة الي تقدر تتكلم بالعاجل حتى لو مقفل
		setElementData(resourceRoot,"Msg_",msg)
		setElementData(resourceRoot,"Have_",true)
		setElementData(resourceRoot,"By_",getPlayerName(source))
		 else
  outputChatBox("لاتملك الصلاحية للكتابة هنا",source,255,0,0,true) 
		end
		else
		outputChatBox("مغلق",source,255,0,0,true)
		end
end)
--Client

تفضل

كويس كملت بعدي ض2: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...