Qus4Y Posted October 1, 2017 Share Posted October 1, 2017 (edited) طلب مساعدة عندي مشكلة بالسكربت انه ما يرقي انا ضفت تيبل عشان تنحذف الرتبة الي معاه وتجي الجديدة لما يشتريها والادمن المخالف ما يقدر يرقي نفسه وما يظبت معي للعلم كان يشتغل بدون التيبل الي تحذف وتضيف رتبة جديدة الكود groupsToRemove = { 'Moderator1', 'Moderator2' }; addEvent("onBuyRank",true) addEventHandler("onBuyRank",root,function ( Rank,Level ) if ( isGuestAccount(getPlayerAccount(source)) ) then return outputChatBox("* Please Register To Buy Rank",source,255,0,0,true) end if ( isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin.ex")) ) then return end if ( tonumber( gettok(getElementData(source,"Level"), 2, string.byte(' ')) ) >= tonumber(Level) ) then aclGroupAddObject (aclGetGroup( tostring(Rank)),"user."..getAccountName(getPlayerAccount(source))) for i, _ in ipairs( groupsToRemove ) do if ( isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( source ) ), aclGetGroup( groupsToRemove[i] ) ) and groupsToRemove[i] ~= tostring( Rank ) ) then aclGroupRemoveObject( aclGetGroup( tostring( Rank ) ), 'user.'..getAccountName( getPlayerAccount( source ) ) ) end end outputChatBox("* You Has Been Buy ".. Rank .." !",source,255,255,0,true) else outputChatBox("* You Has Been Buy ".. Level .." !",source,255,255,0,true) end end) Edited October 1, 2017 by Qus4Y Link to comment
Adham Posted October 1, 2017 Share Posted October 1, 2017 (edited) جرب groupsToRemove = { "Moderator1", "Moderator2" }; addEvent ( "onBuyRank", true ) addEventHandler ( "onBuyRank", root, function ( rank, Level ) if rank and Level then local acc = getPlayerAccount ( source ) if acc and not isGuestAccount ( acc ) then if isObjectInACLGroup ("user."..getAccountName(acc), aclGetGroup ( "Admin-Ex" ) ) then return false end if ( tonumber( gettok(getElementData(source,"Level"), 2, string.byte(' ')) ) >= tonumber(Level) ) then aclGroupAddObject (aclGetGroup( tostring(Rank)),"user."..getAccountName(acc)) for i,v in ipairs( groupsToRemove ) do if ( isObjectInACLGroup( "user."..getAccountName(acc), aclGetGroup( v ) ) and v ~= tostring( Rank ) ) then aclGroupRemoveObject( aclGetGroup( tostring( Rank ) ), "user."..getAccountName( acc ) ) end end end end end end end ) Edited October 1, 2017 by Deativated Link to comment
Qus4Y Posted October 1, 2017 Author Share Posted October 1, 2017 1 hour ago, Deativated said: جرب groupsToRemove = { "Moderator1", "Moderator2" }; addEvent ( "onBuyRank", true ) addEventHandler ( "onBuyRank", root, function ( rank, Level ) if rank and Level then local acc = getPlayerAccount ( source ) if acc and not isGuestAccount ( acc ) then if isObjectInACLGroup ("user."..getAccountName(acc), aclGetGroup ( "Admin-Ex" ) ) then return false end if ( tonumber( gettok(getElementData(source,"Level"), 2, string.byte(' ')) ) >= tonumber(Level) ) then aclGroupAddObject (aclGetGroup( tostring(Rank)),"user."..getAccountName(acc)) for i,v in ipairs( groupsToRemove ) do if ( isObjectInACLGroup( "user."..getAccountName(acc), aclGetGroup( v ) ) and v ~= tostring( Rank ) ) then aclGroupRemoveObject( aclGetGroup( tostring( Rank ) ), "user."..getAccountName( acc ) ) end end end end end end end ) نفس المشكلة ما يرقي Link to comment
MR.GRAND Posted October 1, 2017 Share Posted October 1, 2017 (edited) جرب ~ groupsToRemove = { 'Moderator1', 'Moderator2' }; addEvent( 'onBuyRank', true ) addEventHandler ( 'onBuyRank', root, function ( rank, Level ) if ( rank and Level ) then local acc = getPlayerAccount( source ) if ( not acc or isGuestAccount ( acc ) ) then return end if ( isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( 'Admin-Ex' ) ) ) then return end if ( tonumber( gettok( getElementData( source, 'Level'), 2, string.byte(' ')) ) >= tonumber(Level) ) then aclGroupAddObject ( aclGetGroup( tostring( rank ) ), 'user.'..getAccountName( acc ) ) for i, _ in ipairs( groupsToRemove ) do if ( isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( groupsToRemove[i] ) ) and groupsToRemove[i] ~= tostring( rank ) ) then aclGroupRemoveObject( aclGetGroup( tostring( rank ) ), 'user.'..getAccountName( acc ) ) end end end end end ); Edited October 1, 2017 by MR.GRAND Link to comment
Qus4Y Posted October 1, 2017 Author Share Posted October 1, 2017 1 hour ago, MR.GRAND said: جرب ~ groupsToRemove = { 'Moderator1', 'Moderator2' }; addEvent( 'onBuyRank', true ) addEventHandler ( 'onBuyRank', root, function ( rank, Level ) if ( rank and Level ) then local acc = getPlayerAccount( source ) if ( not acc or isGuestAccount ( acc ) ) then return end if ( isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( 'Admin-Ex' ) ) ) then return end if ( tonumber( gettok( getElementData( source, 'Level'), 2, string.byte(' ')) ) >= tonumber(Level) ) then aclGroupAddObject ( aclGetGroup( tostring( rank ) ), 'user.'..getAccountName( acc ) ) for i, _ in ipairs( groupsToRemove ) do if ( isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( groupsToRemove[i] ) ) and groupsToRemove[i] ~= tostring( rank ) ) then aclGroupRemoveObject( aclGetGroup( tostring( rank ) ), 'user.'..getAccountName( acc ) ) end end end end end ); ما ضبط Link to comment
MR.GRAND Posted October 1, 2017 Share Posted October 1, 2017 local groupsToRemove = { 'Moderator1', 'Moderator2' }; addEvent( 'onBuyRank', true ) addEventHandler ( 'onBuyRank', root, function ( rank, Level ) if ( rank and Level ) then local acc = getPlayerAccount( source ) if ( not acc or isGuestAccount ( acc ) ) then return end if ( isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( 'Admin-Ex' ) ) ) then return end if ( tonumber( gettok( getElementData( source, 'Level'), 2, string.byte(' ')) ) >= tonumber(Level) ) then aclGroupAddObject ( aclGetGroup( tostring( rank ) ), 'user.'..getAccountName( acc ) ) for i, _ in ipairs( groupsToRemove ) do if ( isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( groupsToRemove[i] ) ) and groupsToRemove[i] ~= rank ) then aclGroupRemoveObject( aclGetGroup( groupsToRemove[i] ), 'user.'..getAccountName( acc ) ) end end end end end ); Done! 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