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. Diet with russian vodka, lose 3 days in one week !
Castillo Posted June 28, 2012 Posted June 28, 2012 You can do it MySQL/SQLite/XML based. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 ? Diet with russian vodka, lose 3 days in one week !
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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Wei Posted June 28, 2012 Author Posted June 28, 2012 I'll try Diet with russian vodka, lose 3 days in one week !
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 ? Diet with russian vodka, lose 3 days in one week !
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) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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. Diet with russian vodka, lose 3 days in one week !
Castillo Posted June 28, 2012 Posted June 28, 2012 Try this: executeSQLQuery( "INSERT INTO banList (playerIP) VALUES (".. getPlayerIP ( source ) ..")" ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 ? Diet with russian vodka, lose 3 days in one week !
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) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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