-- 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 ~= "" then
triggerServerEvent("lv1", localPlayer,rankstake)
end
end
end
)
--Server
addEvent("lv1",true)
addEventHandler("lv1",root,
function(rankstake)
local 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
)