Jump to content

|~[مساعدة في لوحة الرتب]~|


Doffy

Recommended Posts

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

Link to comment
4 hours ago, Ahmed Ly said:

استخدام


aclGroupAddObject

 

محاولتي ما اشتغلت
 

--Client
addEventHandler("onClientGUIClick",root,
function ()
local rankstake = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
if ( source == GUIEditor.button[2] ) then 
if rankstake == 0 then 
triggerServerEvent("lv1",localPlayer, localPlayer)
--Server
addEvent("lv1",true)
addEventHandler("lv1",root,
function()
if getElementData(source,'Level') >= 15 then
if accountName then
aclGroupAddObject (aclGetGroup("Level1"), "user."..accountName)
outputChatBox("تم اخذ رتبة جديدة",source,255,255,255,true)
else
outputChatBox("#FF0000*#00FF00You Don't Have Enough Level",source,255,255,255,true)
end
end
end)

 

Link to comment
--Client
addEventHandler("onClientGUIClick",root,
function ()
if  source == GUIEditor.button[2]  then 
local rankstake = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
if rankstake == 1 then 
triggerServerEvent("lv1", localPlayer)
end
end
end
)

--Server
addEvent("lv1",true)
addEventHandler("lv1",root,
function()
if getElementData(source,'Level') >= 15 then
acc1 = getPlayerAccount(source)
if not isGuestAccount(acc1) then 
acc2 = getAccountName(acc1)
if not isObjectInACLGroup ("user."..acc2,aclGetGroup ("Level1")) then 
aclGroupAddObject (aclGetGroup("Level1"), "user."..acc2)
outputChatBox("تم اخذ رتبة جديدة",source,255,255,255,true)
playSoundFrontEnd(source,20)
else
outputChatBox("لديك هاذي رتبة ",source,255,255,255,true)
end
else
outputChatBox("يجب عليك تسجيل",source,0,255,0,true)
end
end
else 
outputChatBox("ليس لديك ساعات",source,0,255,0,true)
end
)

 

Edited by Ahmed Ly
Link to comment
2 minutes ago, Ahmed Ly said:

--Client
addEventHandler("onClientGUIClick",root,
function ()
if  source == GUIEditor.button[2]  then 
local rankstake = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
if rankstake == 1 then 
triggerServerEvent("lv1", localPlayer)
end
end
end
)

--Server
addEvent("lv1",true)
addEventHandler("lv1",root,
function()
if getElementData(source,'Level') >= 15 then
acc1 = getPlayerAccount(source)
if not isGuestAccount(acc1) then 
acc2 = getAccountName(acc2)
if not isObjectInACLGroup ("user."..acc2,aclGetGroup ("Level1")) then 
aclGroupAddObject (aclGetGroup("Level1"), "user."..acc2)
outputChatBox("تم اخذ رتبة جديدة",source,255,255,255,true)
playSoundFrontEnd(source,20)
else
outputChatBox("لديك هاذي رتبة ",source,255,255,255,true)
end
else
outputChatBox("يجب عليك تسجيل",source,0,255,0,true)
end
end
else 
outputChatBox("ليس لديك ساعات",source,0,255,0,true)
end
)

 

خطأ موب شغال

يجيلي في الدي بق

Link to comment
Just now, Ahmed Ly said:

عدلة كود جرب توا

واعطني كود ملف متاع الميتا

حق الميتا مضبوط

ولو تبيه هذا هو
 

<meta>
<script src="c.lua" type="client" />
<script src="s.lua" type="server" />
</meta>

 

Link to comment
-- جرب و اتاكد من الميتا!!
-- كلنت

addEventHandler("onClientGUIClick",root,
function ()
if  source == GUIEditor.button[2]  then 
local rankstake = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
if rankstake == 1 then 
triggerServerEvent("lv1", localPlayer)
end
end
end
)


--Server
addEvent("lv1",true)
addEventHandler("lv1",root,
function()
if getElementData(source,'Level') >= 15 then
acc1 = getPlayerAccount(source)
if not isGuestAccount(acc1) then 
acc2 = getAccountName(acc1)
if not isObjectInACLGroup ("user."..acc2,aclGetGroup ("Level1")) then 
aclGroupAddObject (aclGetGroup("Level1"), "user."..acc2)
outputChatBox("تم اخذ رتبة جديدة",source,255,255,255,true)
playSoundFrontEnd(source,20)
else
outputChatBox("لديك هاذي رتبة ",source,255,255,255,true)
end
else
outputChatBox("يجب عليك تسجيل",source,0,255,0,true)
end
else 
outputChatBox("ليس لديك ساعات",source,0,255,0,true)
end
end
)

 

Link to comment
2 minutes ago, Ahmed Ly said:

-- جرب و اتاكد من الميتا!!
-- كلنت

addEventHandler("onClientGUIClick",root,
function ()
if  source == GUIEditor.button[2]  then 
local rankstake = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
if rankstake == 1 then 
triggerServerEvent("lv1", localPlayer)
end
end
end
)


--Server
addEvent("lv1",true)
addEventHandler("lv1",root,
function()
if getElementData(source,'Level') >= 15 then
acc1 = getPlayerAccount(source)
if not isGuestAccount(acc1) then 
acc2 = getAccountName(acc1)
if not isObjectInACLGroup ("user."..acc2,aclGetGroup ("Level1")) then 
aclGroupAddObject (aclGetGroup("Level1"), "user."..acc2)
outputChatBox("تم اخذ رتبة جديدة",source,255,255,255,true)
playSoundFrontEnd(source,20)
else
outputChatBox("لديك هاذي رتبة ",source,255,255,255,true)
end
else
outputChatBox("يجب عليك تسجيل",source,0,255,0,true)
end
else 
outputChatBox("ليس لديك ساعات",source,0,255,0,true)
end
end
)

 

برضو
ERROR: Loading script failed:s.lua:19:'end' expected (to close 'function' at line 3) near'else'

Link to comment
-- Client

addEventHandler("onClientGUIClick",root,
function ()
	if  source == GUIEditor.button[2] then 
		local rankstake = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 )GUIEditor.gridlist[1]
			if rankstake ~= -1 then 
				triggerServerEvent("lv1", localPlayer,rankstake)
			end
		end
	end
)


