Jump to content

Om.

Members
  • Posts

    99
  • Joined

  • Last visited

Posts posted by Om.

  1. OR, You can use something like table to protect many nicks e.g

    local protected = {
      ["Nickname1"] = "Player 1 Serial",
      ["Nickname2"] = "Player 2 Serial"
    }
    
    function checkForNickname()
      local name = getPlayerName(source)
      if protected[name] then
       local serial = getPlayerSerial(source)
          if serial ~= protected[name] then
          	kickPlayer(source, "Nickname is protected!")
          end
       end
    end
    addEventHandler("onPlayerJoin", root, checkForNickname)
    addEventHandler("onPlayerChangeNick", root, checkforNickname)

    Still didn't test it tho, should work

  2. If you mean this: 

    Spoiler

    Al2Cg8q.png

     

    Then it's probably your pc. For me, this error occurs whenever I don't have my audio device (Headphones/Speakers) plugged in. If it's plugged in then i get no error(s). Incase you've already plugged your headsets and it still says the same, You gotta install Realtek Audio Drivers

  3. On 12/23/2016 at 0:05 AM, Arran said:

    Should be more like:

    
    setTimer(setElementData, 60000 * 10, 1, thePlayer, "isPlayerMuted", false)
    

    But thePlayer could easily have quit within those 10 minutes. Also your entire script is fundamentally flawed because there is no verification of permission, such things should be done server side and verify permission with hasObjectPermissionTo and there is also avoid using setElementData for important stuff like whether someone is muted unless you have server side checks to prevent that element data being changed by a client. Further reading on that here:

    https://wiki.multitheftauto.com/wiki/Script_security

     

    Well, This one worked too :3 thank you

  4. 4 hours ago, wazoka93 said:

    [2016-12-21 17:43:39] WARNING: exg_carshop\sourceS.lua:65: Bad argument @ 'dbQuery' [Expected db-connection at argument 1]
    [2016-12-21 17:43:39] WARNING: exg_carshop\sourceS.lua:68: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]
    [2016-12-21 17:45:03] WARNING: mta_speedo\ex_Server.lua:4: Bad argument @ 'dbExec' [Expected db-connection at argument 1]
    [2016-12-21 17:45:24] WARNING: mta_vehicle\sourceS.lua:267: Bad argument @ 'dbQuery' [Expected db-connection at argument 1]

     

    whats the problem? please help

    in dbQuery, you have to put 2 argument, first the connection handler, second is mysql query. Example:

    conn = dbConnect("blabla")
    query = dbQuery(conn, "Your MySQL Query.")

     

    • Like 1
  5. function mutePlayer(button)
      if button == "left" then
        if (source == playerTab.button[2]) then
          player = guiGridListGetSelectedItemText(GUIEditor.gridlist[1])
          time = guiGetText(playerTab.combobox[1])
          reason = guiGetText(playerTab.edit[1])
          thePlayer = getPlayerFromName(player)
          if (time == "10 mins") then
            setElementData(thePlayer, "isPlayerMuted", true)
            setTimer(setElementData, 1000, 1, getPlayerFromName(player), false)
            outputChatBox("(Admin) " .. player .. " has been muted for 10 minutes by " .. getPlayerName(localPlayer) .. " for " .. reason)
          end
          guiSetVisible(playerTab.window[1], false)
          guiSetVisible(GUIEditor.window[1], true)
        end
      end
    end
    addEventHandler("onClientGUIClick", resourceRoot, mutePlayer)

    Debug Error says: Bad argument @ 'setElementData' [Expected string at argument 2, got boolean on this line:

    setTimer(setElementData, 1000, 1, getPlayerFromName(player), false)

     

  6. Login System

    Some Images of GUI:

     https://puu.sh/sJnRg/2928be4ec3.png

    https://puu.sh/sJnTw/cb57d4b9ce.png

     

    Features:

    1. Uses External MySQL Database for register/login
    2. Logs in user to MTA System if account exist.
    3. It is opensource :x

    Installation:

    1. Configure your database configurations in server.lua
    2. Export database.sql to your selected database.
    3. Add this resource to your ACL's admin group and boom!
    4. Finished! You can start the script and connect to the server! :D

     

    Download Links

    1.  MTA Community Resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=13930

    Exports:

    -- To Be Updated..
    
    exports.login:getPlayerUsername(player) -- Gets Player Username.

     

    • Like 1
    • Thanks 1
  7. @MR.S3D

     You didn't get me, Opening the GUI works perfectly fine, but when there are many people on logging screen, if one guy clicks "Login" button, The Login GUI Disappears for everyone who were on login gui

     

    ps: it got solved automatically, lol

    • Like 1
  8. after clicking "login button" everything works fine, but GUI closes to all players who are in login screen instead of only the localplayer, pls help :)

       function successfullLogin()
         fadeCamera(true, 1, 255, 0, 0)
         guiSetVisible(GUIEditor.window[1], false)
         showCursor(false)
     end
       addEvent("login.success", true)
       addEventHandler("login.success", root, successfullLogin)

     

  9. DEBUG ERROR: bad argument @ 'attachElements' [Expected element at argument 1, got boolean] 

    I've no idea why.

     

    local helicopter = {
      ["Police Maverick"] = true,
      ["Sparrow"] = true,
      ["Cargobob"] = true,
      ["Hunter"] = true,
    }
    
    function SwatRope()
        local myVehicle = getPedOccupiedVehicle(localPlayer)
        if myVehicle and helicopter[getVehicleName(myVehicle)] then
            local x,y,z = getElementPosition(myVehicle)
            local loc = createSWATRope(x, y, z, 10000)
            attachElements(loc, localPlayer, 0, 0, 5)
        end
    end
    addCommandHandler("rope", SwatRope)

     

  10. 23 hours ago, Savannah said:

    Won't GuiSetText work?

    It works, but it does not change, it remains stable. since last is SF Airport, Title comes of SF for all GUIs. anyways this is solved, thank you

     

    20 hours ago, LoPollo said:

    I tested and it's working. @Om. now has his answer, and @Savannah gets my +1. I didn't knew this, ty

    You probably tested only in easten bay airport.

  11. 2 minutes ago, LoPollo said:

    Honestly if you need to change a window title... it's very possible that there's a better way to do it (or at least respecting mta's limits)

    Yep, there's no function to change the title. A workaround may be crating a temp window with the new title, move all elements of the old window to the new one, destroy the old window and assign the temp window to the old var

    gotta try it' thanks 

  12. --[[
    -- Resource Name: Information.
    -- Author: Om (RipeMangoes69)
    -- Date: 4/12/2016
    -- File: client.lua
    ]]--
    
    -- GUI
    
    
    
    GUIEditor = {
        window = {},
        label = {},
        memo = {}
    }
    
    function createInfoObjects()
    local markers = {
      {area = "Los Santos Airport", x = 1582.45, y = -2286.32, z = 12},
      {area = "Las Vegas Airport", x = 1674.30859375, y = 1444.9501953125, z = 9.2}
    }
    
    for _, m in ipairs(markers) do
      local marker = createMarker(m.x, m.y, m.z, "cylinder", 1, 255, 255, 255, 100)
      GUIEditor.window[1] = guiCreateWindow(645, 250, 266, 378, "Information: " .. m.area, false)
      guiWindowSetSizable(GUIEditor.window[1], false)
      guiSetVisible(GUIEditor.window[1], false)
      GUIEditor.label[1] = guiCreateLabel(5, 353, 190, 15, "* Click anywhere on GUI Window to close it.", false, GUIEditor.window[1])
      guiSetFont(GUIEditor.label[1], "default-small")
      GUIEditor.memo[1] = guiCreateMemo(9, 24, 247, 324, "", false, GUIEditor.window[1])
      guiMemoSetReadOnly(GUIEditor.memo[1], true)
    end
    end
    addEventHandler("onClientResourceStart", getRootElement(), createInfoObjects)
    
    
    function openGUI( hitElement, matchingDimension )
        if getElementType( hitElement ) == "player" then
              if isPedInVehicle(hitElement) then
                outputChatBox("You cannot access GUI from vehicle!", 255, 0, 0)
                guiSetVisible(GUIEditor.window[1], false)
                showCursor(false)
              else
                guiSetVisible(GUIEditor.window[1], true)
                showCursor(true)
        end
      end
    end
    addEventHandler("onClientMarkerHit", resourceRoot, openGUI)
    
    function closeGUI()
      guiSetVisible(GUIEditor.window[1], false)
      showCursor(false)
    end
    addEventHandler("onClientGUIClick", resourceRoot, closeGUI)

    How am i suppose to "change" the GUI Title ? (area in the table). thanks.

×
×
  • Create New...