Jump to content

تصحيح خطا رقم 3


Recommended Posts

شباب الحين انا ابي اسوي داتا على كل اللاعبين ما عدا الكونسل فقطط

function masternewip()
for i, v in ipairs( getElementsByType( 'player' ) ) do
if not isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Console")) then
setElementData(v"chatClose")
end
end

end

addCommandHandler("closechat",masternewip)

وش الخطا

Link to comment
function masternewip(  )
	for i, v in ipairs( getElementsByType( 'player' ) ) do
		if ( not isObjectInACLGroup( 'user.' .. getAccountName( getPlayerAccount( v ) ), aclGetGroup( 'Console' ) ) ) then
			setElementData(v, 'chatClose', 'value' )
				-- value قم بتغيير هذه القيمة للقيمة المراد وضعها للدانا .
		end
	end
end

addCommandHandler( 'closechat', masternewip )

 

Link to comment
10 minutes ago, MR.GRAND said:

function masternewip(  )
	for i, v in ipairs( getElementsByType( 'player' ) ) do
		if ( not isObjectInACLGroup( 'user.' .. getAccountName( getPlayerAccount( v ) ), aclGetGroup( 'Console' ) ) ) then
			setElementData(v, 'chatClose', 'value' )
				-- value قم بتغيير هذه القيمة للقيمة المراد وضعها للدانا .
		end
	end
end

addCommandHandler( 'closechat', masternewip )

 

ما فهمت عليك

فهمت بس انا ابي احطها على اللاعب لما يجي يكلم لو عليه داتا ما يقدر يتكلم في الشات

فوش احط المتغير

@MR.GRAND

Edited by Master_MTA
Link to comment
addCommandHandler ( 'closechat',
	function (		)
	for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do
		if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then
			setElementData ( aPlayer,'chatclose',true );
		end
	end
end
);

addEventHandler ( 'onPlayerChat',root,
	function (		)
		if getElementData ( source,'chatclose' ) then
			cancelEvent (  );
		end
	end
);

 

كذا اذا كان الاعب معه الداتا وجا يتكلم بالشات يتكنسل الحدث ومايتكلم بس تاكد انة ماعندك مود تاج او شيء ثاني اذا عندك لازم تعدله وتسوي تحقق الداتا وتكنسلة

Link to comment
8 hours ago, Kara said:

if (getElementData ( source,'chatclose' ) == true ) then

 

 

اممم افهم من كلامكـ انة كودي غير صحيح؟ 

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

يقدر يحدد هو او يقدر يرجع يشيلها وخلاص بيشتغل زي العسل 

  • Like 1
Link to comment
11 hours ago, iPrestege said:

addCommandHandler ( 'closechat',
	function (		)
	for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do
		if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then
			setElementData ( aPlayer,'chatclose',true );
		end
	end
end
);

addEventHandler ( 'onPlayerChat',root,
	function (		)
		if getElementData ( source,'chatclose' ) then
			cancelEvent (  );
		end
	end
);

 

كذا اذا كان الاعب معه الداتا وجا يتكلم بالشات يتكنسل الحدث ومايتكلم بس تاكد انة ماعندك مود تاج او شيء ثاني اذا عندك لازم تعدله وتسوي تحقق الداتا وتكنسلة

يعطيك العافيه حبيب قلبي والله +_+

بس مو المفروض اضيف بين اقواس الفنكشن aPlayer

@iPrestege

Edited by Master_MTA
Link to comment
53 minutes ago, Master_MTA said:

يعطيك العافيه حبيب قلبي والله +_+

بس مو المفروض اضيف بين اقواس الفنكشن aPlayer

@iPrestege

طيب شباب وش الخطا هنا

 

addEvent("closechatmaster",true)
addEventHandler('closechatmaster',root, alichat1)
	function alichat1 (		)
	for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do
		if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then
			setElementData ( aPlayer,'chatclose',true );
		end
	end
end




addEvent("openchatmaster",true)
addEventHandler('openchatmaster', root,alichat)
	function alichat (		)
	for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do
		if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then
			removeElementData ( aPlayer,'chatclose' );
		end
	end
end

سويتلها تراقر من الكلنت كذا

 

addEventHandler ( "onClientGUIClick",root,
	
	function()
	
	if source == closeaam then
	
	triggerServerEvent(localPlayer,"closechatmaster",localPlayer)
	
	
	elseif source == openaam then
	
	
		triggerServerEvent(localPlayer,"openchatmaster",localPlayer)

	
	
	
	
	
	
	end
	
	end
	)

@iPrestege

@3NAD

@</Mr.Tn6eL>

@Abdul KariM

@Default

@-ffs-Sniper

