Jump to content

jkub

Members
  • Posts

    342
  • Joined

  • Last visited

About jkub

  • Birthday 21/12/1992

Details

  • Gang
    Blunt's Edge
  • Location
    USA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

jkub's Achievements

Fool

Fool (23/54)

1

Reputation

  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?
×
×
  • Create New...