1bit Posted October 7, 2012 Share Posted October 7, 2012 Okay, hey MTA Forum Visitors I have 2 questions about some Scripting Functions + Account System I plan to make an new complexe "Gamemode", with complexe i mean it should be ready for EVERY User mass so far Okay my first question: What of these 2 Methods is better / faster ? 1: msgString = "Hello" outputChatBox(msgString + "," + getPlayerName(source)) 2: msgString = "Hello" outputChatBox(string.format("%s, %s", msgString, getPlayerName(source)) Reason of this question is i have an multi language System i self decide more for string.format.. I'm not sure what a Account System i should use... I have currently an MySQL Account System with the Built- in DB Function, but i think with many query's in one time (like on 90+ players logging in and out causes lagging) i thinked about the built-in Account System ? I know i can make self a benchmark but this post is to know more about the experience of other Scripters/Server Owners for efficency data saving Thanks for Reading, and that you survived my bad english Link to comment
Anderl Posted October 7, 2012 Share Posted October 7, 2012 Okay, hey MTA Forum Visitors I have 2 questions about some Scripting Functions + Account System I plan to make an new complexe "Gamemode", with complexe i mean it should be ready for EVERY User mass so far Okay my first question: What of these 2 Methods is better / faster ? 1: msgString = "Hello" outputChatBox(msgString + "," + getPlayerName(source)) 2: msgString = "Hello" outputChatBox(string.format("%s, %s", msgString, getPlayerName(source)) Reason of this question is i have an multi language System i self decide more for string.format.. I'm not sure what a Account System i should use... I have currently an MySQL Account System with the Built- in DB Function, but i think with many query's in one time (like on 90+ players logging in and out causes lagging) i thinked about the built-in Account System ? I know i can make self a benchmark but this post is to know more about the experience of other Scripters/Server Owners for efficency data saving Thanks for Reading, and that you survived my bad english I doubt you did a complex gamemode with that small knowledge. In Lua, to concatenate strings we use ".." and not "+" like in C++. Both methods are the same. Link to comment
1bit Posted October 7, 2012 Author Share Posted October 7, 2012 I have so far enough experience, this with "+" was a mistake beacuse i make many things in other languages like Java etc. I overjumped some of the Basics of lua, my mistake now i see it in things like that LUA using so far i know a "VM" but anyways i thinked string.format costs some extra performance beacuse it executes an extra function, like on other programming languages .. With the accountsystem im sure its not the same the built-in saves it in the ".sql" file the read / write speed comes from the type of HDD, with the mysql is had so far some mistakes like to much query's etc, idk really of mta makes a use of query "stacking", like 2 querys come and compressed to one and sending as one) EDIT: i want learn some "RIGHT" things and do it yet in the right way not later ^^ 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