Jump to content

Forums

  1. Multi Theft Auto: San Andreas 1.x

    1. Support for MTA:SA 1.x

      HELP! HELP! Need help? Post here.

      54.8k
      posts
    2. User Guides

      These guides are a good place to start learning how to achieve certain things within MTA in an efficient and well mannered way.

      11
      posts
    3. Open Source Contributors

      This space is for contributors to discuss the development of MTA. No user suggestions/support.

      1.3k
      posts
    4. Suggestions

      Suggestions and requests go here. Please note that actual feature requests must be filed on our GitHub.

      7.7k
      posts
    5. Ban appeals

      Use this forum to appeal your GLOBAL MTA:SA bans. Permanent bans only - appeals for timed ones (eg. 24 hours) will be refused.

      Do not use it for appealing server-specific bans as we do not have power over these specific servers.

      4.6k
      posts
  2. General MTA

    1. News

      News and updates on Multi Theft Auto.

      9.8k
      posts
    2. Media

      User-made screens and movies go here.

      4.5k
      posts
    3. Site/Forum/Discord/Mantis/Wiki related

      Share your comments & concerns about our services.

      5.6k
      posts
    4. MTA Chat

      MTA related chat that is NOT support related!

      2.1k
      posts
    5. 330.2k
      posts
  3. MTA Community

    1. Scripting

      All Lua scripting topics related to Multi Theft Auto.

      261.1k
      posts
    2. Maps

      Discussions for maps on various gamemodes.

      13.4k
      posts
    3. Resources

      Everything else about resources.

      28.5k
      posts
    4. Other Creations & GTA modding

      This section includes things such as GUI themes, forum userbars, user-created MTA logos, etc. Also contains topics which cover general GTA modding areas that can be used in MTA, such as modelling.

      2.4k
      posts
    5. Competitive gameplay

      Discussions about various MTA-related competitive gameplay events. Also gang (clan) forums.

      26.7k
      posts
    6. Servers

      Looking for a server to play on? Looking for someone to host your server? Looking for a place to discuss with other server owners? Here's where to look.

      15.6k
      posts
  4. Other

    1. General

      Non-MTA discussions. Anything you want.

      38.1k
      posts
    2. Multi Theft Auto 0.5r2

      Discussion regarding Multi Theft Auto 0.5r2 for GTAIII and Vice City.

      672
      posts
    3. Third party GTA mods

      Showcase for single player mods and requests.

      811
      posts
  5. Archive

    1. 144k
      posts
    2. Trash

      These posts have broken forum rules. They are stored here temporarily so offending users can see what they have done wrong.

      2.5k
      posts
  • Posts

    • hi guys  Is it possible to add a sound effect like this video to the sound of the player? I want to make a megaphone for police video :  megaphone voice
    • Please close this thread thanks!
    • Change resourceRoot to root in the loginAccount event on server-side
    • I see, thanks how do I make the gui that when i press the key again it closes? addEvent("playerOnClick", true) addEventHandler("playerOnClick", root, function() guiGridListClear ( w.gridList.main ) for i,veh in ipairs(getElementsByType("vehicle")) do if veh ~= vehicle then local row = guiGridListAddRow ( w.gridList.main ) local x,y,z = getElementPosition(veh) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column1, getVehicleName ( veh ), false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column2, x, false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column3, y, false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column4, z, false, false ) end end guiSetVisible(w.main, true) showCursor(true) end ) function hasPermission(key,keyState) if getElementData(localPlayer, "logedin") then triggerServerEvent("hasPermissionEvent",localPlayer,key,keyState) end end bindKey("p", "down", hasPermission)     Edit : you can disregard these, I made if else statement and created to false.    function playerOnClick(key,keyState) if (keyState == "down") then if (guiGetVisible(w.main) == false) then guiGridListClear ( w.gridList.main ) for i,veh in ipairs(getElementsByType("vehicle")) do if veh ~= vehicle then local row = guiGridListAddRow ( w.gridList.main ) local x,y,z = getElementPosition(veh) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column1, getVehicleName ( veh ), false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column2, x, false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column3, y, false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column4, z, false, false ) end end guiSetVisible(w.main, true) showCursor(true) else guiSetVisible(w.main, false) showCursor(false) end end end addEvent("playerOnClick",true) addEventHandler("playerOnClick",root,playerOnClick)     but of course, If you can recommend a better way than what I did please feel free to share your opinion I would very much appreciate it. 
    • Dears, it says: ERROR: Client triggered serverside event loginAccount, but event is not added serverside Can someone check it why? I couldn't find the error. client.lua : -- Create the login GUI local loginWindow = guiCreateWindow(400, 300, 300, 200, "Login", false) local usernameLabel = guiCreateLabel(20, 30, 80, 20, "Username:", false, loginWindow) local usernameEdit = guiCreateEdit(100, 30, 160, 20, "", false, loginWindow) local passwordLabel = guiCreateLabel(20, 60, 80, 20, "Password:", false, loginWindow) local passwordEdit = guiCreateEdit(100, 60, 160, 20, "", false, loginWindow) local rememberCheckbox = guiCreateCheckBox(20, 90, 200, 20, "Remember me", false, false, loginWindow) local loginButton = guiCreateButton(20, 120, 120, 30, "Login", false, loginWindow) guiSetVisible( loginWindow, false ) -- Create the registration GUI local registerWindow = guiCreateWindow(400, 300, 300, 250, "Registration", false) local regUsernameLabel = guiCreateLabel(20, 30, 80, 20, "Username:", false, registerWindow) local regUsernameEdit = guiCreateEdit(100, 30, 160, 20, "", false, registerWindow) local regPasswordLabel = guiCreateLabel(20, 60, 80, 20, "Password:", false, registerWindow) local regPasswordEdit = guiCreateEdit(100, 60, 160, 20, "", false, registerWindow) local regConfirmLabel = guiCreateLabel(20, 90, 80, 20, "Confirm:", false, registerWindow) local regConfirmEdit = guiCreateEdit(100, 90, 160, 20, "", false, registerWindow) local regEmailLabel = guiCreateLabel(20, 120, 80, 20, "Email:", false, registerWindow) local regEmailEdit = guiCreateEdit(100, 120, 160, 20, "", false, registerWindow) local registerButton = guiCreateButton(20, 150, 120, 30, "Register", false, registerWindow) guiSetVisible( registerWindow, false ) -- Show the login GUI when the resource starts and show cursor addEventHandler("onClientResourceStart", resourceRoot, function() guiSetVisible( loginWindow, true ) showCursor( true ) end) -- Login Event addEventHandler("onClientGUIClick", loginButton, function() local username = guiGetText(usernameEdit) local password = guiGetText(passwordEdit) local rememberMe = guiCheckBoxGetSelected(rememberCheckbox) triggerServerEvent("loginAccount", resourceRoot, username, password, rememberMe) end, false) -- Register Event addEventHandler("onClientGUIClick", registerButton, function() local username = guiGetText(regUsernameEdit) local password = guiGetText(regPasswordEdit) local passwordAgain = guiGetText(regConfirmEdit) local email = guiGetText(regEmailEdit) triggerServerEvent("registerAccount", resourceRoot, username, password, passwordAgain, email) end, false) -- Login Success Event addEvent("onAccountLoggedIn", true) addEventHandler("onAccountLoggedIn", resourceRoot, function() -- Handle login success end) -- Login Failure Event addEvent("onAccountLoginFailed", true) addEventHandler("onAccountLoginFailed", resourceRoot, function() -- Handle login failure end) -- Registration Success Event addEvent("onAccountRegistered", true) addEventHandler("onAccountRegistered", resourceRoot, function() -- Handle registration success end) -- Registration Failure Event addEvent("onAccountRegistrationFailed", true) addEventHandler("onAccountRegistrationFailed", resourceRoot, function() -- Handle registration failure end) server.lua :  addEvent("loginAccount", true) addEventHandler("loginAccount", resourceRoot, function(username, password, rememberMe) local player = client if not isPlayerBanned(player) then if handleLogin(username, password, rememberMe) then triggerClientEvent(player, "onAccountLoggedIn", player) else triggerClientEvent(player, "onAccountLoginFailed", player) end else triggerClientEvent(player, "onAccountBanned", player) end end) addEvent("registerAccount", true) addEventHandler("registerAccount", resourceRoot, function(username, password, passwordAgain, email) local player = client local ip = getPlayerIP(player) local serial = getPlayerSerial(player) if handleRegistration(username, password, passwordAgain, email, ip, serial) then triggerClientEvent(player, "onAccountRegistered", player) else triggerClientEvent(player, "onAccountRegistrationFailed", player) end end) meta.xml:   <meta> <info author="" name="Account system" version="1.0" type="script" /> <script src="server.lua" type="server" /> <script src="client.lua" type="client" /> </meta> mysq/server.lua:   -- Create a function to handle database queries function queryHandler(query, ...) local query = dbQuery(connection, query, ...) if not query then outputDebugString("Can't do the request") return end local result, num_affected_rows, last_insert_id = dbPoll(query, -1) return result, num_affected_rows, last_insert_id end  

Twitter Feed

×
×
  • Create New...