Jump to content

Dazee

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by Dazee

  1. Dazee

    [REL]atm_system

    Bump, the resource has received a somewhat major behind the scenes rework and now works with the latest version of the game Long overdue update 6 years later ? General code refactoring employing better practices than before (I hope) https://community.multitheftauto.com/index.php?p=resources&s=details&id=12425 modified buttonsStatus function mobile_atm_c.lua modified onPlayerClickBtnTransfer2 mobile_atm_c.lua modified transferMoney function mobile_atm_s.lua modified receiveDeposit function in mobile_atm_s.lua modified withdrawMoney function in mobile_atm_s.lua modified onPlayerClickBtnClose in mobile_atm_c.lua implemented possibly the dumbest way to handle 3 colors local RED = {255, 0, 0} local R,E,D = unpack(RED) oh well :[ in mobile_atm_s.lua fixed grammar mistake of function name receiveDeposit mobile_atm_s.lua moved ATM1 global variable into transferConfirmation function mobile_atm_c.lua moved ATMGUI global variable into openATMGui function mobile_atm_c.lua removed testFunction in mobile_atm_s.lua fixed bug where the current balance wasn't being displayed if the value didn't exist now it instead displays $0 if the value doesn't exist in the account data Feedback is appreciated!
  2. The field where you should input text of the message is just unable to be clicked on *grayed out* its weird. EDIT: Okay now it works. lol it was grayed out before when i tried to send its super weird.
  3. Sorry for late answer, I am still unable to login to my community.multitheftauto.com account after such a long time, I forgot I posted here for help thanks for answering. I am unable to send you text in a message on forums so I can say my account username is donbosnian https://community.multitheftauto.com/index.php?p=profile&id=388514 I can't remember which e-mail i used to register tho. You can confirm it's me if you download the atm_system published on donbosnian in the script it notes that you should not redistribute it, bla bla, because this is property of donbosnian a.k.a dazee.
  4. To save the position you have to use setAccountData and getAccountData or SQL queries, or if you meant to text file you can do XML. All the information on how to do this is available on wiki.multitheftauto.com.
  5. I am pretty sure I am using the right user ID and password to login on community.multitheftauto.com but I always get in return "invalid user ID", makes no sense.
  6. Can you run debugscript 3 in-game and run this, and tell me if you get any errors or warnings?
  7. But you can't do an if on a function mate because it will always return true
  8. Would it be possible for you guys to release the mtaserver.conf and acl.xml you used ?
  9. Dazee

    [REL]atm_system

    Bump, I updated the resource to 1.4.0 after a long time and there's some major additions. https://community.multitheftauto.com/in ... s&id=12425 (+)Added a transfer confirmation window. (+)Made it so when you click on your balance two times or on your on hand balance in the GUI the amount it shows is inserted into the edit box for quick deposits/withdrawals of all of your money at once. (+)Removed a lot of unnecessary code from the resource making it faster. (+)Made it so that new players when they try to deposit/withdraw money for the first time their account data balance will be set to 0 so they can use the ATM normally. (+)Fixed bug where u could open multiple ATM GUI's from console (+)Fixed arithmetic operation bugs that would sometimes show up in console. The video got taken down for some reason I will make a new one soon
  10. Dazee

    Getelementdata

    I believe the error you are getting is because the local money = getElementData(safe, "money") is in a seperate function than the object safe try this function safeLoadCallback(qh) local result, num = dbPoll(qh, 0) for k, row in ipairs(result) do local safe = createObject(2332, row["x"],row["y"],row["z"],row["interior"],row["dimension"],row["rotation"]) setElementData(safe, "dbId", row["id"]) setElementData(safe, "x", row["x"]) setElementData(safe, "y", row["y"]) setElementData(safe, "z", row["z"]) setElementData(safe, "interior", row["interior"]) setElementData(safe, "rot", row["rotation"]) setElementData(safe, "group", row["group"]) setElementData(safe, "money", row["money"]) setElementData(safe, "kokain", row["kokain"]) setElementData(safe, "heroin", row["heroin"]) setElementData(safe, "matreial", row["material"]) function test(player) local money = getElementData(safe, "money") outputChatBox("money: "..money,player, 255, 0, 0) end end end addCommandHandler("test", test, false, false) Tho I'm not sure about this I only had a quick look.
  11. Dazee

    Chat type

    There's a simpler way Make a script with for example a command /radio with a 3rd argument which will be our chat text in a string. I did this just for youu : function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end --isplayerinteam is from wiki mta function radioCommand(thePlayer,cmdname,arg3) local playerName = getPlayerName(thePlayer) if isPlayerInTeam(thePlayer, "Police") then -- 2nd argument is the string name of the team that is created on server for i, players in ipairs(getPlayersInTeam(getTeamFromName("Police"))) do outputChatBox(""..playerName..":" ..arg3.."",players,0,255,255) end else outputChatBox("You need to be in the Police team to use this command!",thePlayer,255,0,0) end end addCommandHandler("radio",radioCommand) Now after you have the radio thing for example in your server use bindKey to (bind key chatbox cmdname example bind u chatbox radio) You can use my lua example to make new chats if this is what you asked for u weren't very specific. Instead of using isPlayerInTeam you can use your script but this is good if you want to make specific chats for example the radio for the police team u can do almost anything u want with this example, except draw new chat if u meant that im not sure about that honestly.
  12. Yes it is possible you can apply what I provided below to your use. local LS = createColRectangle (-800.81671, -2990.10657, 5100, 3330) local LV = createColRectangle (-810, 350, 5000, 3000) local SF = createColRectangle (-4000, -3000, 3190, 6000) function getPlayerCityName(element) if ( not isElement(element) ) then return end if (isElementWithinColShape(element, LS)) then result = "LS" elseif (isElementWithinColShape(element, LV)) then result = "LV" elseif (isElementWithinColShape(element, SF)) then result = "SF" end return result end But make sure to destroy the browser when the player leaves the rectangle.
  13. Dazee

    [REL]atm_system

    I just updated this resource to version 1.3.0 https://community.multitheftauto.com/in ... s&id=12425 (+)Redesigned the GUI a bit (+)Some optimizations with the client side (+)Added an option so that you can disable other people sending you money (/settings bank) works like a light switch. (!)Working on transfer limit. (!)Finished the physical ATMS and functionality just need to place them all over the map which is coming soon.
  14. Dazee

    Number format

    This migth be useful I use it for all of my number formatting, function comma_value(amount) local formatted = amount while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if (k==0) then break end end return formatted end Example of usage: outputChatBox("You have recieved: $" ..comma_value(amount).. " into your bank account",source,0,255,255)
  15. Introducing the ATM_SYSTEM GUI: Your All-in-One Solution for Virtual Financial Transactions on your MTA server Are you tired of navigating through complicated menus just to access basic virtual banking features on your MTA SERVER? Look no further! The ATM SYSTEM has got you covered. With a sleek design and user-friendly interface, you can easily manage your virtual finances in a matter of seconds. Here are some of the features that the ATM GUI offers: Deposit money quickly and easily. Withdraw money with just a few clicks. Transfer funds to other online/offline accounts on the server. Get transfer confirmations to avoid accidental transfers. Enable/disable receiving transfers from other users with the /settings bank command. Enjoy a simple and visually appealing GUI. Use the double-click feature by clicking on one of your balances this will add your on-hand or bank balance to the amount field for faster deposits and withdrawals. To access the ATM GUI, simply type /mobileatm in-game. Notes: If you experience any bugs feel free to reply with your issues and I'll do my best to help! Link to the community resource How the UI looks:
  16. Very well made script, great job on this keep it up
  17. Tried that man it dont work for some reason it was like that in the beginning.
  18. WARNING: job_limodriver\limodriver_veh_c.lua:40: Bad argument @ 'warpPedIntoVehicle'[Expected ped at argument 1, got nil] I get that error in debugscript when i try to spawn a vehicle and it does spawn it but never warps the player in the car GUIEditor = { gridlist = {}, window = {}, button = {} } function openLimoVeh() GUIEditor.window[1] = guiCreateWindow(683, 306, 305, 359, "Job Vehicle Spawner", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(10, 23, 284, 282, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Vehicles", 0.9) guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Limo", false, false) GUIEditor.button[1] = guiCreateButton(20, 311, 98, 38, "Spawn Vehicle", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(186, 311, 98, 38, "Close", false, GUIEditor.window[1]) showCursor(true) addEventHandler("onClientGUIClick",getRootElement(),onClickBtnClose) addEventHandler("onClientGUIClick",getRootElement(),onClickBtnSpawnVeh) end addEvent("openLimoVehMenu",true) addEventHandler("openLimoVehMenu",getRootElement(),openLimoVeh) function onClickBtnClose(button,state) if (button == "left" and state == "up") then if (source == GUIEditor.button[2]) then guiSetInputEnabled(false) guiSetVisible(GUIEditor.window[1], false) destroyElement(GUIEditor.window[1]) showCursor(false) removeEventHandler("onClientGUIClick",getRootElement(),onClickBtnClose) end end end function delayed() local vehList = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) if vehList == nil or vehList == false then outputChatBox("You need to select a vehicle!",0,255,255) elseif vehList == "Limo" then local x,y,z = getElementPosition(getLocalPlayer()) local limoJobVeh = createVehicle ( 409, x, y, z + 3 ) warpPedIntoVehicle(source,limoJobVeh) end end addEvent("delayedVehSpawn",true) addEventHandler("delayedVehSpawn",getRootElement(),delayed) function onClickBtnSpawnVeh(button,state) if (button == "left" and state == "up") then if (source == GUIEditor.button[1]) then triggerEvent("delayedVehSpawn",getLocalPlayer()) end end end
  19. Dazee

    timer

    Two minutes is 120000 ticks setTimer(someFunction,120000,1) Ten minutes is 600000 ticks setTimer(someFunction,600000,1) if you didnt already know the third attribute is the number of times the timer should be run that being "1" in the above examples, but if it's 0 then it's infinite.
  20. The problem is when I register a new account with /register command something in loggedIn function blocks it from parsing the login when i try to login with that new account.Can you test the script please
  21. addEventHandler("onPlayerQuit",root, function() local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local x,y,z = getElementPosition(source) local money = getPlayerMoney(source) setAccountData(acc,"PosX",x) setAccountData(acc,"PosY",y) setAccountData(acc,"PosZ",z) setAccountData(acc,"account.money",money) end end) function loggedIn(_,acc) if getAccountData(acc,"ever.logerin") == 1 then local x,y,z = getAccountData(acc,"PosX"),getAccountData(acc,"PosY"),getAccountData(acc,"PosZ") local Money = getAccountData(acc,"account.money") or 0 setPlayerMoney(source,Money) spawnPlayer(source,x,y,z) else setAccountData(acc,"ever.logerin",1) setPlayerMoney(source,15000) end fadeCamera(source, true) setCameraTarget(source) end addEventHandler("onPlayerLogin",root,loggedIn) The problem is that it does not log the player in if it's else what should I do here.
  22. I made a video explaining it and the demonstration of it its rendering now when i upload it i will put a youtube link here. Because you guys pretty much misunderstood it.
  23. It doesen't process the login it just executes those things but does not logg them in and that's the only warning I get but that is only for accounts that are made with the panel.It does not make any sense
  24. Register and login client and serverside scripts are in one resource as for the handler loginh1.lua its seperate.
  25. SOOO I spend the past 10 hours trying to figure out what the heck is the problem it literally worked on the previous PC well on my previous system windows 10, maybe MTA got updated or something I'm not sure so the problem is, I supposedly register the account with the panel works fine then redirects it to the login panel to login works fine until you login, it says my side that it logged in my own outputChatBox but it does not display the MTA's you logged in message, but that is only for that account I registered for testing via the panel, but when I login with the account I created a long time ago it loggs it in like wtf ? the only warning I get is [2015-05-10 21:35:38] WARNING: handlers\loginh1.lua:24: Bad argument @ 'spawnPlayer' [Expected vector3 at argument 2, got boolean] Here are pastebin links for all the scripts that link to the panel register and stuff like that and ofcourse the main server handler that handles a ton of stuff. I put it on pastebin since the code is humungous I just give up on it for now so good luck hope you can help me out. login_c.lua>> http://pastebin.com/0xBEWgV2 login_s.lua>> http://pastebin.com/Xf0W7ZS4 register_c.lua>> http://pastebin.com/jJHWG0yD register_s.lua>> http://pastebin.com/3RC5C79A loginh1.lua>> http://pastebin.com/ekcPvXJZ THIS IS THE MAIN HANDLER Thanks in advance
×
×
  • Create New...