Jump to content

jkub

Members
  • Posts

    342
  • Joined

  • Last visited

Everything posted by jkub

  1. Any other version of MTA I've never had this problem. Now when I alt-tab out of the game and come back in the game and I happen to be in an interior, my screen stays black and the picture never comes back. I know it doesn't crash because I can still open the console and type /quit and it will quit, although I can't see the console because the screen doesn't come back. This never happens if I am outside in the world, but like I said it happens every time I alt tab while in an interior ever since 1.3.1. I have no mods or alterations to my installation what so ever, as a matter of fact I just reinstalled my game yesterday. Please help me.
  2. You do understand that this is not a request forum don't you? If you want something done for you then I'm sure there are plenty of scripters here that would set you up if the price is right, but most scripters won't make entire scripts for free. However if you are working on scripts yourself and you need help, that would be the time to come for help, because that is what this forum is for.
  3. Nevermind, I rewrote it a bit differently and it works now. Thanks anyways.
  4. Thank you, Jaysds for the suggestion. I will try this here in a little bit when I start my test server back up for the night. I will get back on that when I have the results. @Anderl, I'd love to use MySQL instead but my lack of MySQL knowledge will prevent me from saving the houses this way. I've tried to learn it before but I didn't pick up on it.
  5. I am trying to make a house system for my new server, I do understand that there are several house systems uploaded to the community but please do understand I am trying to make my own with a couple of unique features. I have been coding for quiet a long time now and what would a coder do with his relative scripting knowledge if he just downloaded what he wanted from the community? I have tried troubleshooting this problem several times myself but I just can't figure it out. This was working fine when I first started out but now nothing is saving to the xml file. Basically is supposed to happen is the information input into the building gui (in the text fields) is saved into an xml file as a "property node". The file is saved and the script later reopens the file and loads all houses (property nodes) from the file and creates the houses. xmlSaveFile doesn't seem to work, even though it returns true to the chatbox. Here is some code function checkData() propertyData = {} for i, guiElement in pairs ( buildingGUI ) do if i == "field" then for k, field in pairs ( guiElement ) do propertyData["entMarkerX"] = guiGetText ( buildingGUI["field"].entMarkerX ) propertyData["entMarkerY"] = guiGetText ( buildingGUI["field"].entMarkerY ) propertyData["entMarkerZ"] = guiGetText ( buildingGUI["field"].entMarkerZ ) propertyData["entMarkerInt"] = guiGetText ( buildingGUI["field"].entMarkerInt ) propertyData["entMarkerDim"] = guiGetText ( buildingGUI["field"].entMarkerDim ) propertyData["exitMarkerX"] = guiGetText ( buildingGUI["field"].exitMarkerX ) propertyData["exitMarkerY"] = guiGetText ( buildingGUI["field"].exitMarkerY ) propertyData["exitMarkerZ"] = guiGetText ( buildingGUI["field"].exitMarkerZ ) propertyData["exitMarkerInt"] = guiGetText ( buildingGUI["field"].exitMarkerInt ) propertyData["exitMarkerDim"] = guiGetText ( buildingGUI["field"].exitMarkerDim ) propertyData["entTeleX"] = guiGetText ( buildingGUI["field"].entTeleX ) propertyData["entTeleY"] = guiGetText ( buildingGUI["field"].entTeleY ) propertyData["entTeleZ"] = guiGetText ( buildingGUI["field"].entTeleZ ) propertyData["entTeleRot"] = guiGetText ( buildingGUI["field"].entTeleRot ) propertyData["entTeleInt"] = guiGetText ( buildingGUI["field"].entTeleInt ) propertyData["entTeleDim"] = guiGetText ( buildingGUI["field"].entTeleDim ) propertyData["exitTeleX"] = guiGetText ( buildingGUI["field"].exitTeleX ) propertyData["exitTeleY"] = guiGetText ( buildingGUI["field"].exitTeleY ) propertyData["exitTeleZ"] = guiGetText ( buildingGUI["field"].exitTeleZ ) propertyData["exitTeleRot"] = guiGetText ( buildingGUI["field"].exitTeleRot ) propertyData["exitTeleInt"] = guiGetText ( buildingGUI["field"].exitTeleInt ) propertyData["exitTeleDim"] = guiGetText ( buildingGUI["field"].exitTeleDim ) propertyData["drivewayX"] = guiGetText ( buildingGUI["field"].drivewayX ) propertyData["drivewayY"] = guiGetText ( buildingGUI["field"].drivewayY ) propertyData["drivewayZ"] = guiGetText ( buildingGUI["field"].drivewayZ ) propertyData["drivewayRot"] = guiGetText ( buildingGUI["field"].drivewayRot ) propertyData["cacheX"] = guiGetText ( buildingGUI["field"].cacheX ) propertyData["cacheY"] = guiGetText ( buildingGUI["field"].cacheY ) propertyData["cacheZ"] = guiGetText ( buildingGUI["field"].cacheZ ) propertyData["cacheInt"] = guiGetText ( buildingGUI["field"].cacheInt ) propertyData["cacheDim"] = guiGetText ( buildingGUI["field"].cacheDim ) propertyData["propertyName"] = guiGetText ( buildingGUI["field"].propertyName ) propertyData["propertyPrice"] = guiGetText ( buildingGUI["field"].propertyPrice ) if guiGetText ( field ) == "" then ready = false break else ready = true end end end end if ready == true then action_Create_Property ( propertyData ) else call ( getResourceFromName ( "prompt" ), "outputPromptBoxClient", "ERROR: There appears to be required information missing from one or more fields, please make sure all information is given", getLocalPlayer() ) end end function action_Create_Property ( propertyDataTable ) propertyDatabase = xmlLoadFile ( "data/client/properties.xml" ) propertyMasterNode = xmlCreateChild ( propertyDatabase, "property" ) xmlNodeSetAttribute ( propertyMasterNode, "name", propertyData["propertyName"] ) xmlNodeSetAttribute ( propertyMasterNode, "price", propertyData["propertyPrice"] ) xmlNodeSetAttribute ( propertyMasterNode, "owner", "" ) propertyLocationMasterNode = xmlCreateChild ( propertyMasterNode, "location" ) entMarkerMasterNode = xmlCreateChild ( propertyLocationMasterNode, "entrance_marker" ) exitMarkerMasterNode = xmlCreateChild ( propertyLocationMasterNode, "exit_marker" ) entTeleMasterNode = xmlCreateChild ( propertyLocationMasterNode, "entrance_teleport" ) exitTeleMasterNode = xmlCreateChild ( propertyLocationMasterNode, "exit_teleport" ) drivewayMasterNode = xmlCreateChild ( propertyLocationMasterNode, "driveway" ) cacheMasterNode = xmlCreateChild ( propertyLocationMasterNode, "cache" ) xmlNodeSetAttribute ( entMarkerMasterNode, "x", propertyData["entMarkerX"] ) xmlNodeSetAttribute ( entMarkerMasterNode, "y", propertyData["entMarkerY"] ) xmlNodeSetAttribute ( entMarkerMasterNode, "z", propertyData["entMarkerZ"] ) xmlNodeSetAttribute ( entMarkerMasterNode, "int", propertyData["entMarkerInt"] ) xmlNodeSetAttribute ( entMarkerMasterNode, "dim", propertyData["entMarkerDim"] ) xmlNodeSetAttribute ( exitMarkerMasterNode, "x", propertyData["exitMarkerX"] ) xmlNodeSetAttribute ( exitMarkerMasterNode, "y", propertyData["exitMarkerY"] ) xmlNodeSetAttribute ( exitMarkerMasterNode, "z", propertyData["exitMarkerZ"] ) xmlNodeSetAttribute ( exitMarkerMasterNode, "int", propertyData["exitMarkerInt"] ) xmlNodeSetAttribute ( exitMarkerMasterNode, "dim", propertyData["exitMarkerDim"] ) xmlNodeSetAttribute ( entTeleMasterNode, "x", propertyData["entTeleX"] ) xmlNodeSetAttribute ( entTeleMasterNode, "y", propertyData["entTeleY"] ) xmlNodeSetAttribute ( entTeleMasterNode, "z", propertyData["entTeleZ"] ) xmlNodeSetAttribute ( entTeleMasterNode, "rot", propertyData["entTeleRot"] ) xmlNodeSetAttribute ( entTeleMasterNode, "int", propertyData["entTeleInt"] ) xmlNodeSetAttribute ( entTeleMasterNode, "dim", propertyData["entTeleDim"] ) xmlNodeSetAttribute ( exitTeleMasterNode, "x", propertyData["exitTeleX"] ) xmlNodeSetAttribute ( exitTeleMasterNode, "y", propertyData["exitTeleY"] ) xmlNodeSetAttribute ( exitTeleMasterNode, "z", propertyData["exitTeleZ"] ) xmlNodeSetAttribute ( exitTeleMasterNode, "rot", propertyData["exitTeleRot"] ) xmlNodeSetAttribute ( exitTeleMasterNode, "int", propertyData["exitTeleInt"] ) xmlNodeSetAttribute ( exitTeleMasterNode, "dim", propertyData["exitTeleDim"] ) xmlNodeSetAttribute ( drivewayMasterNode, "x", propertyData["drivewayX"] ) xmlNodeSetAttribute ( drivewayMasterNode, "y", propertyData["drivewayY"] ) xmlNodeSetAttribute ( drivewayMasterNode, "z", propertyData["drivewayZ"] ) xmlNodeSetAttribute ( drivewayMasterNode, "rot", propertyData["drivewayRot"] ) xmlNodeSetAttribute ( cacheMasterNode, "x", propertyData["cacheX"] ) xmlNodeSetAttribute ( cacheMasterNode, "y", propertyData["cacheY"] ) xmlNodeSetAttribute ( cacheMasterNode, "z", propertyData["cacheZ"] ) xmlNodeSetAttribute ( cacheMasterNode, "int", propertyData["cacheInt"] ) xmlNodeSetAttribute ( cacheMasterNode, "dim", propertyData["cacheDim"] ) xmlSaveFile ( propertyDatabase ) xmlUnloadFile ( propertyDatabase ) loadPropertiesFromFile() for i, field in pairs ( buildingGUI["field"] ) do guiSetText ( field, "" ) end call ( getResourceFromName ( "prompt" ), "outputPromptBoxClient", "Success: Property has been successfully added to the server", getLocalPlayer() ) end
  6. This was exactly what I was wanting, thanks
  7. I come to you today with concerns regarding what I believe would be a shader question. I need to know of a way within scripting that allows me to make the game black and white. Yes I have checked the community and I know there is a black and white shader script but that is not what I want. When I say "black and white" I mean desaturation or "no color". I have a pretty broad scripting knowledge now but I know shit about shaders. Could someone help me out here?
  8. jkub

    Train System?

    do I need to sync the cols too? some server code function onColShapeHit ( hitElement ) if hitElement == train["engine"] then for i, station in ipairs ( stations ) do if source == stations[i].col then if speedWatcher then killTimer ( speedWatcher ) speedWatcher = nil end setTrainSpeed ( train["engine"], 0 ) setTimer ( setTrainSpeed, options["times"], 1, train["engine"], 0.1 ) speedWatcher = setTimer ( checkTrainSpeed, 1000, 0 ) outputChatBox ( "Departing "..stations[i].name.." shortly...", getRootElement(), 0, 255, 0 ) end end for i, player in ipairs ( getElementsByType ( "player" ) ) do triggerClientEvent ( player, "sync_train", player, train ) end end end function client_callTrainSync() triggerClientEvent ( client, "sync_train", client, train ) for k, station in ipairs ( stations ) do triggerClientEvent ( client, "sync_cols", client, stations[k].col, client ) end end some client code addEvent ( "sync_train", true ) addEvent ( "sync_cols", true ) function onClientResourceStart() triggerServerEvent ( "client_callTrainSync", getLocalPlayer() ) end function sync_train ( trainTable, stations ) setElementStreamable ( trainTable["engine"], false ) end function sync_cols ( col, player ) setElementStreamable ( col, player ) end addEventHandler ( "sync_train", getRootElement(), sync_train ) addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource() ), onClientResourceStart ) addEventHandler ( "sync_cols", getRootElement(), sync_cols )
  9. jkub

    Train System?

    I have something going now but the big problem now is that the train actually doesn't start moving until a player is close by to sync it. I tried using setElementSyncer but that does nothing. I tried using setElementStreamable client side but that doesn't fix it either.
  10. jkub

    Train System?

    Thanks for the suggestion. We want it to be an automated train system that players can use for transportation. I never seen that setElementSpeed function before, I'm sure it will be useful. I've been making the train cruise at a certain speed by using code tooken from my cruise control script. I will reply back later on how it turns out.
  11. jkub

    Train System?

    Thanks I already looked at that and it doesnt seem to help any.
  12. jkub

    Train System?

    I and another developer are working on a train system for my server and I have really gotten fed up with the failures I've encountered. I can get the train to move and even at a constant speed no problem. But I place markers at each station so when they are hit the train stops, problem is the markers never detect the trains. I'm thinking this is because a client event is used to move the train (setPedControlState) for a ped I place in the train. The big problem is that the train never seems to hit the markers at each station. Later on I really scrutinized the script (for hours) and this is what I thought could be the problem. The train moves on everyones screen but to the server the train never moves (I verified this by checking the position and area name of where the train is every several seconds and it always returns where the train started). I completely trashed and restarted the scripts 3 times now and I'm no further then I was before. Please I need some ideas on how to structure the script. I already have all the station locations and settings inside an xml file, but I need to know things like rather or not to make the train, vehicle and ped server or client side. Rather I need to use collision spheres or markers to detect the trains, or rather I should make the cols or markers client or server. Please someone with great scripting knowledge step forward I am about to tear my face off. I'm not asking for spoon fed code, I just want some answers and some help please. Thanks. EDIT: Here is some starting initiating code that I am using server side to load up all the information from the xml file. stations = {} options = {} function onResourceStart() --]] configFile = xmlLoadFile ( "train settings.xml" ) stationMasterNode = xmlFindChild ( configFile, "stations", 0 ) optionMasterNode = xmlFindChild ( configFile, "options", 0 ) --]] stationNodes = xmlNodeGetChildren ( stationMasterNode ) optionNodes = xmlNodeGetChildren ( optionMasterNode ) --]] for i, optionNode in ipairs ( optionNodes ) do local nodeName = xmlNodeGetName ( optionNode ) if nodeName == "tickets" then options["tickets"] = xmlNodeGetAttribute ( optionNode, "price" ) elseif nodeName == "times" then options["times"] = xmlNodeGetAttribute ( optionNode, "station_wait_time" ) elseif nodeName == "init" then options["init"] = xmlNodeGetAttribute ( optionNode, "start_station" ) elseif nodeName == "train" then options["train"] = xmlNodeGetAttribute ( optionNode, "maxSpeed" ) end end for i, stationNode in ipairs ( stationNodes ) do stations[i] = {} stations[i].x = xmlNodeGetAttribute ( stationNode, "x" ) stations[i].y = xmlNodeGetAttribute ( stationNode, "y" ) stations[i].z = xmlNodeGetAttribute ( stationNode, "z" ) stations[i].name = xmlNodeGetAttribute ( stationNode, "name" ) stations[i].col = createColSphere ( stations[i].x, stations[i].y, stations[i].z, 25 ) stations[i].blip = createBlipAttachedTo ( stations[i].col, 58, 2, 255, 255, 255, 255, 0, 250, getRootElement() ) stations[i].id = i end end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), onResourceStart )
  13. I know this is an old thread but I am not the best with the whole math part when it comes to LUA. I used your fomula for the health bar for myself and it works great. I was about to make a new post on the forum asking how to do it but I'm glad I found the formula. Thanks.
  14. I just got through window shopping on no1servers again and it has come to my attention that they are currently out of game servers. It said they are out of stock. Is there any way you can let me know when you will have some more available servers?
  15. Hello, I have a question about MTA server hosting with no1servers. I tried using the live support messenger but noone was available. Whenever I want to order a server it only allows me to set the billing cycle to monthly. I want to be able to pay a lump sum for several months at a time, preferably 3 or 6 months at a time instead of paying every month. Is there a way this can be worked out, I really am interested in new hosting after I experienced serverFFS's fraudulent practicies. Thanks
  16. Okay so I know there are a couple versions of a house system available on the community but for my new server I want to use resources I make instead of downloading them all from the community. I understand this has been done a handful of times but I have my own take on this that hopefully when it gets done is a bit more original. Basically I have the complex layout and structure for my housing system resource complete, I've made the GUI and all the buttons/functions in it work. I can create "properties" using it. Since I don't know shit about SQL I am using XML to save information regarding properties created and owned in the server. I do understand once players start using it the XML file will rapidly grow in file size but I'm just not ready for SQL so I want to keep it a bit easier on myself until I figure out SQL. When a house is created a pickup is placed on the property and that pickup is placed in a table along with the other ones. My main problem is I have no idea how to correctly figure out which pickup is hit when a player walks over a pickup. If I did I also don't know the proper way of storing the data (teleport locations,passwords etc...) on each pickup. Its hard to explain. Here is how the script enters in the XML data: Here is an example of how I am currently defining the pickups, markers and data. I can't seem to get this to work correctly. properties[i]["pickup"] = createPickup ( pickupX, pickupY, pickupZ + 0.5, 3, 1272, 1000 ) properties[i]["pickupTeleX"] = node_coord_ent_tele_x properties[i]["pickupTeleY"] = node_coord_ent_tele_y properties[i]["pickupTeleZ"] = node_coord_ent_tele_z
  17. jkub

    Redundant GUI Code

    Thanks aibo, for clearing that up for me. I find it often that the simple things are what I end up overlooking.
  18. jkub

    Redundant GUI Code

    Thanks again, I am happy to say that it works. Now about something, I want to pass all this data serverside. I tried sticking all the gui edits in a table and creating another table with their text and sending it server side but for some reason every time it only adds the very first gui edit to the table. elseif source == create_Btn then for i, element in pairs(getElementChildren(addTab)) do if getElementType(element) == "gui-edit" then if guiGetText(element) == "" or guiComboBoxGetSelected ( combobox_Class ) == -1 or guiComboBoxGetSelected ( combobox_Int ) == -1 or guiComboBoxGetSelected ( combobox_Dim ) == -1 then outputChatBox ( "ERROR, make sure all information is entered", 255, 0, 0 ) ready = false return false else int = guiComboBoxGetItemText ( combobox_Class, guiComboBoxGetSelected ( combobox_Class ) ) dim = guiComboBoxGetItemText ( combobox_Dim, guiComboBoxGetSelected ( combobox_Dim ) ) class = guiComboBoxGetItemText ( combobox_Int, guiComboBoxGetSelected ( combobox_Int ) ) table.insert ( guiEditInputs, guiGetText(element) ) ready = true break end end end if ready == true then triggerServerEvent ( "addPropertyToDatabase", getLocalPlayer(), int, dim, class, guiEditInputs ) end end
  19. jkub

    Redundant GUI Code

    Thank you guys for the speedy help. I will try this today and check up back here afterwards!
  20. I really can't stand having to use redundant code anymore it takes long to do and it makes my scripts look like shit. Anyway in this instance I am having a major problem with a housing system I am making. I am currently working on the gui and in this "wizard" I created is like 19 gui edit fields. I also have a create button in the lower corner. When I click the create button it should only pass the data onto the server IF ALL of the text fields are filled in. The big problem with that is the only way I know to check all of them is to individually do if guiGetText ( blahblahfield) == "" then..... and that will end up being really long and stupid and pissing me off. I thought of a way myself to get all the children of the wizard GUI and then single out the edit fields. Only problem with that is there is no way to get the type of gui element. for example a button or edit field etc... Please help me.
  21. So I can just use this guiLabelSetHorizontalAlign function to wrap the GUI labels?
  22. If there is no way to wrap a GUI-label (that isn't ridiculously hard) then how would I go about scrolling it like a marquee? I have seen this done in other servers.
  23. I've been moving lately towards a notion of using the chat box a little less for resource messages and trying to use GUI text to say important messages so the chatbox does not get spammed all the time. I am having a major problem though, I find gui labels more professional and aesthetically pleasing to the eye. But when long messages are put into a label in a small compact gui window the text just stops at the end of the label box instead of going down to another line, sort of like it would in a memo. I want to use gui labels but I have no idea on how to make them wrap down to another line when the text gets too long to display. Can anyone help me with this please? Thanks
  24. a class action lawsuit would be nice *cough cough*
×
×
  • Create New...