Jump to content

IIYAMA

Moderators
  • Posts

    6,089
  • Joined

  • Last visited

  • Days Won

    216

Everything posted by IIYAMA

  1. You got your answer on my second post. Now give it a try. Configure the column `id` and insert an item.
  2. The 0's is something you should do with Lua. id's are counting up: 1, 2, 3, 4, 5 etc. Those prefixes should also be done by Lua.
  3. This is column specification for auto increment ID's when new items are added. ID int NOT NULL AUTO_INCREMENT This does not reset, as DB ID are not suppose to be reset. That is asking for trouble So make sure you understand your own question very well!
  4. Have you considered using a XML file? If you are not using a database, but only something to generate id's for later use, XML would be the quickest to set-up something like that. https://wiki.multitheftauto.com/wiki/XmlCreateFile @slapz0r
  5. @Sisqo0 That is not how a gridlist works. Each row has multiple columns. Which means that it also has multiple properties. Each row has property: "Player" & "Vehicle" If you want to separate them, you need 2 gridlists: Gridlist 1. Row with property "Player" Gridlist 2. Row with property "Vehicle"
  6. function test (arg1, arg2, ...) local restOf = table.concat({...}, " ") end ... < dynamic arguments. function test2 (...) setElementPosition(...) end test2(element, 1220, 100, 100)
  7. @Looky Either: You have an error in your client code. (which stops the code from starting) Check the debug console. The clientside script isn't set in the meta.xml as clientside. (but as "server" - side or without type which is also serverside) You hit the marker before your client script has been loaded. (happens when your download transfer bar is visible) If serverside is in another resource as clientside. Both resources have to be running. Info: This line decides if the event is added or not. addEvent("startMaking", true)
  8. The map editor already has this feature. https://wiki.multitheftauto.com/wiki/ProcessLineOfSight Getting the ground/floor position. https://wiki.multitheftauto.com/wiki/GetElementBoundingBox Getting the object size. The map editor already has this feature. https://wiki.multitheftauto.com/wiki/ProcessLineOfSight Getting the ground/floor position. https://wiki.multitheftauto.com/wiki/GetElementBoundingBox Getting the object size.
  9. Including offset, unless you have a custom X axis position in mind which is located at for example 1/4 of the screen.
  10. These are absolute values. Shouldn't you scale some of them as well?
  11. Yes those are correct. If you have trouble with them. Then you could think of building utility stuff. local devScreenX = 1920 local devScreenY = 1080 local screenX, screenY = guiGetScreenSize() local scaleValue = screenY / devScreenY scaleValue = math.max(scaleValue, 0.65) function getScreenStartPositionFromBox (width, height, offsetX, offsetY, startIndicationX, startIndicationY) local startX = offsetX local startY = offsetY if startIndicationX == "right" then startX = screenX - (width + offsetX) elseif startIndicationX == "center" then startX = screenX / 2 - width / 2 + offsetX end if startIndicationY == "bottom" then startY = screenY - (height + offsetY) elseif startIndicationY == "center" then startY = screenY / 2 - height / 2 + offsetY end return startX, startY end just for the `could` float width, float height, float offsetX, float offsetY [, string startIndicationX, string startIndicationY ] print(getScreenStartPositionFromBox(400, 400, 100, 0, "right", "center")) print(getScreenStartPositionFromBox(400, 400, 0, 0, "center", "center")) print(getScreenStartPositionFromBox(400, 400, 0, 100, "center", "top")) print(getScreenStartPositionFromBox(400, 400, 100, 100, "left", "top")) print(getScreenStartPositionFromBox(400, 400, 100, 100, "right", "top"))
  12. By getting your previous values:https://wiki.multitheftauto.com/wiki/GetElementAttachedOffsets With bindkey: https://wiki.multitheftauto.com/wiki/BindKey
  13. https://wiki.multitheftauto.com/wiki/SetElementAttachedOffsets
  14. setElementData(source, "fullName", result[1]) local name = tostring(getElementData(player, "fullName") or "")
  15. Can't, as you didn't post your other function... I can't read your mind after all.
  16. @slapz0r The simplest way would be using serverside element data. You can only use triggerEvents for that, if you can synchronize the fullName data from all players yourself. Server setElementData(source, "fullName", result) Client local players = getElementsByType("player", root, true) for i=1, #players do local player = players[i] local fullName = tostring(getElementData(player, "fullName") or "") end You are sending the message from the server to the OWNER of the nick name. So nobody else has this data. This requires much more code to achieve this functionality. *
  17. guiSetText ( myLabel, tostring(Table[1]["fname"] or "") .. " " .. tostring(Table[1]["sname"] or "") )
  18. IIYAMA

    Help! player...

    local playerList = getElementsByType("player") https://wiki.multitheftauto.com/wiki/GetElementsByType Player names are irrelevant, the thing that matters are elements. Players are also elements. In Lua those are accessed with userdata values. Userdata's are unique values that are used as element identifiers. Take a closer look. Clientside: outputChatBox(tostring(localPlayer))
  19. IIYAMA

    Help, please!

    To define the player element, which receives the message. command: /hey So yes you don't need the addCommandHandler, if you have an alternative to define the player.
  20. IIYAMA

    Help, please!

    oh really, that is so amazing! addCommandHandler("hey", function (player) triggerClientEvent(player, "error", root) end) addEvent("error", true) function showError() addEventHandler("onClientRender", root, redline) end addEventHandler("error", root, showError)
  21. IIYAMA

    Help, please!

    triggerClientEvent(player, "error", root)
  22. Yes. To be honest I do not understand why you would re-local a local variable. Neither I do agree doing that with MTA functions specific. I tested those a while ago and they were just as fast as local functions. >> For some unknown reason. (With the exception of methods: table.remove) It will always be send in order unless the connection timed out. Need a status? Latent events. https://wiki.multitheftauto.com/wiki/GetLatentEventStatus Or send another trigger event back. Yes. The handler will not accept anything else, except for itself or it's children: addEventHandler("updateTable", resourceRoot, updateTable, false) But I like to cut off those brats (children) as well and only accept the angry parent (resourceRoot). getPropagated = false Doing the same thing, else I run out of variable names... Never had any issues with it, so I am not going to change that habit.
  23. IIYAMA

    dbQuery

    "SELECT `name` FROM `123` WHERE " .. accountName .. " = `login` LIMIT 1"; You want a @slapz0r, a query perhaps?
  24. IIYAMA

    Working limit

    local playersInJobs = { ["job-name"] = {} } table.insert(playersInJobs["job-name"], player) if #playersInJobs["job-name"] == 10 then end
  25. It looks like a client/player triggered (indirect) an event which included a different player his userdata. Either a script/resource seems to fail the security rules or you actually got a hacker in your server. And yes, it is related to elementdata. Unfortunately you cut off the full reason, so...
×
×
  • Create New...