FiGo Posted July 20, 2020 Share Posted July 20, 2020 when I am trying to delete my group it keep giving me this and it don't delete The password doesn't match with the username from the groupleader! [5:04 PM] and everything is linked in the database here is the function can u help me with this -- Delete group addEvent( "onServerDeleteGroup", true ) addEventHandler( "onServerDeleteGroup", root, function ( username, password ) local accountCheck = exports.DENmysql:querySingle( "SELECT * FROM accounts WHERE username=? AND password=? LIMIT 1", username, sha256( password ) ) local groupID = exports.server:getPlayerGroupID( source ) if ( accountCheck ) and ( groupID ) or getElementData(source,"isPlayerPrime") then for k,thePlayer in ipairs(getElementsByType("player")) do if getElementData(thePlayer,"Group") == getElementData(source,"Group") then setElementData( thePlayer, "groupRank", false ) setElementData( thePlayer, "Group", false ) setElementData( thePlayer, "GroupID", false ) setElementData( thePlayer, "groupID", false ) setElementData( thePlayer, "alliance",false) setElementData(thePlayer,"aName",false) triggerClientEvent( thePlayer, "onClientFinishGroupCreate", thePlayer ) end end exports.DENmysql:exec( "DELETE FROM groups_members WHERE groupid=?", groupID ) exports.DENmysql:exec( "DELETE FROM groups_invites WHERE groupid=?", groupID ) exports.DENmysql:exec( "DELETE FROM groups WHERE groupid=?", groupID ) exports.DENmysql:exec( "DELETE FROM groups_ranks WHERE id=?", groupID) exports.DENmysql:exec( "DELETE FROM groups_membersblacklist WHERE groupid=?",groupID) exports.CPKchatsystem:outPutGroupMessageByPlayer( source, getPlayerName( source ).." deleted the group!" ) exports.DENmysql:exec("DELETE FROM groups_logs WHERE groupid=?",groupID) --remove all the logs, prevents more database memory. --[[for k, thePlayer in ipairs ( getGroupPlayers ( getElementData( source, "Group" ) ) ) do setElementData( thePlayer, "groupRank", false ) setElementData( thePlayer, "Group", false ) setElementData( thePlayer, "groupID", false ) setElementData( thePlayer, "alliance",false) setElementData(thePlayer,"aName",false) triggerClientEvent( thePlayer, "onClientFinishGroupCreate", thePlayer ) end]] if allianceGroups[groupID] then alliance_kickGroup(allianceGroups[groupID],groupID,true,source) allianceGroups[groupID] = nil end for id,allianceInfo in pairs(alliances) do alliances_removeInvite(id,groupID, true, "") end else exports.CPKdxmsg:createNewDxMessage( source, "The password doesn't match with the username from the groupleader!", 225, 0, 0 ) end end ) Link to comment
N3xT Posted July 20, 2020 Share Posted July 20, 2020 Please read our guidelines so others can understand your issue correctly 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