Jump to content

Arnold-1

Members
  • Posts

    249
  • Joined

  • Last visited

Everything posted by Arnold-1

  1. This script is really really bad, it's even worse than the scripts i made when i was a noob. addEvent ("carBuy", true) addEventHandler ("carBuy", getRootElement(), function(id2, cost2, name2,x, y, z, sRz) local x,y,z = getElementPosition (source) destroyElement(vehicle, true) vehicle = createVehicle (id2, x, y, z, 0, 0, sRz ) warpPedIntoVehicle(source, vehicle) outputChatBox("You Successfully Spawned a Vehicle!", client, math.random(255), math.random(255), math.random(255)) end ) You actually just destroyed the last vehicle bought, which means, only one vehicle can be bought, IN THE WHOLE SERVER. Also, you didn't check if the vehicle exists before you destroyed it, that's why you have many errors, you didn't actually bother yourself and fix them. NOTE: these are the errors in only one file, reading the others now. function cursorToggle() if isCursorShowing(true) then showCursor(false) else showCursor(true) end end bindKey('m', 'down', cursorToggle) this can be done in an easier way, like this: function cursorToggle() showCursor(not isCursorShowing()) end bindKey('m', 'down', cursorToggle) reading other files, will edit as soon as i see other errors. now, gui.lua You were adding local admin = getLocalPlayer() in every single function. This is horribly bad. First of all, MTA has localPlayer variable which is always a replace of getLocalPlayer() in every single case, same goes for root with getRootElement(), and resourceRoot with getResourceRootElement(getThisResource()) also, you could just write at the top of the script admin = getLocalPlayer() without actually adding it in every function. reading the last file. The last file is HORRIBLE SHIT. You were adding an event handler, a function, a variable for every single Marker/vehicle, you could just do this: markersPositionsTable= { --{x, y, z} } markersElement = createElement("markers") for i,v in ipairs(markersPositionsTable) do x,y,z = unpack(v) local marker = createMarker(x,y,z) setElementParent(marker,markersElement) end addEventHandler("onMarkerHit", markersElement, function () --some piece of code. end ) Same goes to vehicles. I just want to tell you that i'm not trying to let you look bad, i'm just showing you your mistakes.
  2. and are you the owner of the website ? [ i dont think so ] also i sure my code will work just forgot to fix the createVehicle remove the d , oh yeah warp the marker into the vehicle and output to the marker, perfect. Exactly what i wanted to say
  3. i don't have a huge knowledge about SQL, but i think "SELECT * FROM *" would work to get ALL the data.
  4. floating everytime you script it? what do you mean?
  5. Arnold-1

    about map

    Do you mean F11? this is possible, but too much PHP scripting and server Over-loading required, which i see really useless in my opinion.
  6. Max doesn't want to stop helping people in a wrong way for sorry, i would suggest removing his content creation right for some weeks.
  7. Arnold-1

    possible??

    Show us your code first.
  8. Arnold-1

    Rules

    He can always hide it by pressing f3, but anyway, you can do it using an export, i cant tell you how now since i'm on phone, but read this wiki page: call
  9. Yes, which is something we can't actually walk-around.
  10. Wait wtf, it's so simple. when the server start the resource, you download it, even if it had the same size as the one in your client, so after you download it, it will run, and will be stored in your memory(RAM), and even editing the file wont change anything, or even wont be possible, so don't worry.
  11. Oh, i will download the latest one now.
  12. i found something, don't know what is the reason, but: ----------------------------------------------------------- ----------------------------------------------------------- this will be like a multi-line comment.
  13. Arnold-1

    ffs music

    getSoundMetaTags i guess this returns the image.
  14. i had like 2000 of them in the same place, the load was a bit slow, but i don't think there is an actual limit, it stands for performance. @Netrox i don't think someone can wait until MTA 2.0 is out, this may take one year.
  15. X = 2 + 2 means X = 4 It's actually the only way to calculate numbers, we don't have functions for that.
  16. i once had 5000 objects in one map, and it was working fine, at the end, it stands for your PC performance.
  17. function getPlayerKillsInOrder() theTable = {} for i, acc in ipairs(getAccounts()) do local name = getAccountName(acc) local player = getAccountPlayer(acc) if player then playerName = getPlayerName(player) end local kills = getAccountData(acc, "Kills") or 0 table.insert(theTable, {kills, playerName}) end
  18. i told many people, MTA 1.4 isn't stable yet, they're not believing me.
  19. Arnold-1

    Rules

    --Server addEventHandler("onPlayerLogin", root, function () triggerClientEvent(source, "onClientPlayerLogin", root) end ) --Client addEvent("onClientPlayerLogin", true) addEventHandler("onClientPlayerLogin", root, function () removeEventHandler("onClientRender", root, showRules) shown = false end )
  20. Arnold-1

    Rules

    It's not actually about being perfect, i noticed from your posts, you're making horrible mistakes, please learn more scripting, i believe within a month or two you will be able to help people.
  21. OOP, Object oriented programming, read about it in the Tutorial section. @xXMADEXx i think it's some bug, userdata means MTA classes/elements, so i think it's a bug.
  22. Arnold-1

    Rules

    Please stop, you don't actually know proper scripting. when dealing with dx, you have to use render events. this is how it should be. CODE REMOVED BY Solidsnake14
×
×
  • Create New...