Jump to content

طلب تعديل ع كود


Recommended Posts

السلام عليكم معي مود الترقياات

123 ابي اللي اسمها لايحتوي على هذي الكلمه

م يقدر يترقى او ياخذ رتبة من لوحة شراء الرتب

ي ليت تساعدوني هذاا الكود حقي

xAddToGroupFunction_ = function ( Group,Price,Name ) 
    local account = getAccountName(getPlayerAccount(source)); 
    if isGuestAccount(getPlayerAccount(source)) then return outputChatBox("#",source,255,255,255,true) end 
    if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("#",source,255,255,255,true) end 
        if isObjectInACLGroup("user."..account, aclGetGroup(ForbiddenGroup)) then return outputChatBox("#",source,255,0,0,true); end 
    local sValue = getElementData( source,'PlayTime' ) 
    if not sValue then sValue = '0:0:0' end 
    local data = split(sValue,':') 
    local hour = tonumber( data[1] )   
    if hour == nil or not tonumber(hour) then hour = 0 end 
    if ( hour >= tonumber(Price))  then 
                revmoeOtherGroups ( source ) 
        aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); 
outputChatBox("#"..Name,source,255,255,255,true) 
    else 
outputChatBox("#",source,255,255,255,true) 
    end 
end 
addEvent("Accept:the:request",true) 
addEventHandler("Accept:the:request",root,xAddToGroupFunction_) 
  
function revmoeOtherGroups (  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

'123' ياليـت توضـح أكثـر يعني تبيه لازم اسمه يحتوي على

xAddToGroupFunction_ = function ( Group,Price,Name ) 
    local account = getAccountName(getPlayerAccount(source)); 
    if string.find(getPlayerName(source), '123') then 
        if isGuestAccount(getPlayerAccount(source)) then return outputChatBox("#",source,255,255,255,true) end 
        if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("#",source,255,255,255,true) end 
        if isObjectInACLGroup("user."..account, aclGetGroup(ForbiddenGroup)) then return outputChatBox("#",source,255,0,0,true); end 
        local sValue = getElementData( source,'PlayTime' ) 
        if not sValue then sValue = '0:0:0' end 
        local data = split(sValue,':') 
        local hour = tonumber( data[1] )   
        if hour == nil or not tonumber(hour) then hour = 0 end 
        if hour >= tonumber(Price)  then 
            revmoeOtherGroups ( source ) 
            aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); 
            outputChatBox("#"..Name,source,255,255,255,true) 
        else 
            outputChatBox("#",source,255,255,255,true) 
        end 
    end 
end 
addEvent("Accept:the:request",true) 
addEventHandler("Accept:the:request",root,xAddToGroupFunction_) 
  
function revmoeOtherGroups (  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
xAddToGroupFunction_ = function ( Group,Price,Name ) 
    local account = getAccountName(getPlayerAccount(source)); 
    if string.find(getPlayerName(source), '123') then 
        if isGuestAccount(getPlayerAccount(source)) then return outputChatBox("#",source,255,255,255,true) end 
        if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("#",source,255,255,255,true) end 
        if isObjectInACLGroup("user."..account, aclGetGroup(ForbiddenGroup)) then return outputChatBox("#",source,255,0,0,true); end 
        local sValue = getElementData( source,'PlayTime' ) 
        if not sValue then sValue = '0:0:0' end 
        local data = split(sValue,':') 
        local hour = tonumber( data[1] )   
        if hour == nil or not tonumber(hour) then hour = 0 end 
        if hour >= tonumber(Price)  then 
            revmoeOtherGroups ( source ) 
            aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); 
            outputChatBox("#"..Name,source,255,255,255,true) 
        else 
            outputChatBox("#",source,255,255,255,true) 
        end 
    else 
        outputChatBox("يجب عليك وضع الشعار ليتم ترقيتك",source,255,0,0,true) 
    end 
end 
addEvent("Accept:the:request",true) 
addEventHandler("Accept:the:request",root,xAddToGroupFunction_) 
  
function revmoeOtherGroups (  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

ضيف الي تبيه للجدول:

_sf = {'123', 'Hello', 'w7sh'} 
  
function _isPlayerCanTakeGroup(Name) 
    for _,v_ in ipairs(_sf) do 
        if Name:find(v_) then 
            return true 
        end 
    end 
return false 
end 
  
xAddToGroupFunction_ = function ( Group,Price,Name ) 
    local account = getAccountName(getPlayerAccount(source)); 
    if _isPlayerCanTakeGroup(getPlayerName(source)) then 
        if isGuestAccount(getPlayerAccount(source)) then return outputChatBox("#",source,255,255,255,true) end 
        if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("#",source,255,255,255,true) end 
        if isObjectInACLGroup("user."..account, aclGetGroup(ForbiddenGroup)) then return outputChatBox("#",source,255,0,0,true); end 
        local sValue = getElementData( source,'PlayTime' ) 
        if not sValue then sValue = '0:0:0' end 
        local data = split(sValue,':') 
        local hour = tonumber( data[1] )   
        if hour == nil or not tonumber(hour) then hour = 0 end 
        if hour >= tonumber(Price)  then 
            revmoeOtherGroups ( source ) 
            aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); 
            outputChatBox("#"..Name,source,255,255,255,true) 
        else 
            outputChatBox("#",source,255,255,255,true) 
        end 
    else 
        outputChatBox("يجب عليك وضع الشعار ليتم ترقيتك",source,255,0,0,true) 
    end 
end 
addEvent("Accept:the:request",true) 
addEventHandler("Accept:the:request",root,xAddToGroupFunction_) 
  
function revmoeOtherGroups (  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

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