Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    41

Everything posted by myonlake

  1. Better give us the full code in that case. There's nothing wrong with the code as far as I can see.
  2. Change "source" to "v". "Source" is the resource if you use your code during the start of the resource.
  3. Download and install "elementstreamer" from community (should be that). It will simply fix part of your side issues. To fix the vehicle thing - well - try the streamer first and if it doesn't work, then use these functions: setElementFrozen And events: onClientElementStreamIn onClientElementStreamOut Find these from the Wiki and read the examples and text, we won't give you no code and no help if you can't understand the stuff yourself... https://wiki.multitheftauto.com/
  4. myonlake

    Correct code

    Perhaps look at my code? It has both in it.
  5. myonlake

    Correct code

    Perhaps this is what you want. Next time, look at your own code. Yours doesn't make sense. Server-side local serial = "" addEventHandler("onResourceStart", resourceRoot, function() for _,vehicle in ipairs(getElementsByType("vehicle")) do if getVehicleController(vehicle) then if getPlayerSerial(getVehicleController(vehicle)) == "" then createBlipAttachedTo(vehicle, 55, 2, 255, 255, 255, 255, 0, 190) break end end end for _,player in ipairs(getElementsByType("player")) do if getPlayerSerial(player) == serial then createBlipAttachedTo(player, 0, 2, 255, 150, 10, 255) break end end end ) addEventHandler("onPlayerJoin", root, function() if getPlayerSerial(source) == serial then createBlipAttachedTo(source, 0, 2, 255, 150, 10, 255) end end ) addEventHandler("onVehicleEnter", root, function(player, seat, jacker) if getPlayerSerial(player) == serial then createBlipAttachedTo(source, 55, 2, 255, 255, 255, 255, 0, 190) end end ) addEventHandler("onVehicleExit", root, function(player, seat, jacked) if getPlayerSerial(player) == serial then for _,element in ipairs(getAttachedElements(source)) do if getElementType(element) == "blip" then destroyElement(element) break end end end end )
  6. Server-side local theMarker = createMarker(262, 1978, 18, "cylinder", 100, 255, 255, 0, 170) addEventHandler("onMarkerHit", theMarker, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" and matchingDimension then if getPlayerSerial(hitElement) == "" then outputChatBox("* Welcome, sir.", hitElement, 20, 255, 0, false) else killPed(hitElement) end end end )
  7. And just to make one thing clear, it is already defined as "true", so you do not need to write it in the end unless you want to disable it.
  8. I don't think it is. If you want to fetch a table of events and their statuses then use these: https://wiki.multitheftauto.com/wiki/Get ... entHandles https://wiki.multitheftauto.com/wiki/Get ... ventStatus But the answer is, no. At least I haven't heard of such feature in three years.
  9. 1) You are not able to change your IP-address just like that 2) You are able to be range-banned 3) You are probably serial banned 4) You will lose interest in attempting to go around the ban in a day Quit whining and stick with the server rules and if you get banned, play on some other servers.
  10. I made my server so that the gamemodes are in separate dimensions and they set the current data to their current gamemode so that whatever they want to do (for example, in freeroam they are able to open the freeroam panel but in race they can't). It needs some time to fix all the default resources and honestly speaking, make your own manager system. It's probably the best way of making a multi-gamemode server, because then you are familiar with everything you are using and such. It's not hard, but it's not easy neither. Just give it a month if you're not an advanced scripter, for me it took one week to switch over from default SQLite to MySQL and then make the gamemode selection and some technical stuff to it. One week just because I had the time and I had all the resources already done so all I had to do was to switch to MySQL and make some slight easier code base to it. Simply using MySQL uses one line instead of 10-20 on XML or SQLite. I don't know how the master servers with like 500 players every day made the race gamemode, but I can assure you it wasn't a one day or one week or even a one month plan and work. It needed a lot of time and work and honestly your brains. If you can't handle the amount of lines the race gamemode itself has, then... I don't know. Make more than one server to run your gamemodes. I personally tried to build my own race gamemode but it just fudged up pretty bad with the synchronization and I couldn't take any more time to it so I decided to make a separate server with the default race gamemode and change some settings and add some stuff. The people who made the default gamemodes had time and honestly wanted to help others by making it. We publish scripts to make it easier - I don't want to make my own race gamemode while I can get it for free without much of copyright stuff (every time someone enters it has caps-locked text: MADE BY THIS USER!!1111). So yeah, I trust the ones who invented the race gamemode - thank you ccw for the help on IRC by the way if you're reading.
  11. If I caught you not hashing your passwords, I would be more than happy if MTA Devs closed down your server for account stealing (even though you shouldn't use the same password everytime you register somewhere, we all still do it).
  12. You can trigger the XML data from server-side to client-side. GUI isn't an exception at all.
  13. Wooow!! I didn't even know it existed. THANK YOU!!! That's because it's a useful function made by a user, not a default function. For more useful functions, check this out »
  14. You should keep it server-side just because otherwise it wouldn't be synchronized with the server. Server-side local vehicle = createVehicle(411, 0, 0, 3, 0, 0, 225) addEventHandler("onVehicleStartEnter", vehicle, function(player, seat, jacked) if (seat == 0) then if getPlayerName(player) ~= "#[iMr][E'rrOr]_N" then cancelEvent() outputChatBox("This vehicle is private.", player, 255, 0, 0, false) else outputChatBox("Welcome to your vehicle, Sir", player, 0, 255, 0, false) end end end )
  15. Perhaps, but you don't have their passwords. You only have a hashed password which you'd have to unhash to get it, but I think MTA uses much better hashing algorithm than the usual MD5...
  16. As far as I know, map files are downloaded separately in the map download process. If you use them in a lua script file, it will load them via the script process instead. I don't think there's much of big differences - I have used both and I can't see any major differences.
  17. setPlayerTeam setElementModel See the skin IDs from Multi Theft Auto wiki.
  18. You can make buttons out of DirectX as well and they have better animations but GUI functions are good enough in my opinion.
  19. myonlake

    Attribute values.

    Oh... weird. My scripts never used that and they still worked but thanks for the info. You're welcome though
  20. myonlake

    Attribute values.

    Perhaps this is what you want. Server-side local xml = xmlLoadFile("vehicles.map") for index,vehicle in ipairs(xmlNodeGetChildren(xml, "veh")) do if xmlNodeGetAttribute(vehicle, "name") == "R" then outputChatBox("ID: " .. index .. ".", root, 255, 255, 255, false) xmlUnloadFile(xml) break end end Please note that this is server-side. The reason is, because otherwise it would receive information from the client instead of the server.
×
×
  • Create New...