Jump to content

Controlled

Members
  • Posts

    167
  • Joined

  • Last visited

Everything posted by Controlled

  1. i guess last time im going to try to bump this
  2. Because the element data gets cleared. You could edit the script to offload the data to the SQL and then reload when the resource starts. Or you know. Just don't restart the resource.
  3. Its just the "If" statement that needs work, because I don't know how to get it to ignore anything that has no input "" and to search everything that does have a input.
  4. So I've been trying to fix this for awhile now. I have 4 Search Boxes in my GUI, and the player can type into them, then once he hits the search button it will check the table for anything that matches all those statements. I got it to KINDA work, it checks them and shows the right results if you put only 1 thing in 1 of the search boxes. But if I put more then 1 search term, it includes those and doesnt check the first. I know it sounds confusing so heres the code: guiGridListClear ( GUIEditor.gridlist[1] ) for key, value in pairs(results) do if ((tostring(value[7]):lower():find(guiGetText(GUIEditor.edit[1]):lower()) and guiGetText(GUIEditor.edit[1])~="") or (tostring(value[3]):lower():find(guiGetText(GUIEditor.edit[2]):lower()) and guiGetText(GUIEditor.edit[2])~="") or (tostring(value[2]):lower():find(guiGetText(GUIEditor.edit[4]):lower()) and guiGetText(GUIEditor.edit[4])~="") or (tostring(value[5]):lower():find(guiGetText(GUIEditor.edit[3]):lower()) and guiGetText(GUIEditor.edit[3])~="") ) then local row = guiGridListAddRow( GUIEditor.gridlist[1] ) guiGridListSetItemText( GUIEditor.gridlist[1], row, GUIEditor.Column[1], tostring( value[1] ), false, true ) guiGridListSetItemText( GUIEditor.gridlist[1], row, GUIEditor.Column[2], tostring( value[2] ), false, false ) guiGridListSetItemText( GUIEditor.gridlist[1], row, GUIEditor.Column[3], tostring( value[3] ), false, false ) guiGridListSetItemText( GUIEditor.gridlist[1], row, GUIEditor.Column[4], tostring( value[4] ), false, false ) guiGridListSetItemText( GUIEditor.gridlist[1], row, GUIEditor.Column[5], tostring( value[5] ), false, false ) end end So that gets triggered when you hit search. But if in GUIEditor.edit[1] I type the username "Controlled" then in GUIEditor.edit[2] I type "Daniel" It won't search for the two BOTH being in the same row of the table. It will show lists of Daniel and Lists of Controlled. Even if one another isn't on the same row. I'm trying to be as clear as possible, please if you don't understand ask questions so I can try to explain more.
  5. If they click on something in the list, it will call a function right away which in turn will load more information to display off to the side about what I have selected. The main part is getting the function to trigger just by clicking on the glidlist item.
  6. Is it possible to have a onClientGUIClick for when they select a item in the gridlist?
  7. My point is I already started this and got all the x,y cords to work properly on MY resolution, now I need to change it to work with guiGetScreenSize, how can I do this?
  8. So I made a GUI with the community resource GUI Editor, but now I don't know how to set it up to work on different resolutions without starting over and not using the tool. I got everything set up on my resolution but not others.. Can I convert it somehow? Heres a bit of the code: GUIEditor.label[35] = guiCreateLabel(769, 295, 265, 16, "Report Reason:", false, GUIEditor.window[3]) GUIEditor.label[36] = guiCreateLabel(769, 100, 181, 16, "Player Reporting:", false, GUIEditor.window[3]) GUIEditor.label[37] = guiCreateLabel(865, 100, 213, 16, "", false, GUIEditor.window[3]) GUIEditor.label[38] = guiCreateLabel(769, 128, 96, 15, "Reported Player:", false, GUIEditor.window[3]) GUIEditor.label[39] = guiCreateLabel(864, 128, 214, 15, "", false, GUIEditor.window[3]) GUIEditor.label[40] = guiCreateLabel(768, 154, 97, 15, "Date Created:", false, GUIEditor.window[3]) GUIEditor.label[41] = guiCreateLabel(848, 154, 230, 15, "", false, GUIEditor.window[3]) GUIEditor.label[42] = guiCreateLabel(768, 179, 98, 15, "Date Closed:", false, GUIEditor.window[3])
  9. Yea you can setAccountData then getAccountData after they log in.
  10. I figured it would be easier to add and remove IDs from if I need to. Then its not one big "if" statement. If you know a better way to do it then please let me know.
  11. I can't understand what your asking.
  12. I want to block a vehicle for admins only... I want to have a list of blocked vehicles and have it not allow you to start the car if your not a admin. But I'm having a issue, heres the script: local party = { Rhino = 432, Hydra = 520, Hunter = 425 } local model = getElementModel(veh) for key,value in pairs(party) do if (model==value) and (getElementData(source, "admin")==1) then -- start car else outputChatBox("You must be a admin to start this vehicle", source, 255, 0, 0) end end The problem with it is, it will do all 3 of the values before ending the function. I just want it to stop if it finds out that the model==value. With this it will check, 432 then, 520, then 425, which means it will start the car twice and fail once if you were in a Hunter for example, which would still let you use the vehicle... I know I could do if (model==432) then return end For them all, but I think this would be neater and better. Please help. Again to restate I want the function to check if the model = value and stop if 1 of the 3 = the model.
  13. I don't know what you have, but if you are hosting your server off a dedicated Windows Server or VPS Windows you can use IIS. Thats what I use and its built into Windows Server. It lets you host a website directly from your server computer with a really easy to use GUI, unlike Apache. Its worth checking out. http://www.iis.net/
  14. You can use s:lower() to force all the characters to be lowercase then check if the account exists. local username = "HELLO123" local username = string.lower(username) username would return "hello123" after those operations were complete.
  15. If that should not be used then what is a better way to do it? Sorry I did not follow. What is MAX() and how would it be used in a script? In your second paragraph I understand what you are saying, so I am asking for a alternative to it.
  16. I was wondering how I could get the mysql_insert_id to reset. For example, I have deleted the row that had the ID 1, and now it moves onto the ID 2, even though there isn't a row with ID 1 anymore. Is there anyway to reset this? Thanks https://wiki.multitheftauto.com/wiki/Mo ... _insert_id
  17. How would I go about pulling like 1 word of text from somewhere that is not in the script files or SQL database. I know it seems weird but I need this for security purposes. So could I make a site with 1 word and have the script somehow use that? Or is this even possible?
  18. Thanks! I will try everything you said and see how this works.
  19. That means its returning "false" for the account that the player has. So the player is not bound to a account in that case. At least thats what I think it is. A more experienced scripter might know more but thats my guess.
  20. addEventHandler("onPlayerJoin", getRootElement(), function (client) if getAccountName(getPlayerAccount(client) == "guest" ) then setElementData(client, "level", 1) setElementData(client, "exp", 0) end end) Try that.
  21. I have this script to delete Houses, Cars, and Rented Houses that are owned by someone that is inactive. Is their anyway to make it not completely lag out the server? And make it a bit slower but allow people to still type and such? -- Inactive houses - 1 month local mQuery1 = mysql:query("select interiors.id from interiors left join characters on characters.`id` = interiors.`owner` where (characters.lastlogin < ( NOW() - interval 28 day))") local count1 = 0 if (mQuery1) then while true do local row = mysql:fetch_assoc(mQuery1) if not row then break end local interiorID2 = (row["id"]) local interiorID = tonumber(row["id"]) exports['house-system']:removeHouse(thePlayer, interiorID, true, true) end end --Impounded vehicles - 2 weeks local mQuery2 = mysql:query("select vehicles.id, vehicles.model from vehicles where vehicles.Impounded != 0 and vehicles.Impounded < (".. getRealTime().yearday .."- 28)") if (mQuery2) then while true do local row = mysql:fetch_assoc(mQuery2) if not row then break end local vehicleID = tonumber(row["id"]) local vehiclemodel = tonumber(row["model"]) local vehicleID2 = (row["id"]) mysql:query_free("DELETE FROM `vehicles` WHERE `id`='".. vehicleID .."'") -- Delete the vehicle mysql:query_free("DELETE FROM `items` WHERE `type`='2' AND `owner`='".. vehicleID .."'") -- Delete its contents end end --Rented Cars local mQuery4 = mysql:query("select vehicles.id, vehicles.model from vehicles where vehicles.Impounded != 0 and rent = 1") if (mQuery4) then while true do local row = mysql:fetch_assoc(mQuery4) if not row then break end local vehicleID = tonumber(row["id"]) local vehicleID2 = (row["id"]) local vehiclemodel = tonumber(row["model"]) mysql:query_free("DELETE FROM `vehicles` WHERE `id`='".. vehicleID .."'") -- Delete the vehicle mysql:query_free("DELETE FROM `items` WHERE `type`='2' AND `owner`='".. vehicleID .."'") -- Delete its contents end end local mQuery3 = mysql:query("select vehicles.id from vehicles left join characters on characters.`id` = vehicles.`owner` where (characters.lastlogin < ( NOW() - interval 45 day))") if (mQuery3) then while true do local row = mysql:fetch_assoc(mQuery3) local vehicleID = tonumber(row["id"]) mysql:query_free("DELETE FROM `vehicles` WHERE `id`='".. vehicleID .."'") -- Delete the vehicle mysql:query_free("DELETE FROM `items` WHERE `type`='2' AND `owner`='".. vehicleID .."'") -- Delete its contents end
  22. Controlled

    Shutdown

    As people said above. You need atleast 1 file in server side to run things on the server side. You can't shut down a server from the client like you described.
×
×
  • Create New...