BumbiS* Posted July 27, 2010 Posted July 27, 2010 So, i want to know how can i check if player is bla bla bla, from mySQL.. In sa-mp that is something like this if(PlayerInfo[playerid][pFraction] == 1) { blablabla } else { Shows that you cant use that command, or what. } -------------------- And I want to know how can i make this in MTA?
dzek (varez) Posted July 27, 2010 Posted July 27, 2010 https://forum.multitheftauto.com/viewtop ... 91&t=27027
BumbiS* Posted July 27, 2010 Author Posted July 27, 2010 I am asking a question, there is no need of code, cuz i dont have it... You give me a link, but maybe you can help me too?
dzek (varez) Posted July 27, 2010 Posted July 27, 2010 but the problem is i dont really know what do you want.. you said something about mysql, but in your example i cant find anything that looks like fetching data from mysql. these links could be helpful, if you need further help - try to better explain your problem and ask: https://wiki.multitheftauto.com/ https://wiki.multitheftauto.com/wiki/Mysql https://wiki.multitheftauto.com/wiki/Modules/MTA- ... etch_assoc for storing data you can also use SQLite, which is almost like MySQL but doesnt require any addional install https://wiki.multitheftauto.com/wiki/ExecuteSQLSelect (check "See also")
MaddDogg Posted July 27, 2010 Posted July 27, 2010 I think, he wants to know, how to write control structures like if - else. We can't explain you the very basics of Lua, you have to read something by yourself. Here everything about Lua: http://www.lua.org/pil/index.html Here an introduction: http://nixstaller.berlios.de/manual/0.2 ... ler_9.html And here, what you are specifically searching for: http://www.lua.org/pil/4.3.1.html
BumbiS* Posted July 27, 2010 Author Posted July 27, 2010 No, thats not what i want.. Ah.. You don't understand me. I know, about control structures.. I want to know about mysql in MTA scripting... In sa-mp pawno it will be like this, without mysql. But i want to know how can server get info from sql database. if(PlayerData[playerid][pFaction] == 1) { SendClientMessage(playerid, ORANGE, "Hello, officer! Have a good day, Sir!"); return 1; } else { SendClientMessage(playerid, RED, "You are not a Police officer!"); return 1; } Above code in MTA... Not from .xml files account base, but from mySQL database.
AeroXbird Posted July 27, 2010 Posted July 27, 2010 MySQL is not supported by default by MTA, SQlite on the other hand is. If you want you can download the MySQL module from the wiki: https://wiki.multitheftauto.com
BumbiS* Posted July 27, 2010 Author Posted July 27, 2010 I already have that, and i have a database too. But i want to know that thing what i said before.
AeroXbird Posted July 28, 2010 Posted July 28, 2010 Try doing some research before you post topic: https://wiki.multitheftauto.com/wiki/Mysql And do execute a query: mysql_query(connect_handler, "query") and in MySQL you can update a table/row, select a table/row, alter a table/row, and delete a table/row (most common used syntaxis) But i guess you already know that.
dzek (varez) Posted July 28, 2010 Posted July 28, 2010 i gave you all needed links.. maybe open them?
MaddDogg Posted July 28, 2010 Posted July 28, 2010 And I still don't get your code. It has nothing to do with MySQL. You should just learn MySQL itself, using it is in every language almost the same. Use the links provided here, we can't help you getting the stuff into your brain, that's your part.
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