Jump to content

flashman

Members
  • Posts

    11
  • Joined

  • Last visited

Details

  • Gang
    bad

flashman's Achievements

Square

Square (6/54)

0

Reputation

  1. One more question: outputChatBox("#8F8F8F [ #FFFFFF Admin #8F8F8F ]"..getPlayerName(source)..":"..text) But the text isn't colorful! The hex codes dont change to colors!
  2. Oh yes, thank you very much. Sorry for this.
  3. cancelEvent () outputChatBox(text) end addEventHandler("onPlayerChat", getRootElement(), PlayerText) Why doesen't the event get cancelled? My original message still gets sent.
  4. Maybe make some GUI in GuiEditor, place it where u want ur bar to be and then get the GUI coordinates?
  5. Hi: GUIEditor = { staticimage = {}, edit = {}, button = {}, window = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0.37, 0.28, 0.23, 0.35, "", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(0.03, 0.85, 0.46, 0.11, "LOGIN", true, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF7F7D7D") GUIEditor.button[2] = guiCreateButton(0.51, 0.85, 0.45, 0.11, "REGISTER", true, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(0.12, 0.72, 0.78, 0.08, "", true, GUIEditor.window[1]) guiEditSetMasked(GUIEditor.edit[1], true) GUIEditor.label[1] = guiCreateLabel(0.40, 0.67, 0.22, 0.04, "Password:", true, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.staticimage[1] = guiCreateStaticImage(0.03, 0.06, 0.93, 0.43, ":loginsystem/mtalogo.png", true, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(0.12, 0.56, 0.78, 0.08, "", true, GUIEditor.window[1]) guiEditSetMasked(GUIEditor.edit[2], false)--username GUIEditor.label[2] = guiCreateLabel(0.40, 0.52, 0.22, 0.04, "Username:", true, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") end ) function playerJoin() guiSetVisible(GUIEditor.window[1], true ) showCursor( true ) guiSetInputEnabled( true ) setCameraMatrix( -1799.6999511719, 1856.5999755859, 30.39999961853, -1763.9000244141, 1852.5999755859, 19.799999237061 ) fadeCamera (true) outputChatBox("Player joined.") end addEvent("onJoin", true) addEventHandler("onJoin", getRootElement(), playerJoin) function closeWindow() guiSetVisible(GUIEditor.window[1], false ) showCursor( false ) guiSetInputEnabled( false ) end addEvent("closeWindow", true) addEventHandler("closeWindow", getRootElement(), closeWindow) function login_player ( source ) outputChatBox("Player clicked on login button, executing server part.") triggerServerEvent ( "onLogin", getRootElement(), getLocalPlayer(), guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) end addEventHandler("onClientGUIClick", GUIEditor.button[1], login_player, false) -- button 2 is username That part is not working: "outputChatBox("Player clicked on login button, executing server part.")". The message does not get sent, but the join message does, what's wrong?
  6. Thank you very much, Castillo. I don't know why, but I had deleted the part. I really appreciate that you found some time to help me
  7. I cant understand you very well.. this is all the files I have, I just copy the gui from GUIeditor. C:\Program Files (x86)\MTA San Andreas 1.3\server\mods\deathmatch\resources\guieditor C:\Program Files (x86)\MTA San Andreas 1.3\server\mods\deathmatch\resources\loginsystem
  8. Hi. I made a GUI with the GUIcreator and used some other script to make the login button. Client: GUIEditor.window[1] = guiCreateWindow(0.37, 0.28, 0.23, 0.35, "", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(0.03, 0.85, 0.46, 0.11, "LOGIN", true, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF7F7D7D") GUIEditor.button[2] = guiCreateButton(0.51, 0.85, 0.45, 0.11, "REGISTER", true, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(0.12, 0.72, 0.78, 0.08, "", true, GUIEditor.window[1]) guiEditSetMasked(GUIEditor.edit[1], true) GUIEditor.label[1] = guiCreateLabel(0.40, 0.67, 0.22, 0.04, "Password:", true, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.staticimage[1] = guiCreateStaticImage(0.03, 0.06, 0.93, 0.43, ":guieditor/images/examples/mtalogo.png", true, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(0.12, 0.56, 0.78, 0.08, "", true, GUIEditor.window[1]) guiEditSetMasked(GUIEditor.edit[2], true) GUIEditor.label[2] = guiCreateLabel(0.40, 0.52, 0.22, 0.04, "Username:", true, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") function playerJoin() guiSetVisible(GUIEditor.window[1], true ) showCursor( true ) guiSetInputEnabled( true ) setCameraMatrix( -1799.6999511719, 1856.5999755859, 30.39999961853, -1763.9000244141, 1852.5999755859, 19.799999237061 ) fadeCamera (true) end addEvent("onJoin", true) addEventHandler("onJoin", getRootElement(), playerJoin) function closeWindow() guiSetVisible(GUIEditor.window[1], false ) showCursor( false ) guiSetInputEnabled( false ) end addEvent("closeWindow", true) addEventHandler("closeWindow", getRootElement(), closeWindow) function login_player ( source ) triggerServerEvent ( "onLogin", getRootElement(), getLocalPlayer(), guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) end addEventHandler("onClientGUIClick", GUIEditor.button[1], login_player,false) Server: -- Default host = "127.0.0.1" -- Database Host username = "root" -- Database Username password = "" -- Database Password db = "accounts" -- Database ( Where you got your tables ) handler = mysql_connect( host, username, password, db ) addEventHandler("onPlayerJoin", getRootElement(), function() triggerClientEvent(source, "onJoin", getRootElement()) end ) function onLogin ( player, user, pass ) handler = mysql_connect( host, username, password, db ) local login = mysql_query(handler,"SELECT * FROM account_data WHERE AccountName = '"..mysql_escape_string( handler, user ).."' AND Password = '"..mysql_escape_string( handler, md5(pass) ).."';") if login then local rows = mysql_num_rows(login) if rows == 1 then triggerClientEvent( player, "closeWindow", getRootElement() ) outputChatBox("* You successfully logged in your account!", player, 255, 255, 255) spawnPlayer( player, 0,0,3 ) fadeCamera( player, true ) setCameraTarget( player, player ) else outputChatBox("* Login failed!", player, 255, 255, 255) end mysql_free_result(login) end end addEvent( "onLogin", true ) addEventHandler( "onLogin", getRootElement(), onLogin ) Meta: type="script" author="Risto" name="Login Register System (MySQL)" version="1.0"/> But when I go in game no gui is displayed for me.
  9. What about the MySQL system?
  10. How can I make a nice login screen like this? How can I make the background blurry, add some logo there? Make a nice GUI? And also any tips how to start with the MySQL login/register system when you are a beginner in LUA? I dont wan't you to make the script for me, maybe you know some good tutorials or wiki pages or anything to get me started? Thanks.
×
×
  • Create New...