Jump to content

Solstice.

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by Solstice.

  1. I'll see to checking out of that actually works. Good idea. I intend to handle a system like this for interiors but I was trying to figure how to script a breakthru exterior script. It's basically about a player-ran business which is not a state-wide company. It'd be a nuisance to see another company's logo appear on someone else's property. Thanks for the reply. Really helped out.
  2. Hello. I'm aware it's possible to change .txds of objects. Although I'm wondering if it's possible to say replace the .txd of a single object in the same dimension/interior. Basically if there'd be several 24/7s around town would it be possible to change the front logo if one of them to another,, if both of the structures use the same objects, without setting each 24/7 around the map to having that same replaced logo? The objects would be in the same location. Thanks in advance.
  3. Since my host apparently doesn't want to let me modify permissions so I can't get the server to connect. I don't see a vital difference between sqlite and MySQL so it's why I'm not making a big deal out of getting the MySQL database to work.
  4. I go back a long way in some of the most renowned roleplay communities and I'm looking for a scripter to script a server according to the concept a creative development team is going to draw out. As for now all I can say it's going to be a roleplay server. I have money I'm willing to spend on someone dedicated and versatile that doesn't bail in the very midst of the project. Requirements: - be of a decent age - speak elaborate english - have extensive knowledge of .LUA and working with sqlite - reliability and flexibility - trustable (aka. you don't distribute the script NOR the text-file to third parties) - be able to work alone; if you want to work with another scripter it's going to seriously cut in on your payment - agree to the fact you wont be a part of staff, but development. Helping out doesn't make you an owner or a high-ranked administrator. You work according to a concept that's being drawn out to you, nothing more nothing less. It goes without saying you will receive the justified big deal of credit you deserve for your vital services. If you're interested and feel you fit the description, bring up a fair price and present your skill, and I will consider. Key-members of staff have already been assembled and the project has been documented in a detailed text-file ready for distribution.
  5. Perfect! Thank you very much. That helped me out.
  6. Although dbExec only returns true or false. What I need is to have the query return the skin ID listed in the table for the respective character. An example: How do I go about pulling the number '121' from the table so I can use it to set a spawned player's skin? Basically bind 121 to a variable. I'm working on a system whereas you can have more characters bound to one account. Later I'll be adding additional collums such as money in hand etc. but to get the drill I'm starting off simple.
  7. I thought the issue was with dbConnect initially although after going through some checkpoints there appears to be an issue table-side. function display_char () db = dbConnect ("sqlite", "account_info.db") outputChatBox ("Some generic output implying the function is triggered") if db == false then outputChatBox ( "Some generic output implying dbConnect doesn't work") else outputChatBox ("Some generic output implying dbConnect does work") skin_id = executeSQLQuery ("SELECT skin FROM characters WHERE acc_owner=? AND slot=?", acc_name, 1) outputChatBox ( "",skin_id,"") -- if there's no output there's probably an issue with the query end end
  8. Yeah. Locally it didn't work either. I kind of just ditched MySQL and went with SQlite instead. Seems to bring some benefits and MySQL feels a bit overkill for me right now. Thank you regardless.
  9. Finally fixed my MySQL database. For some reason line 24 returns nil despite the username and password are both present within the database. function login_seq (username, password) handler = mysql_connect("SOMEHOST", "SOMEUSER", "SOMEPASS", "SOMEDB", 3306) if handler then safeusername = mysql_escape_string(handler, username) safepassword = mysql_escape_string(handler, password) accountCheck = "SELECT 'account_name','account_password' FROM 'account_info' WHERE 'account_name'='"..safeusername.."' AND 'account_password'='"..safepassword.."'" if (string.len(username)<3) then outputChatBox ( "Username needs to be longer than 3 characters.", 255, 0, 0) triggerClientEvent("clearlogingui", getRootElement()) mysql_close ( handler ) end local details = mysql_query(handler, accountCheck) if (mysql_num_rows(details) > 0) then outputChatBox ( ""..safeusername.. "") spawnPlayer (client, 1687.7318115234, 1448.0688476563, 10.768267631531, -90, 0, 0) -- spawn the player setCameraTarget (client, client) -- fixate the camera on the player target setElementDimension ( getRootElement(), 0 ) -- spawn the player in the world's standard dimension triggerClientEvent ("onloginsucces", getRootElement()) mysql_close ( handler ) else outputChatBox ( "The username/password combination does not exist.", 255, 0, 0 ) triggerClientEvent("clearlogingui", getRootElement()) mysql_close ( handler ) end end end addEvent ("onLogin", true) -- creates a remote-triggered event linking the client-side script to the server-side login parameters addEventHandler ("onLogin", root, login_seq) -- starts the login sequence function upon the client-side script being triggered is true
  10. Thanks. Failed to fix the issue despite I've tried to for the past 6 hours. This is driving me nuts. ERROR 2003: Can't connect to MySQL server (10060) Any ideas are welcome.
  11. Thanks for commenting. I have all the modules installed to its appropriate locations. This issue is database-side I believe.
  12. Seems to work. Got a new error however which is obviously related to the database in itself. Basically can't connect to the database. I allowed my IP for remote SQL control to enter it with third party software. I use Heidi SQL although whenever I try to connect with the correct information I get this error: Furthermore when calling the function pressing the LOGIN button on the GUI the console outputs the following: I know the second message is a mere residue of the failed MySQL connection handler though.
  13. That worked, thank you, Castillo. Sort of got me on the right path although I'm having issues realising the setup parsing the client info towards the server script. So basically I'm stating the variable 'username_editbox' and 'password_editbox' is whatever I filled out in the login GUI and I parsed this to my server-side script using a trigger event. Now I'm checking whether 'username' and 'password' returns true (although I'm not sure whether I did this right and I probably didn't) in order to spawn the player on condition of the username and password matching an existant account so I can bind further details to it. I'm rather new to MySQL integration. function submitlogin () local username_editbox = guiGetText ( username_box ) local password_editbox = guiGetText ( password_box ) if source == login_button then triggerServerEvent ("onLogin", getRootElement(), username_editbox, password_editbox) guiSetVisible (GUIlogin, false) guiSetVisible (ariabanner, false) showCursor(false) guiSetInputEnabled(false) end end addEventHandler ( "onClientGUIClick", getRootElement(), submitlogin, true) function login_seq (thePlayer) local username = mysql_query(handler, "SELECT account_name FROM account_info WHERE account_name = "username_editbox"") local password = mysql_query(handler, "SELECT account_password FROM account_info WHERE account_password = "password_editbox"") if username and password then spawnPlayer (client, 1687.7318115234, 1448.0688476563, 10.768267631531, -90, 0, 0) setCameraTarget (client, client) setElementDimension ( getRootElement(), 0 ) end addEvent ("onLogin", true) addEventHandler ("onLogin", root, login_seq) How do I integrate the variable string in the query? I get an error line: ')' expected near 'username_editbox'
  14. Hello. Basically I've been working on a log-in system and want to use a MySQL database to save account information. I've worked with MySQL before in school and know about queries and used it back when I ran a WoW RP server however I seem to fail in integrating a variable in the query. So to explain from scratch I have all the MySQL modules installed and have a function allowing me to access the database. function mysql_con () handler = mysql_connect("HOST", "NAME", "PASS", "DATABASE") if (not handler) then outputChatBox("Unable to connect to the MySQL server") else outputChatBox("Hello",client) end end addEventHandler ("onServerResourceStart", getRootElement(), mysql_connect ) Then I want to make it so if you hit the login button on the login screen which is visible on connecting it checks both the username and password in the database. It then triggers another event spawning the player etc.: function submitlogin () local username_editbox = guiGetText ( username_box ) local username = mysql_query(handler, "SELECT account_name FROM account_info WHERE account_name = "username_editbox"") if source == login_button then if username then outputChatBox ( "HELLO") triggerServerEvent ("onLogin", getRootElement(), username_editbox) guiSetVisible (GUIlogin, false) guiSetVisible (ariabanner, false) outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") showCursor(false) guiSetInputEnabled(false) else outputChatBox ( "LOLMAN ") end end end addEventHandler ( "onClientGUIClick", getRootElement(), submitlogin, true)
  15. Thank you! Hadn't thought of that yet. It seems to work. Much appreciated!
  16. So I'm basically working on a log-in screen from scratch and got stuck at spawning the player after getting the username and password etc. checked with MySQL. The problem is when I trigger the submitlogin function the text as defined to be output in the chatbox appears although the player refuses to spawn with the camera shifting to it. What am I doing wrong in this? The issue lies with the spawnPlayer and setCameraTarget line. Script editor doesn't provide me any error lines. function submitlogin () if source == login_button then outputChatBox ( "HELLO") spawnPlayer (localPlayer, 2143.7648925781, 2132.8686523438, 10.671875, 0, 0, 1) setCameraTarget (localPlayer) end end addEventHandler ( "onClientGUIClick", getRootElement(), submitlogin, true)
×
×
  • Create New...