DeLTon Posted November 4, 2015 Share Posted November 4, 2015 السلام عليكم ورحمه الله وبركاته اخباركمم , المهم : - مود الترقيه فيه مشكلة , ان لما احد تكون عنده رتبه ويشتري رتبه تجيه الرتبه الثانيه و الاولى , والمشكلة ذي متعبتني بعدين لما يشتري رتبه ثالث م تجيهه هل فيه حركه او كود , لما يشتري رتبه جديده تنمسح القديمهه sevrer : xAddToGroupFunction_ = function ( Group,Price,Name ) local account = getAccountName(getPlayerAccount(source)); if isGuestAccount(getPlayerAccount(source)) then return outputChatBox(" * يجب عليك التسجيل اولاَ",source,255,0,255,true); end if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("** لديك هذهـ الرتبة فعـلا ! ",source,255,0,255,true); end local sValue = getElementData( source,'Level' ) if not sValue then sValue = '0' end local data = tonumber(string.sub(sValue, 6)) local hour = tonumber( data ) if hour == nil or not tonumber(hour) then hour = 0 end if not isObjectInACLGroup("user."..account, aclGetGroup(tostring("ExAdmin"))) then if ( hour >= tonumber(Price)) then aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); outputChatBox("** تم اضافة الرتبة بنجاح | "..Name,source,0,255,255,true); else outputChatBox("**ليس لديك لفلات كافية",source,255,0,0,true); end else outputChatBox("**لا يمكنك شراء رتبة لأنك مخالف",source,255,0,0,true); end end addEvent("Accept:the:request",true) addEventHandler("Accept:the:request",root,xAddToGroupFunction_) Client : ---------------------- -- Setting ---------------------- local x, y = guiGetScreenSize() local rx, ry = (x/800), (y/600) local Admin = { {"[Rank]-","V.I.P","18"}, {"[Rank]-","PRO","120"}, {"[Rank]-","Level.1","260"}, {"[Rank]-","Level.2","390"}, {"[Rank]-","Killer","530"}, {"[Rank]-","xModerator","685"}, {"[Rank]-","ModeratorPlus","860"}, {"[Rank]-","xSuperModerator","1070"}, {"[Rank]-","SuperModeratorPlus","1385"}, {"[Rank]-","xAdmin","1880"}, {"[Rank]-","Head.Admin","3770"}, {"[Rank]-","Special.Admin","6485"}, {"[Rank]-","Vote-Manger","11650"}, {"[Rank]-","Manger.Server","22200"}, } ---------------------- -- Setting ---------------------- GUIEditor = { button = {} } GUIEditor.button[1] = guiCreateButton(295, 472, 178, 56, "", false) guiSetAlpha(GUIEditor.button[1], 0.00) GiveAdmin = guiCreateGridList(254, 157, 256, 302, false) guiGridListAddColumn(GiveAdmin, "Admins", 0.3) guiGridListAddColumn(GiveAdmin, "Group", 0.3) guiGridListAddColumn(GiveAdmin, "Level", 0.3) function buy() dxDrawLine(236 - 1, 101 - 1, 236 - 1, 538, tocolor(255, 0, 0, 0), 1, false) dxDrawLine(526, 101 - 1, 236 - 1, 101 - 1, tocolor(255, 0, 0, 0), 1, false) dxDrawLine(236 - 1, 538, 526, 538, tocolor(255, 0, 0, 0), 1, false) dxDrawLine(526, 538, 526, 101 - 1, tocolor(255, 0, 0, 0), 1, false) dxDrawRectangle(236, 101, 290, 437, tocolor(54, 151, 224, 224), false) dxDrawLine(235, 144, 526, 144, tocolor(54, 151, 224, 224), 1, false) dxDrawText("= [ Panel Rank ] =", 274, 107, 488, 134, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText("= [ Panel Rank ] =", 274, 107, 488, 134, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText("= [ Panel Rank ] =", 274, 107, 488, 134, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText("= [ Panel Rank ] =", 274, 107, 488, 134, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText("= [ Panel Rank ] =", 274, 107, 488, 134, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawRectangle(285, 466, 198, 67, tocolor(54, 54, 54, 212), false) dxDrawText("~ ترقيه ~", 300, 465, 469, 523, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) end removeEventHandler("onClientRender",root,buy) guiSetVisible ( GUIEditor.button[1], false ) guiSetVisible ( GiveAdmin, false ) ----------------------------------------------------------- function OpenWin() if removeEventHandler("onClientRender",root,buy)then removeEventHandler("onClientRender",root,buy) guiSetVisible ( GUIEditor.button[1], false ) guiSetVisible ( GiveAdmin, false ) showCursor(false) else addEventHandler("onClientRender",root,buy) guiSetVisible ( GUIEditor.button[1], true ) guiSetVisible ( GiveAdmin, true ) showCursor(true) end end bindKey ( "F1", "down", OpenWin ) for k,v in ipairs ( Admin ) do row = guiGridListAddRow(GiveAdmin); guiGridListSetItemText(GiveAdmin,row,1,v[1],false,false); guiGridListSetItemText(GiveAdmin,row,2,v[2],false,false); guiGridListSetItemText(GiveAdmin,row,3,v[3],false,false); guiGridListSetItemColor(GiveAdmin,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) guiGridListSetItemColor(GiveAdmin,row,2,math.random(0,255),math.random(0,255),math.random(0,255)) guiGridListSetItemColor(GiveAdmin,row,3,math.random(0,255),math.random(0,255),math.random(0,255)) end xMainFunctions_ = function ( ) local row, col = guiGridListGetSelectedItem ( GiveAdmin ) local Group = tostring ( guiGridListGetItemText(GiveAdmin,row,2 )); local Price = tostring ( guiGridListGetItemText(GiveAdmin,row,3 )); local Name = tostring ( guiGridListGetItemText(GiveAdmin,row,1 )); if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent("Accept:the:request",localPlayer,Group,Price,Name); else outputChatBox("* الرجاء اختيار رتبةة !",255,0,0,true); end end addEventHandler("onClientGUIClick",GUIEditor.button[1],xMainFunctions_,false) Link to comment
` Allawi Posted November 4, 2015 Share Posted November 4, 2015 viewtopic.php?f=160&t=92615&p=833998&hilit=aclGroupList#p833998 Link to comment
DeLTon Posted November 4, 2015 Author Share Posted November 4, 2015 https://forum.multitheftauto.com/viewtopic.php?f=160&t=92615&p=833998&hilit=aclGroupList#p833998 وش سويت انت اي كود اضفت ؟ لأن الموضوع حوسهه وضيفه لي دام عارفه , Link to comment
` Allawi Posted November 4, 2015 Share Posted November 4, 2015 xAddToGroupFunction_ = function ( Group,Price,Name ) local account = getAccountName(getPlayerAccount(source)); if isGuestAccount(getPlayerAccount(source)) then return outputChatBox(" * يجب عليك التسجيل اولاَ",source,255,0,255,true); end if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("** لديك هذهـ الرتبة فعـلا ! ",source,255,0,255,true); end local sValue = getElementData( source,'Level' ) if not sValue then sValue = '0' end local data = tonumber(string.sub(sValue, 6)) local hour = tonumber( data ) if hour == nil or not tonumber(hour) then hour = 0 end if not isObjectInACLGroup("user."..account, aclGetGroup(tostring("ExAdmin"))) then if ( hour >= tonumber(Price)) then removeGroups(source); aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); outputChatBox("** تم اضافة الرتبة بنجاح | "..Name,source,0,255,255,true); else outputChatBox("**ليس لديك لفلات كافية",source,255,0,0,true); end else outputChatBox("**لا يمكنك شراء رتبة لأنك مخالف",source,255,0,0,true); end end addEvent("Accept:the:request",true) addEventHandler("Accept:the:request",root,xAddToGroupFunction_) function removeGroups ( element ) if ( element and isElement ( element ) ) then if ( getPlayerAccount ( element ) and not isGuestAccount ( getPlayerAccount ( element ) ) ) then for _, v in ipairs ( aclGroupList ( ) ) do if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( element ) ), v ) ) then aclGroupRemoveObject ( v, "user." .. getAccountName ( getPlayerAccount ( element ) ) ) end end end end end Link to comment
DeLTon Posted November 5, 2015 Author Share Posted November 5, 2015 xAddToGroupFunction_ = function ( Group,Price,Name ) local account = getAccountName(getPlayerAccount(source)); if isGuestAccount(getPlayerAccount(source)) then return outputChatBox(" * يجب عليك التسجيل اولاَ",source,255,0,255,true); end if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("** لديك هذهـ الرتبة فعـلا ! ",source,255,0,255,true); end local sValue = getElementData( source,'Level' ) if not sValue then sValue = '0' end local data = tonumber(string.sub(sValue, 6)) local hour = tonumber( data ) if hour == nil or not tonumber(hour) then hour = 0 end if not isObjectInACLGroup("user."..account, aclGetGroup(tostring("ExAdmin"))) then if ( hour >= tonumber(Price)) then removeGroups(source); aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); outputChatBox("** تم اضافة الرتبة بنجاح | "..Name,source,0,255,255,true); else outputChatBox("**ليس لديك لفلات كافية",source,255,0,0,true); end else outputChatBox("**لا يمكنك شراء رتبة لأنك مخالف",source,255,0,0,true); end end addEvent("Accept:the:request",true) addEventHandler("Accept:the:request",root,xAddToGroupFunction_) function removeGroups ( element ) if ( element and isElement ( element ) ) then if ( getPlayerAccount ( element ) and not isGuestAccount ( getPlayerAccount ( element ) ) ) then for _, v in ipairs ( aclGroupList ( ) ) do if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( element ) ), v ) ) then aclGroupRemoveObject ( v, "user." .. getAccountName ( getPlayerAccount ( element ) ) ) end end end end end الله يعطيك العافيه م قصرت مشكور الله يوفقك Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now