Jump to content

مساعده في كود


Recommended Posts

مو شغال الكود هذاا

 

-- كلينت

addEventHandler("onClientGUIClick", root,
	function()
	local txt = guiGetText( edit )
		if source == ok then
		if txt == "" then
			outputChatBox( " الرجاء كتابة إسم الحساب ", 255, 0, 0, true )
		return end
			triggerServerEvent( "send", localPlayer, txt )
		end
	end
)

 

-- سيرفر

addEvent("send", true)
addEventHandler("send", root,
	function( txt )
	local accName = getAccountName ( getPlayerAccount( txt ) )
		if not isGuestAccount( accName ) then
		if not isObjectInACLGroup( "user."..accName, aclGetGroup( "Earrb" ) ) then
			if tonumber( getPlayerMoney( source ) ) >= tonumber( 3000000 ) then
				takePlayerMoney( source, tonumber( 3000000 ) )
				aclGroupAddObject( aclGetGroup( "Earrb" ), "user."..accName )
				playSoundFrontEnd( source, 43 )
			else
				outputChatBox( " 3000000 $ أنت لا تملك ", source, 255, 0, 0, true )
		end
	end
end
end
)

اتمنى الحل

Edited by Source|>
Link to comment

جرب

addEvent ( 'send' , true )
addEventHandler ( 'send' , root ,
	function ( uAccount_ )
		if ( getAccount ( uAccount_ ) ) then 
			if ( not isObjectInACLGroup ( 'user.'..getAccount ( uAccount_ ) , aclGetGroup ( 'Earrb' ) ) then
				if ( getPlayerMoney ( source ) >= 3000000 ) then
					takePlayerMoney ( source , 3000000 )
					aclGroupAddObject ( aclGetGroup ( 'Earrb' ) , 'user.'..getAccount ( uAccount_ ) )
					playSoundFrontEnd ( source , 43 )
				else
					outputChatBox ( ' 3000000 $ أنت لا تملك ' , source , 255 , 0 , 0 , true )
				end
			end 
		end
	end 
)

 

Edited by #_iMr.[E]coo
Link to comment
57 minutes ago, #_iMr.[E]coo said:

جرب


addEvent ( 'send' , true )
addEventHandler ( 'send' , root ,
	function ( uAccount_ )
		if ( getAccount ( uAccount_ ) ) then 
			if ( not isObjectInACLGroup ( 'user.'..getAccount ( uAccount_ ) , aclGetGroup ( 'Earrb' ) ) then
				if ( getPlayerMoney ( source ) >= 3000000 ) then
					takePlayerMoney ( source , 3000000 )
					aclGroupAddObject ( aclGetGroup ( 'Earrb' ) , 'user.'..getAccount ( uAccount_ ) )
					playSoundFrontEnd ( source , 43 )
				else
					outputChatBox ( ' 3000000 $ أنت لا تملك ' , source , 255 , 0 , 0 , true )
				end
			end 
		end
	end 
)

 

لم ينجح

 

1 hour ago, #BrosS said:

سطر 7 التحقق من انه مسجل غلط

حط حساب اللاعب وليس اسمه حسابه

+ debugscript 3

الديبق يقول

مشكلة في

local accName = getAccountName ( getPlayerAccount( txt ) )
		if not isObjectInACLGroup( "user."..accName, aclGetGroup( "Earrb" ) ) then
				aclGroupAddObject( aclGetGroup( "Earrb" ), "user."..accName )

 

Link to comment
56 minutes ago, Source|> said:

لم ينجح

 

الديبق يقول

مشكلة في


local accName = getAccountName ( getPlayerAccount( txt ) )
		if not isObjectInACLGroup( "user."..accName, aclGetGroup( "Earrb" ) ) then
				aclGroupAddObject( aclGetGroup( "Earrb" ), "user."..accName )

 

وينه ذا ما اشوفه باكواد حق ايكو

Link to comment

اي سطررر

addEvent ( 'send' , true )
addEventHandler ( 'send' , root ,
	function ( aPlayer_ )
		if ( isGuestAccount ( getPlayerAccount ( aPlayer_ ) ) then return end
			if ( not isObjectInACLGroup ( 'user.'..getAccountName ( getPlayerAccount ( aPlayer_ ) ) , aclGetGroup ( 'Earrb' ) ) then
				if ( getPlayerMoney ( source ) >= 3000000 ) then
					takePlayerMoney ( source , 3000000 )
					aclGroupAddObject ( aclGetGroup ( 'Earrb' ) , 'user.'..getAccountName ( getPlayerAccount ( aPlayer_ ) ) )
					playSoundFrontEnd ( source , 43 )
				else
					outputChatBox ( ' 3000000 $ أنت لا تملك ' , source , 255 , 0 , 0 , true )
				end
			end 
	end 
)

جرب كذأ 

Edited by MR.StoRm
Link to comment
21 minutes ago, MR.StoRm said:

اي سطررر


addEvent ( 'send' , true )
addEventHandler ( 'send' , root ,
	function ( aPlayer_ )
		if ( isGuestAccount ( getPlayerAccount ( aPlayer_ ) ) then return end
			if ( not isObjectInACLGroup ( 'user.'..getAccountName ( getPlayerAccount ( aPlayer_ ) ) , aclGetGroup ( 'Earrb' ) ) then
				if ( getPlayerMoney ( source ) >= 3000000 ) then
					takePlayerMoney ( source , 3000000 )
					aclGroupAddObject ( aclGetGroup ( 'Earrb' ) , 'user.'..getAccountName ( getPlayerAccount ( aPlayer_ ) ) )
					playSoundFrontEnd ( source , 43 )
				else
					outputChatBox ( ' 3000000 $ أنت لا تملك ' , source , 255 , 0 , 0 , true )
				end
			end 
	end 
)

جرب كذأ 

ديبق يقول

Bad argument @ getPlayerAccount[Expected element...]

Bad argument @ isGuestAccount[Expected account...]

Bad argument @ getPlayerAccount[Expected element...]

Bad argument @ getAccountName[Expected account...]

و Error بالاحمر في هذذا السطر

if ( not isObjectInACLGroup ( 'user.'..getAccountName ( getPlayerAccount ( aPlayer_ ) ) , aclGetGroup ( 'Earrb' ) ) ) then

 

Link to comment
addEvent ( 'send' , true )
addEventHandler ( 'send' , root ,
	function ( )
		if ( isGuestAccount ( getPlayerAccount ( source ) ) then return end
			if ( not isObjectInACLGroup ( 'user.'..getAccountName ( getPlayerAccount ( source ) ) , aclGetGroup ( 'Earrb' ) ) ) then
				if ( getPlayerMoney ( source ) >= 3000000 ) then
					takePlayerMoney ( source , 3000000 )
					aclGroupAddObject ( aclGetGroup ( 'Earrb' ) , 'user.'..getAccountName ( getPlayerAccount ( source ) ) )
					playSoundFrontEnd ( source , 43 )
				else
					outputChatBox ( ' 3000000 $ أنت لا تملك ' , source , 255 , 0 , 0 , true )
				end
			end 
	end 
)

 

Link to comment
3 minutes ago, MR.StoRm said:

addEvent ( 'send' , true )
addEventHandler ( 'send' , root ,
	function ( )
		if ( isGuestAccount ( getPlayerAccount ( source ) ) then return end
			if ( not isObjectInACLGroup ( 'user.'..getAccountName ( getPlayerAccount ( source ) ) , aclGetGroup ( 'Earrb' ) ) ) then
				if ( getPlayerMoney ( source ) >= 3000000 ) then
					takePlayerMoney ( source , 3000000 )
					aclGroupAddObject ( aclGetGroup ( 'Earrb' ) , 'user.'..getAccountName ( getPlayerAccount ( source ) ) )
					playSoundFrontEnd ( source , 43 )
				else
					outputChatBox ( ' 3000000 $ أنت لا تملك ' , source , 255 , 0 , 0 , true )
				end
			end 
	end 
)

 

تمام بس الحين المشكله بدي

Access denied @ 'aclGroupAddObject'

Link to comment
Just now, MR.StoRm said:

ضيف المود لقروب ادمن :) 

الله يعطيك العافيه

بس سؤال

ما اقدر 

مثلا انا كتبت اسم حسابي بايديت بوكس

وابي اللي كتبته بالايديت بوكس هو يضف للجروب

فهمتني؟

Link to comment
1 minute ago, Source|> said:

الله يعطيك العافيه

بس سؤال

ما اقدر 

مثلا انا كتبت اسم حسابي بايديت بوكس

وابي اللي كتبته بالايديت بوكس هو يضف للجروب

فهمتني؟

وضح أكثر ما فهمت 

Link to comment
1 minute ago, Source|> said:

انا مسوي ايديت بوكس

مثلا اسم حسابي r3d

ابي لما اكتب بالايديت بوكس

r3d

ينضاف اسم الحساب للجروب

guiGetText
triggerServerEvent

 

Edited by MR.StoRm
Link to comment
Just now, MR.StoRm said:

guiGetText

 

سويت الايديت بوكس وكل شي

بس خربت في هذا الكود

addEvent ( 'send' , true )
addEventHandler ( 'send' , root ,
	function ( txt )
		if ( isGuestAccount ( getPlayerAccount ( source ) ) then return end
			if ( not isObjectInACLGroup ( 'user.'..getAccountName ( getPlayerAccount ( source ) ) , aclGetGroup ( 'Earrb' ) ) ) then
				if ( getPlayerMoney ( source ) >= 3000000 ) then
					takePlayerMoney ( source , 3000000 )
					aclGroupAddObject ( aclGetGroup ( 'Earrb' ) , 'user.'..getAccountName ( getPlayerAccount ( txt ) ) )
					playSoundFrontEnd ( source , 43 )
				else
					outputChatBox ( ' 3000000 $ أنت لا تملك ' , source , 255 , 0 , 0 , true )
				end
			end 
	end 
)

صح؟

Link to comment
1 minute ago, Source|> said:

سويت الايديت بوكس وكل شي

بس خربت في هذا الكود


addEvent ( 'send' , true )
addEventHandler ( 'send' , root ,
	function ( txt )
		if ( isGuestAccount ( getPlayerAccount ( source ) ) then return end
			if ( not isObjectInACLGroup ( 'user.'..getAccountName ( getPlayerAccount ( source ) ) , aclGetGroup ( 'Earrb' ) ) ) then
				if ( getPlayerMoney ( source ) >= 3000000 ) then
					takePlayerMoney ( source , 3000000 )
					aclGroupAddObject ( aclGetGroup ( 'Earrb' ) , 'user.'..getAccountName ( getPlayerAccount ( txt ) ) )
					playSoundFrontEnd ( source , 43 )
				else
					outputChatBox ( ' 3000000 $ أنت لا تملك ' , source , 255 , 0 , 0 , true )
				end
			end 
	end 
)

صح؟

ما تجرب ؟ ,
بدل txt 
بـ source 

Link to comment
function getAccountFromName ( name )
	return getAccount ( name ) or false
end

addEvent ( 'send' , true )
addEventHandler ( 'send' , root ,
	function ( uAccount_ )
		local uAccount_ = getAccountFromName ( tostring ( uAccount_ ) )
		if ( uAccount_ ) then 
			if ( not isObjectInACLGroup ( 'user.'..uAccount_ , aclGetGroup ( 'Earrb' ) ) then
				if ( getPlayerMoney ( source ) >= 3000000 ) then
					takePlayerMoney ( source , 3000000 )
					aclGroupAddObject ( aclGetGroup ( 'Earrb' ) , 'user.'..uAccount_ )
					playSoundFrontEnd ( source , 43 )
				else
					outputChatBox ( ' 3000000 $ أنت لا تملك ' , source , 255 , 0 , 0 , true )
				end
			else
				outputChatBox ( ' الحساب يملك هذه الرتبة ' , source , 255 , 0 , 0 , true )
			end 
		else
			outputChatBox ( ' الحساب غير موجود في السيرفر ' , source , 255 , 0 , 0 , true  )
		end
	end 
)

 

addEventHandler ( 'onClientGUIClick' , root ,
	function (	)
		local txt = guiGetText ( edit )
		if ( source == ok ) then
			if ( txt == '' ) then
				return outputChatBox( ' الرجاء كتابة إسم الحساب ' , 255 , 0 , 0 , true )
			end
			triggerServerEvent ( 'send' , localPlayer , txt )
		end
	end
)

 

Edited by #_iMr.[E]coo
Link to comment
4 minutes ago, #_iMr.[E]coo said:

function getAccountFromName ( name )
	return getAccount ( name ) or false
end

addEvent ( 'send' , true )
addEventHandler ( 'send' , root ,
	function ( uAccount_ )
		local uAccount_ = getAccountFromName ( tostring ( uAccount_ ) )
		if ( uAccount_ ) then 
			if ( not isObjectInACLGroup ( 'user.'..getAccount ( uAccount_ ) , aclGetGroup ( 'Earrb' ) ) then
				if ( getPlayerMoney ( source ) >= 3000000 ) then
					takePlayerMoney ( source , 3000000 )
					aclGroupAddObject ( aclGetGroup ( 'Earrb' ) , 'user.'..getAccount ( uAccount_ ) )
					playSoundFrontEnd ( source , 43 )
				else
					outputChatBox ( ' 3000000 $ أنت لا تملك ' , source , 255 , 0 , 0 , true )
				end
			else
				outputChatBox ( ' الحساب يملك هذه الرتبة ' , source , 255 , 0 , 0 , true )
			end 
		else
			outputChatBox ( ' الحساب غير موجود في السيرفر ' , source , 255 , 0 , 0 , true  )
		end
	end 
)

 

عندك خطا سطر 13

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...