Lachuks Posted August 6, 2017 Share Posted August 6, 2017 Hello pros! 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 Lpsd Posted August 6, 2017 Administrators Share Posted August 6, 2017 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) 1 Link to comment
NeXuS™ Posted August 6, 2017 Share Posted August 6, 2017 Try to use isElement function. 1 Link to comment
Lachuks Posted August 6, 2017 Author Share Posted August 6, 2017 (edited) Nope.. It stops woring without any errors/warnings. F*cked up Thanks!! It works great. Edited August 6, 2017 by Emix 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