nowofresh Posted January 9, 2011 Share Posted January 9, 2011 Hey, How Can table with categories Users -ID -X -Y -Z -Username -Nick I don't know how to use MTA-MySQL functions to do this. Can u write for me, example script ? Link to comment
Timic Posted January 12, 2011 Share Posted January 12, 2011 There are 'MySQL' functions https://wiki.multitheftauto.com/wiki/Mysql Link to comment
proracer Posted January 12, 2011 Share Posted January 12, 2011 Ok a very simple one. function startSQLOnStart() executeSQLCreateTable("Users", "Serial STRING") executeSQLCreateTable("EveryIDName", "ID INT") executeSQLCreateTable("XPosName", "XPos INT") executeSQLCreateTable("YPosName", "YPos INT") executeSQLCreateTable("ZPosName", "Zpos INT") end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), startSQLOnStart) When you create table you can save things into it. Link to comment
eAi Posted January 12, 2011 Share Posted January 12, 2011 That looks completely wrong. Link to comment
proracer Posted January 12, 2011 Share Posted January 12, 2011 Than I'm sorry. (and what is wrong) Link to comment
eAi Posted January 12, 2011 Share Posted January 12, 2011 You're creating 5 tables - he wants one table with 7 columns. Link to comment
proracer Posted January 12, 2011 Share Posted January 12, 2011 Ahhh... I'm totally sorry man Link to comment
12p Posted January 12, 2011 Share Posted January 12, 2011 I'm not an expert in SQL, I just started to use it >.< But this could work: executeSQLCreateTable("TheTableName", "player TEXT, playerid INTEGER, posX INTEGER, posY INTEGER, posZ INTEGER") You can do anything you want with that table using the following functions: executeSQLUpdate executeSQLInsert executeSQLSelect executeSQLQuery Click on every function name to visit wiki documentation and learn. Link to comment
proracer Posted January 12, 2011 Share Posted January 12, 2011 Yes and you can add column by this function: exports.scoreboard:addScoreboardColumn(") (I think) ^^ Link to comment
12p Posted January 12, 2011 Share Posted January 12, 2011 Your [lua] tag is FAIL lol. Scoreboard could be used to show the player stats to all, but there is very low width to make columns huh. 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