--Server
addEvent("lv1",true)
addEventHandler("lv1",root,
function(rankstake)
	acc1 = getPlayerAccount(source)
		if isGuestAccount(acc1) then return outputChatBox("يجب عليك تسجيل",source,0,255,0,true) end
			acc2 = getAccountName(acc1)
				if not isObjectInACLGroup ("user."..acc2,aclGetGroup (rankstake)) then 
					aclGroupAddObject (aclGetGroup(rankstake), "user."..acc2)
					outputChatBox("تم اخذ رتبة جديدة",source,0,255,0,true)
					playSoundFrontEnd(source,20)
				else
			outputChatBox("لديك هاذي رتبة ",source,255,0,0,true)
		end
	end
)

لازم اسم الرو الي حدده اللاعب يكون يطابق اسم الرتبة في الاسل  : )

Edited by iMr.WiFi..!
Link to comment
7 minutes ago, iMr.WiFi..! said:

-- Client

addEventHandler("onClientGUIClick",root,
function ()
	if  source == GUIEditor.button[2] then 
		local rankstake = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 )GUIEditor.gridlist[1]
			if rankstake ~= -1 then 
				triggerServerEvent("lv1", localPlayer,rankstake)
			end
		end
	end
)


--Server
addEvent("lv1",true)
addEventHandler("lv1",root,
function(rankstake)
	acc1 = getPlayerAccount(source)
		if isGuestAccount(acc1) then return outputChatBox("يجب عليك تسجيل",source,0,255,0,true) end
			acc2 = getAccountName(acc1)
				if not isObjectInACLGroup ("user."..acc2,aclGetGroup (rankstake)) then 
					aclGroupAddObject (aclGetGroup(rankstake), "user."..acc2)
					outputChatBox("تم اخذ رتبة جديدة",source,0,255,0,true)
					playSoundFrontEnd(source,20)
				else
			outputChatBox("لديك هاذي رتبة ",source,255,0,0,true)
		end
	end
)

لازم اسم الرو الي حدده اللاعب يكون يطابق اسم الرتبة في الاسل  : )

انا مسويه الرو بلظبط نفس الاسم @_@

Link to comment
6 hours ago, iMr.WiFi..! said:

طيب وش جا بالديبق ؟

 

لحظة لسه بروح اجرب :] 

#Edit:

مو شغال

6 hours ago, iMr.WiFi..! said:

طيب وش جا بالديبق ؟

 

دي بق
ERROR: Loading script failed \ c.lua:60: '=' expected near 'if'

Link to comment

-- Client

addEventHandler("onClientGUIClick",root,
function ()
	if  source == GUIEditor.button[2] then 
		local rankstake = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 )GUIEditor.gridlist[1]
			if guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 then 
				triggerServerEvent("lv1", localPlayer,rankstake)
			end
		end
	end
)


--Server
addEvent("lv1",true)
addEventHandler("lv1",root,
function(rankstake)
	acc1 = getPlayerAccount(source)
		if isGuestAccount(acc1) then return outputChatBox("يجب عليك تسجيل",source,0,255,0,true) end
			acc2 = getAccountName(acc1)
				if not isObjectInACLGroup ("user."..acc2,aclGetGroup (rankstake)) then 
					aclGroupAddObject (aclGetGroup(rankstake), "user."..acc2)
					outputChatBox("تم اخذ رتبة جديدة",source,0,255,0,true)
					playSoundFrontEnd(source,20)
				else
			outputChatBox("لديك هاذي رتبة ",source,255,0,0,true)
		end
	end
)

جرب ذا : )

 

Link to comment
  • 2 months later...
On 2/19/2017 at 13:23, iMr.WiFi..! said:

-- ClientaddEventHandler("onClientGUIClick",root,function ()	if  source == GUIEditor.button[2] then 		local rankstake = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 )GUIEditor.gridlist[1]			if guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 then 				triggerServerEvent("lv1", localPlayer,rankstake)			end		end	end)--ServeraddEvent("lv1",true)addEventHandler("lv1",root,function(rankstake)	acc1 = getPlayerAccount(source)		if isGuestAccount(acc1) then return outputChatBox("يجب عليك تسجيل",source,0,255,0,true) end			acc2 = getAccountName(acc1)				if not isObjectInACLGroup ("user."..acc2,aclGetGroup (rankstake)) then 					aclGroupAddObject (aclGetGroup(rankstake), "user."..acc2)					outputChatBox("تم اخذ رتبة جديدة",source,0,255,0,true)					playSoundFrontEnd(source,20)				else			outputChatBox("لديك هاذي رتبة ",source,255,0,0,true)		end	end)

جرب ذا : )

 

برضو فيه مشكلة
ERROR: Loading script failed: c.lua:66:'=' expected near 'if'

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