adeh001ok Posted April 21, 2019 Share Posted April 21, 2019 I see people here have extraordinary potential. But I have a serious problem so I ask you to help me Spoiler Server function DeleteChara() if (getElementData(theElement,"account:charselect:id")) then local dbid = getElementData(theElement,"account:charselect:id") local escapedID = exports.mysql:escape_string(dbid) local result = exports.mysql:query("SELECT * FROM characters WHERE id='" .. dbid .. "'") local fetch = exports.mysql:fetch_assoc(result) local query = exports.mysql:query("DELETE * FROM characters WHERE id='" .. dbid .. "'") if query then outputChatBox("Successfully deleted this character!", source, 0, 255, 0) refreshCharacters() else outputChatBox("ERROR!", source, 255, 0, 0) end end end addEvent("accounts:DeleteChara", true) addEventHandler("accounts:DeleteChara", getRootElement(), DeleteChara) Client function closeDelChar() destroyElement(myWindow) showCursor(true) end function DeleteChara() triggerServerEvent("accounts:DeleteChara", localPlayer) end function delChar() myWindow = guiCreateWindow ( 0.3, 0.3, 0.3, 0.2, "Information", true ) -- Button Boss bClose = guiCreateButton(0.550, 0.5, 0.4, 0.2, "No", true, myWindow) addEventHandler("onClientGUIClick", bClose, closeDelChar) bAccept = guiCreateButton(0.050, 0.5, 0.4, 0.2, "Yes", true, myWindow) addEventHandler("onClientGUIClick", bAccept, DeleteChara) -- Text lText = guiCreateLabel(0.025, 0.2, 1.0, 0.3, "Are You Sure?\nTo Delete This Character.", true, myWindow) guiSetFont(lText, "default-bold-small") guiLabelSetHorizontalAlign(lText, "center", true) end addEvent( "delChar", true) addEventHandler( "delChar", localPlayer, delChar) Link to comment
FlyingSpoon Posted April 21, 2019 Share Posted April 21, 2019 (edited) 4 hours ago, adeh001ok said: I see people here have extraordinary potential. But I have a serious problem so I ask you to help me Hide contents Server function DeleteChara() if (getElementData(theElement,"account:charselect:id")) then local dbid = getElementData(theElement,"account:charselect:id") local escapedID = exports.mysql:escape_string(dbid) local result = exports.mysql:query("SELECT * FROM characters WHERE id='" .. dbid .. "'") local fetch = exports.mysql:fetch_assoc(result) local query = exports.mysql:query("DELETE * FROM characters WHERE id='" .. dbid .. "'") if query then outputChatBox("Successfully deleted this character!", source, 0, 255, 0) refreshCharacters() else outputChatBox("ERROR!", source, 255, 0, 0) end end end addEvent("accounts:DeleteChara", true) addEventHandler("accounts:DeleteChara", getRootElement(), DeleteChara) Client function closeDelChar() destroyElement(myWindow) showCursor(true) end function DeleteChara() triggerServerEvent("accounts:DeleteChara", localPlayer) end function delChar() myWindow = guiCreateWindow ( 0.3, 0.3, 0.3, 0.2, "Information", true ) -- Button Boss bClose = guiCreateButton(0.550, 0.5, 0.4, 0.2, "No", true, myWindow) addEventHandler("onClientGUIClick", bClose, closeDelChar) bAccept = guiCreateButton(0.050, 0.5, 0.4, 0.2, "Yes", true, myWindow) addEventHandler("onClientGUIClick", bAccept, DeleteChara) -- Text lText = guiCreateLabel(0.025, 0.2, 1.0, 0.3, "Are You Sure?To Delete This Character.", true, myWindow) guiSetFont(lText, "default-bold-small") guiLabelSetHorizontalAlign(lText, "center", true) end addEvent( "delChar", true) addEventHandler( "delChar", localPlayer, delChar) Since you're using leaked/stolen scripts, I don't think anyone will help you. And as you can see, the debug string is saying that you're trying to compare a number with a nil value. Edited April 21, 2019 by ℓιgнт 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