Jump to content

Spaming warning


Lachuks

Recommended Posts

Hello pros! :D

I have resource with protect group base from others. It works well but time by time popups warning with make FPS drops. I hope you can help me! :)

Warning:

WARNING: [Free bases]/protect#15/protect.lua:7: Bad argument @ 'getElementType' [Expected element at argument 1]


WARNING: [Free bases]/protect#15/protect.lua:9: Bad argument @ 'getElementType' [Expected element at argument 1]

Code:

      local co4 = createColCuboid(2128.56665, -3001.31567, 9.56569, 66.225341796875, 68.13916015625, 19.98176612854)
      setElementID (co4, "Grupa")

      
addEventHandler ("onColShapeHit", getRootElement(), 
function(thePlayer, matchingDimension)
  if (getElementType (thePlayer) == "player") and (getElementID (source) == "Grupa") and ( getElementData( thePlayer , "gang")  == "Grupa"  or  isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin"))) then
    outputChatBox ("#ffffff[#B08630Base Protection#ffffff] Welcome back to the base, member of Grupa!", thePlayer, 255, 0, 0, true)
    elseif (getElementType (thePlayer) == "player")and (getElementID (source) == "Grupa")  and  (not getElementData( thePlayer , "gang")  == "Grupa" or not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin"))) then
                     spawnPlayer ( thePlayer,  1851.1171875, -2893.87890625, 12.993751525879)

  end
  end)

addEventHandler ("onColShapeLeave", getRootElement(), 
function(thePlayer, matchingDimension)
  
  if (getElementType (thePlayer) == "player") and (getElementID (source) == "Grupa") and ( getElementData( thePlayer , "gang")  == "Grupa"  or  isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin"))) then
       outputChatBox ("#ffffff[#B08630Base Protection#ffffff] You left the Grupa base!", thePlayer, 255, 0, 0, true)
      elseif (getElementType (thePlayer) == "player") and (getElementID (source) == "Grupa") and (not getElementData( thePlayer , "gang")  == "Grupa" or not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin"))) then
    outputChatBox ("#ffffff[#B08630Base Protection#ffffff]#ff0000 Access denied!", thePlayer, 255, 0, 0, true)

  end
end)

Thanks!

Link to comment
  • Administrators
      local co4 = createColCuboid(2128.56665, -3001.31567, 9.56569, 66.225341796875, 68.13916015625, 19.98176612854)
      setElementID (co4, "Grupa")

      
addEventHandler ("onColShapeHit", getRootElement(), 
function(thePlayer, matchingDimension)
    if not isElement(thePlayer) then return false end
  if (getElementType (thePlayer) == "player") and (getElementID (source) == "Grupa") and ( getElementData( thePlayer , "gang")  == "Grupa"  or  isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin"))) then
    outputChatBox ("#ffffff[#B08630Base Protection#ffffff] Welcome back to the base, member of Grupa!", thePlayer, 255, 0, 0, true)
    elseif (getElementType (thePlayer) == "player")and (getElementID (source) == "Grupa")  and  (not getElementData( thePlayer , "gang")  == "Grupa" or not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin"))) then
                     spawnPlayer ( thePlayer,  1851.1171875, -2893.87890625, 12.993751525879)

  end
  end)

addEventHandler ("onColShapeLeave", getRootElement(), 
function(thePlayer, matchingDimension)
    if not isElement(thePlayer) then return false end  
  if (getElementType (thePlayer) == "player") and (getElementID (source) == "Grupa") and ( getElementData( thePlayer , "gang")  == "Grupa"  or  isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin"))) then
       outputChatBox ("#ffffff[#B08630Base Protection#ffffff] You left the Grupa base!", thePlayer, 255, 0, 0, true)
      elseif (getElementType (thePlayer) == "player") and (getElementID (source) == "Grupa") and (not getElementData( thePlayer , "gang")  == "Grupa" or not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin"))) then
    outputChatBox ("#ffffff[#B08630Base Protection#ffffff]#ff0000 Access denied!", thePlayer, 255, 0, 0, true)

  end
end)

 

  • Thanks 1
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...