Wei Posted June 28, 2012 Posted June 28, 2012 So... I'm making a ban system. Depends on what could I put banned serials/IPs. In xml or how ? I wanna make it on command not to add it in script.
Wei Posted June 28, 2012 Author Posted June 28, 2012 how can I make it XML based what I put as value of node or how ?
Castillo Posted June 28, 2012 Posted June 28, 2012 Check the XML functions, start reading about how it works, do test scripts, then you can proceed with a bigger one.
Wei Posted June 28, 2012 Author Posted June 28, 2012 executeSQLCreateTable( "banList", "playerIP TEXT" ) function saveData(source) executeSQLQuery( "UPDATE banList SET "..getPlayerIP(source).." WHERE playerIP" ) end addCommandHandler("set", saveData) what am I doing wrong ?
Castillo Posted June 28, 2012 Posted June 28, 2012 executeSQLCreateTable( "banList", "playerIP TEXT" ) function saveData(source) executeSQLQuery( "UPDATE banList SET playerIP = '".. getPlayerIP ( source ) .."' WHERE playerIP = '".. getPlayerIP ( source ) .."'" ) end addCommandHandler("set", saveData)
Wei Posted June 28, 2012 Author Posted June 28, 2012 executeSQLQuery( "INSERT INTO banList playerIP VALUES '".. getPlayerIP ( source ) .."'" ) syntax error. Sorry but it's my first time doing with this.
Castillo Posted June 28, 2012 Posted June 28, 2012 Try this: executeSQLQuery( "INSERT INTO banList (playerIP) VALUES (".. getPlayerIP ( source ) ..")" )
Wei Posted June 28, 2012 Author Posted June 28, 2012 executeSQLCreateTable( "banList", "players, playerIP TEXT" ) function saveData(source) executeSQLInsert ( "banList", "'"..getPlayerName(source).."', '" .. sourcename .. "'" ) end addCommandHandler("set", saveData) function exeData(source) ip = executeSQLSelect ( "banList", "'"..getPlayerName(source).."', 'playerIP' ") outputChatBox( tostring(ip) ) end addCommandHandler("get", exeData) why it returns table ?
Castillo Posted June 28, 2012 Posted June 28, 2012 executeSQLCreateTable( "banList", "players, playerIP TEXT" ) function saveData ( source ) executeSQLInsert ( "banList", "'"..getPlayerName(source).."', '" .. sourcename .. "'" ) end addCommandHandler("set", saveData) function exeData ( source ) result = executeSQLSelect ( "banList", "playerIP", "players = '" .. getPlayerName(source) .. "'" ) outputChatBox( tostring ( result [ 1 ] [ "playerIP" ] ) ) end addCommandHandler("get", exeData)
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