Jump to content

Om.

Members
  • Posts

    99
  • Joined

  • Last visited

Everything posted by Om.

  1. You'd probably have it install fresh MTA Server but you can just use your old database file and resources. That way would be better. Installing MTA Depending on your new Operating System (64/32bits)
  2. Using default screen command is kinda not secured, maybe try sticking it to background? might be better
  3. Full Script: -- Client Side Script. addEventHandler ( 'onClientGUIClick', root, function () if (source == kickSubmitBtn) then local reason = guiGetText(Kickreason) player = guiGridListGetItemText ( playersGrid, guiGridListGetSelectedItem ( playersGrid ), 1 ) triggerServerEvent("ERP.staff:kickPlayer", resourceRoot, player, reason) end end ) -- Server Sided Script function kickPlrFromAdminPanel(thePlayer, reason) plr = getPlayerFromName(thePlayer) outputChatBox("User: "..plr.." has been kicked from the server. ("..reason..")", root) kickPlayer(plr, reason) end addEvent("ERP.staff:kickPlayer", true) addEventHandler("ERP.staff:kickPlayer", resourceRoot, kickPlrFromAdminPanel) There are no debug errors, i have no idea why. When i click "Kick player Button", it dosnt trigger, but if i output the value of player and reason vars, they work.
  4. Debug Error:ERROR: ERPcore/information.lua:9: attempt to get length of global 'randomLabel' (a nil value) Client: informationLabels = { 'Press F1 for Rules Panel', 'dministrators can be identified with [ADMIN] Tag on them.', 'Dont break the rules, or else you will get punished.', 'Be sure you visit our forums!' } function printInfo() local randomLabel = informationLabels[math.random(1, #randomLabel)] outputChatBox(randomLabel) end setTimer(printInfo, 1000, 1)
  5. Debug Error: WARNING: [om]/ERPcore/server.lua:37: Bad argument @ 'triggerClientEvent' [Expected element at argument 2, got nil] Client: -- Register Panel GUI function registerGUI() window = guiCreateWindow(500, 310, 329, 236, "MTA ERP - Login System", false) guiWindowSetSizable(window, false) guiSetVisible(window, false) username = guiCreateLabel(9, 36, 63, 15, "Username", false, window) guiSetFont(username, "default-bold-small") password = guiCreateLabel(9, 90, 63, 15, "Password", false, window) guiSetFont(password, "default-bold-small") userInput = guiCreateEdit(87, 27, 218, 34, "", false, window) passInput = guiCreateEdit(87, 80, 218, 34, "", false, window) guiEditSetMasked(passInput, true) email = guiCreateLabel(9, 142, 63, 15, "Email", false, window) guiSetFont(email, "default-bold-small") emailInput = guiCreateEdit(87, 133, 218, 34, "", false, window) register = guiCreateButton(15, 189, 132, 37, "Register", false, window) guiSetFont(register, "default-bold-small") buttonCan = guiCreateButton(167, 189, 132, 37, "Close", false, window) guiSetFont(buttonCan, "default-bold-small") end addEventHandler("onClientResourceStart", getRootElement(), registerGUI) -- Login Panel GUI function loginGUI() loginwindow = guiCreateWindow(372, 180, 629, 519, "ERP:MTA - Login Panel", false) guiWindowSetSizable(loginwindow, false) guiSetVisible(loginwindow, false) usernameLable = guiCreateLabel(24, 39, 181, 58, "Username", false, loginwindow) guiSetFont(usernameLable, "sa-header") passwordLable = guiCreateLabel(24, 120, 181, 58, "Password", false, loginwindow) guiSetFont(passwordLable, "sa-header") username = guiCreateEdit(235, 42, 366, 55, "", false, loginwindow) password = guiCreateEdit(235, 123, 366, 55, "", false, loginwindow) guiEditSetMasked(password, true) clickOnlogin = guiCreateButton(442, 199, 149, 42, "Login", false, loginwindow) clickOnRegister = guiCreateButton(245, 199, 149, 42, "Register", false, loginwindow) clickOnGuide = guiCreateButton(46, 199, 149, 42, "Server Guide", false, loginwindow) stats = guiCreateMemo(16, 254, 592, 248, "", false, loginwindow) end addEventHandler("onClientResourceStart", getRootElement(), loginGUI) -- Show login panel when you connect to the server. function openDemGui(thePlayer) guiSetVisible(loginwindow, true) showCursor(true) showChat(false) guiMemoSetReadOnly(stats, true) end addEvent("nobfokopenlogin", true) addEventHandler("nobfokopenlogin", resourceRoot, openDemGui) -- Logs into account addEventHandler ( 'onClientGUIClick', root, function () if (source == clickOnlogin) then if pass ~= nil or pass ~= "" or user ~= nil or user ~= "" then user = guiGetText(username) pass = guiGetText(password) triggerServerEvent("loginPlayer", getRootElement(), user, pass) else outputChatBox("Please enter username & password") end end end ) -- Registers an account. addEventHandler ( 'onClientGUIClick', root, function () if (source == register) then if user ~= nil or user ~= "" or pass ~= nil or pass ~= "" then user = guiGetText(userInput) pass = guiGetText(passInput) triggerServerEvent("registerPlayer", getRootElement(), user, pass) else outputChatBox("Please enter username & password") end end end ) -- Register Player Login GUI addEventHandler ( 'onClientGUIClick', root, function () if (source == clickOnRegister) then guiSetVisible(window, true) closeLoginGUI() showCursor(true) end end ) function closeLoginGUI() guiSetVisible(loginwindow, false) end addEvent("closeLoginGUI", true) addEventHandler("closeLoginGUI", getRootElement(), closeLoginGUI) function closeRegisterGUI() guiSetVisible(window, false) showCursor(false) end addEvent("closeRegisterGUI", true) addEventHandler("closeRegisterGUI", getRootElement(), closeRegisterGUI) -- Closing GUI from "Button Click" addEventHandler ( 'onClientGUIClick', root, function () if (source == buttonCan) then guiSetVisible (window, false) showCursor(true) guiSetVisible(loginwindow, true) end end ) Server: function loginPlayer(username, password) local account = getAccount(username, password) if user ~= nil or user ~= "" or pass ~= nil or pass ~= "" then if (account ~= false) then logIn(client, account, password) triggerClientEvent("closeLoginGUI", client) showCursor(client, false) showChat(client, true) else outputChatBox("Invalid username & password!", client, 255, 0, 0) end else outputChatBox("Please enter username and password.", client) end end addEvent("loginPlayer", true) addEventHandler("loginPlayer", getRootElement(), loginPlayer) function createAccount(username, password) if (password ~= "" and password ~= nil and username ~= "" and username ~= nil) then local addedAccount = addAccount(username, password) if (addedAccount) then outputChatBox("You have been successfully registered and logged in!", client) loginPlayer(username, password) triggerClientEvent("closeRegisterGUI", client) else outputChatBox("An account with your username is already registered.", client) end else outputChatBox("Please enter username and password.", client) end end addEvent("registerPlayer", true) addEventHandler("registerPlayer", getRootElement(), createAccount) function showGUI() triggerClientEvent("nobfokopenlogin", client) fadeCamera(source, true, 5) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end addEventHandler("onPlayerJoin", getRootElement(), showGUI) addEventHandler("onResourceStart", resourceRoot, function() setGameType ("FTA: v1.0.0") resetMapInfo() for _, player in ipairs (getElementsByType("player")) do kickPlayer(player, client) end end ) function createTeams() admin = createTeam("Admin", 0, 255, 0) noteam = createTeam("Unemployed", 255, 255, 0) end addEventHandler("onResourceStart", resourceRoot, createTeams) exports.scoreboard:addScoreboardColumn('Country') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Country",flag) end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) function showPos(thePlayer) x,y,z = getElementPosition(thePlayer) outputChatBox("X, Y, Z: " .. x .. "," .. y .. "," .. z, client) end addCommandHandler("pos", showPos) function onLogout () cancelEvent() outputChatBox("Logout command has been disabled due to abuse.", client, 255, 0, 0) end addEventHandler ("onPlayerLogout", getRootElement(), onLogout) function chatbox(text, msgtype) if (msgtype == 0) then cancelEvent() local name = getPlayerName(source) local r, g, b = getPlayerNametagColor(source) local country = exports.admin:getPlayerCountry(source) outputChatBox("["..country.."] " .. name .. ": "..text, client, r, g, b) end end addEventHandler("onPlayerChat", root, chatbox)
  6. Debug Error: WARNING: [om]/ERPcore/server.lua:37: Bad argument @ 'triggerClientEvent' [Expected element at argument 2, got nil] Client: -- Register Panel GUI function registerGUI() window = guiCreateWindow(500, 310, 329, 236, "MTA ERP - Login System", false) guiWindowSetSizable(window, false) guiSetVisible(window, false) username = guiCreateLabel(9, 36, 63, 15, "Username", false, window) guiSetFont(username, "default-bold-small") password = guiCreateLabel(9, 90, 63, 15, "Password", false, window) guiSetFont(password, "default-bold-small") userInput = guiCreateEdit(87, 27, 218, 34, "", false, window) passInput = guiCreateEdit(87, 80, 218, 34, "", false, window) guiEditSetMasked(passInput, true) email = guiCreateLabel(9, 142, 63, 15, "Email", false, window) guiSetFont(email, "default-bold-small") emailInput = guiCreateEdit(87, 133, 218, 34, "", false, window) register = guiCreateButton(15, 189, 132, 37, "Register", false, window) guiSetFont(register, "default-bold-small") buttonCan = guiCreateButton(167, 189, 132, 37, "Close", false, window) guiSetFont(buttonCan, "default-bold-small") end addEventHandler("onClientResourceStart", getRootElement(), registerGUI) -- Login Panel GUI function loginGUI() loginwindow = guiCreateWindow(372, 180, 629, 519, "ERP:MTA - Login Panel", false) guiWindowSetSizable(loginwindow, false) guiSetVisible(loginwindow, false) usernameLable = guiCreateLabel(24, 39, 181, 58, "Username", false, loginwindow) guiSetFont(usernameLable, "sa-header") passwordLable = guiCreateLabel(24, 120, 181, 58, "Password", false, loginwindow) guiSetFont(passwordLable, "sa-header") username = guiCreateEdit(235, 42, 366, 55, "", false, loginwindow) password = guiCreateEdit(235, 123, 366, 55, "", false, loginwindow) guiEditSetMasked(password, true) clickOnlogin = guiCreateButton(442, 199, 149, 42, "Login", false, loginwindow) clickOnRegister = guiCreateButton(245, 199, 149, 42, "Register", false, loginwindow) clickOnGuide = guiCreateButton(46, 199, 149, 42, "Server Guide", false, loginwindow) stats = guiCreateMemo(16, 254, 592, 248, "", false, loginwindow) end addEventHandler("onClientResourceStart", getRootElement(), loginGUI) -- Show login panel when you connect to the server. function openDemGui(thePlayer) guiSetVisible(loginwindow, true) showCursor(true) showChat(false) guiMemoSetReadOnly(stats, true) end addEvent("nobfokopenlogin", true) addEventHandler("nobfokopenlogin", resourceRoot, openDemGui) -- Logs into account addEventHandler ( 'onClientGUIClick', root, function () if (source == clickOnlogin) then if pass ~= nil or pass ~= "" or user ~= nil or user ~= "" then user = guiGetText(username) pass = guiGetText(password) triggerServerEvent("loginPlayer", getRootElement(), user, pass) else outputChatBox("Please enter username & password") end end end ) -- Registers an account. addEventHandler ( 'onClientGUIClick', root, function () if (source == register) then if user ~= nil or user ~= "" or pass ~= nil or pass ~= "" then user = guiGetText(userInput) pass = guiGetText(passInput) triggerServerEvent("registerPlayer", getRootElement(), user, pass) else outputChatBox("Please enter username & password") end end end ) -- Register Player Login GUI addEventHandler ( 'onClientGUIClick', root, function () if (source == clickOnRegister) then guiSetVisible(window, true) closeLoginGUI() showCursor(true) end end ) function closeLoginGUI() guiSetVisible(loginwindow, false) end addEvent("closeLoginGUI", true) addEventHandler("closeLoginGUI", getRootElement(), closeLoginGUI) function closeRegisterGUI() guiSetVisible(window, false) showCursor(false) end addEvent("closeRegisterGUI", true) addEventHandler("closeRegisterGUI", getRootElement(), closeRegisterGUI) -- Closing GUI from "Button Click" addEventHandler ( 'onClientGUIClick', root, function () if (source == buttonCan) then guiSetVisible (window, false) showCursor(true) guiSetVisible(loginwindow, true) end end ) Server: function loginPlayer(username, password) local account = getAccount(username, password) if user ~= nil or user ~= "" or pass ~= nil or pass ~= "" then if (account ~= false) then logIn(client, account, password) triggerClientEvent("closeLoginGUI", client) showCursor(client, false) showChat(client, true) else outputChatBox("Invalid username & password!", client, 255, 0, 0) end else outputChatBox("Please enter username and password.", client) end end addEvent("loginPlayer", true) addEventHandler("loginPlayer", getRootElement(), loginPlayer) function createAccount(username, password) if (password ~= "" and password ~= nil and username ~= "" and username ~= nil) then local addedAccount = addAccount(username, password) if (addedAccount) then outputChatBox("You have been successfully registered and logged in!", client) loginPlayer(username, password) triggerClientEvent("closeRegisterGUI", client) else outputChatBox("An account with your username is already registered.", client) end else outputChatBox("Please enter username and password.", client) end end addEvent("registerPlayer", true) addEventHandler("registerPlayer", getRootElement(), createAccount) function showGUI() triggerClientEvent("nobfokopenlogin", client) fadeCamera(source, true, 5) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end addEventHandler("onPlayerJoin", getRootElement(), showGUI) addEventHandler("onResourceStart", resourceRoot, function() setGameType ("FTA: v1.0.0") resetMapInfo() for _, player in ipairs (getElementsByType("player")) do kickPlayer(player, client) end end ) function createTeams() admin = createTeam("Admin", 0, 255, 0) noteam = createTeam("Unemployed", 255, 255, 0) end addEventHandler("onResourceStart", resourceRoot, createTeams) exports.scoreboard:addScoreboardColumn('Country') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Country",flag) end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) function showPos(thePlayer) x,y,z = getElementPosition(thePlayer) outputChatBox("X, Y, Z: " .. x .. "," .. y .. "," .. z, client) end addCommandHandler("pos", showPos) function onLogout () cancelEvent() outputChatBox("Logout command has been disabled due to abuse.", client, 255, 0, 0) end addEventHandler ("onPlayerLogout", getRootElement(), onLogout) function chatbox(text, msgtype) if (msgtype == 0) then cancelEvent() local name = getPlayerName(source) local r, g, b = getPlayerNametagColor(source) local country = exports.admin:getPlayerCountry(source) outputChatBox("["..country.."] " .. name .. ": "..text, client, r, g, b) end end addEventHandler("onPlayerChat", root, chatbox)
  7. somethings wrong with triggerServerEvent. Code: -- Client Side -- Logs into account addEventHandler ( 'onClientGUIClick', root, function () if (source == clickOnlogin) then if username ~= nil or username ~= "" or password ~= nil or password ~= "" then triggerServerEvent("loginPlayer", localPlayer, username, password) else outputChatBox("Please enter username & password") end end end ) -- Server Side function loginPlayer(thePlayer, username, password) local account = getAccount(username, password) if (account ~= false) then logIn(thePlayer, account, password) else outputChatBox("Invalid username & password!", thePlayer, 255, 0, 0) end end addEvent("loginPlayer", true) addEventHandler("loginPlayer", getRootElement(), loginPlayer)
  8. All new requests will be created soon! Peace out, We are upgrading our servers to windows. Might take 48 hours to complete the requests.
  9. https://forum.multitheftauto.com/viewtopic.php?f=116&t=94776
  10. Update I apologize to everyone who had their MTA Server on second host, our second host was suffering from high lag ingame which is finally fixed, new server requests will be accepted before 24hours of time. Thank you for letting us know about lag problem, Cheers
  11. Delux has wide range of VPS and MTA Servers on it, Vortex is also good but as per performance, I'd prefer Delux Host.
  12. I really appreciate it Shux, Thank you.
  13. server.lua markerSize = 1.5 r, g, b = 255, 255, 0 pilot = { {414.2, 2533.5, 18.1}, -- VM Airport {1449.92236, -2287.12622, 12.3}, -- LS Airport {-1226.55, 55.48, 13.13}, -- SF Airport } for k, v in pairs(pilot) do marker = createMarker(v[1], v[2], v[3], "cylinder", markerSize, r, g, b, 255) end function attachBlips() createBlipAttachedTo(marker, 56) end addEventHandler("onResourceStart", root, attachBlips) It attaches blips to only SF Airport Marker. LS and VM Airport Marker blips aren't getting attached but their marker is created. thank you
  14. Ignore Player slots from website, It's not yet updated since we are working on Game Panels.
  15. Om.

    About HTTP Download

    fetchRemote to get resources from HTTP?
  16. Well, I was wondering if there is any way to download resources from http/https links, if so, how can i enable it? Default Download makes my server speed downloading slow as hell
  17. Om.

    [Help]Marker

    Try opening GUI from server side (addEvent) and trigger it in client side and why addEventHandler inside function? it should be before function or after ending function.. marker= createMarker(v[1], v[2], v[3], "cylinder", 1.0, 0, 122, 43, 211) Ps: Its marker = not marker=
  18. Om.

    MTA 5 ?

    Nope, you can run it on cracked copies aswell, I have both legit (Steam) and Cracked one. I run FiveM on cracked one
  19. Well, Is there any option i can export it like export.resource:loadTxd() ?
  20. Ah, Well getPlayerMoney getElementData you can create using these functions
  21. How much donation is requier?
×
×
  • Create New...