Edited by Master_MTA
Link to comment

جرب هاذا 

-- # Client Side .. 

addEventHandler ( "onClientGUIClick",root,function ( )
if source == closeaam then
triggerServerEvent("closechatmaster",localPlayer)
elseif source == openaam then
triggerServerEvent("openchatmaster",localPlayer)
end
end );

-- # Server Side ..
addEventHandler ( "closechatmaster" , true )
addEventHandler ( "closechatmaster" , root , function ( )
for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do
if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then
setElementData ( aPlayer,'chatclose',true );
end
end
end );

addEventHandler ( "openchatmaster" , true )
addEventHandler ( "openchatmaster" , root , function ( )
for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do
if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then
removeElementData ( aPlayer , "chatclose" )
end
end
end );

 

Link to comment
6 minutes ago, Default said:

جرب هاذا 


-- # Client Side .. 

addEventHandler ( "onClientGUIClick",root,function ( )
if source == closeaam then
triggerServerEvent("closechatmaster",localPlayer)
elseif source == openaam then
triggerServerEvent("openchatmaster",localPlayer)
end
end );

-- # Server Side ..
addEventHandler ( "closechatmaster" , true )
addEventHandler ( "closechatmaster" , root , function ( )
for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do
if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then
setElementData ( aPlayer,'chatclose',true );
end
end
end );

addEventHandler ( "openchatmaster" , true )
addEventHandler ( "openchatmaster" , root , function ( )
for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do
if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then
removeElementData ( aPlayer , "chatclose" )
end
end
end );

 

مو زابط يا غالي

شفت الدي بق

لقيته

يقول ماستر اللي هو اانا سوا  تراقر للسيررفر لكن القيمه غير موجوده

 

@Default

Link to comment
 showChat
    -- # Client Side .. 

    addEventHandler ( "onClientGUIClick",root,function ( )
    if source == closeaam then
    triggerServerEvent("closechatmaster",localPlayer)
    elseif source == openaam then
    triggerServerEvent("openchatmaster",localPlayer)
    end
    end );

    -- # Server Side ..
    addEventHandler ( "closechatmaster" , true )
    addEventHandler ( "closechatmaster" , root , function ( )
    for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do
    if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then
  showChat ( aPlayer, false )
    end
    end
    end );

    addEventHandler ( "openchatmaster" , true )
    addEventHandler ( "openchatmaster" , root , function ( )
    for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do
    if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then
     showChat ( aPlayer, true )
    end
    end
    end );

 

Edited by medo7
! ^showChat
Link to comment

Clinet : 

addEventHandler ( "onClientGUIClick",root,

	function ( )

	if ( source == closeaam ) then

	triggerServerEvent( "Changechatmaster", localPlayer , true )

	elseif ( source == openaam ) then

	triggerServerEvent( "Changechatmaster", localPlayer , false )
		end
	end 
	);

 

Server : 

 

addEvent ( "Changechatmaster" , true )

addEventHandler ( "Changechatmaster" , root ,

	function ( aState )

	if ( aState ) then
	
	for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do

	if ( not isGuestAccount ( getPlayerAccount ( aPlayer ) ) ) then
	
	if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then

	setElementData ( aPlayer,'chatclose', aState )
					end
				end
			end
		end
	end 
	);

 

Edited by Abdul KariM
Link to comment
1 hour ago, Abdul KariM said:

Clinet : 


addEventHandler ( "onClientGUIClick",root,

	function ( )

	if ( source == closeaam ) then

	triggerServerEvent( "Changechatmaster", localPlayer , true )

	elseif ( source == openaam ) then

	triggerServerEvent( "Changechatmaster", localPlayer , false )
		end
	end 
	);

 

Server : 

 


addEvent ( "Changechatmaster" , true )

addEventHandler ( "Changechatmaster" , root ,

	function ( aState )

	if ( aState ) then
	
	for _,aPlayer in ipairs( getElementsByType( 'player' ) ) do

	if ( not isGuestAccount ( getPlayerAccount ( aPlayer ) ) ) then
	
	if not isObjectInACLGroup( 'user.'..getAccountName ( getPlayerAccount ( aPlayer ) ),aclGetGroup ( 'Console' ) ) then

	setElementData ( aPlayer,'chatclose', aState )
					end
				end
			end
		end
	end 
	);

 

@Abdul KariM

ما زبط يا غالي

Link to comment
3 minutes ago, Abdul KariM said:

مستحيل تأكد انك مسجل دخول وانك مانت كونسل 

 

هههههههههههههههه يعطيك العافيه كنت ناسي اسوي حفظ للملف هههههههههه

بس في شي يوم اضغط على الزر الثاني ما يزبط

@Abdul KariM

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