Wei Posted June 28, 2012 Share 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. Link to comment
Castillo Posted June 28, 2012 Share Posted June 28, 2012 You can do it MySQL/SQLite/XML based. Link to comment
Wei Posted June 28, 2012 Author Share Posted June 28, 2012 how can I make it XML based what I put as value of node or how ? Link to comment
Castillo Posted June 28, 2012 Share 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. Link to comment
Wei Posted June 28, 2012 Author Share 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 ? Link to comment
Castillo Posted June 28, 2012 Share 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) Link to comment
Wei Posted June 28, 2012 Author Share Posted June 28, 2012 executeSQLQuery( "INSERT INTO banList playerIP VALUES '".. getPlayerIP ( source ) .."'" ) syntax error. Sorry but it's my first time doing with this. Link to comment
Castillo Posted June 28, 2012 Share Posted June 28, 2012 Try this: executeSQLQuery( "INSERT INTO banList (playerIP) VALUES (".. getPlayerIP ( source ) ..")" ) Link to comment
Wei Posted June 28, 2012 Author Share 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 ? Link to comment
Castillo Posted June 28, 2012 Share 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) 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