Jump to content

Firespider

Members
  • Posts

    238
  • Joined

  • Last visited

Recent Profile Visitors

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

Firespider's Achievements

Trick

Trick (18/54)

3

Reputation

  1. I will testing tommorow but thanks
  2. function tp(player, cmd, ID) if getElementData(player, "Player.AdminLevel") > 1 then local players = getElementsByType ( "player" ) if tonumber(ID) then for i, p in ipairs(players) do print(getElementData(p, "Player.ID")) if getElementData(p, "Player.ID") == tonumber(ID) then local x, y, z = getElementPosition(p) setElementPosition(player, x, y, z) else outputChatBox("#000000<#910e07Wise#ffffffRolePlay#000000> #ffffff Rossz ID-t adtál meg.", player, 255, 255, 255, true) end end end end end
  3. I deleted the break and it was fine, but it always says 3 times that I entered the wrong ID, but the commands still work
  4. So I threw my previous code into the SQL bin? What did I send?
  5. Could you explain what this code does?
  6. At each entry, you set a SetElementData for the value of the ID table
  7. This is how I add the ID to the player addEventHandler("onPlayerJoin", root, function () local serial = getPlayerSerial(source) local player = source local dq = dbQuery(db, "SELECT * FROM characters WHERE serial=?", serial) local result = dbPoll(dq, 250) -- Ne korlátozd az eredmények számát if result and #result > 0 then -- Az adatbázisban a munkát tároló oszlop neve local name = tostring(result[1]["name"]) local WhitoutSpace = string.gsub(name, " ", "_") local id = result[1]["ID"] pos = fromJSON(result[1]["pos"]) local skin = result[1]["skinID"] local money = result[1]["Money"] setPlayerMoney(player, money) setElementData(player, "Player.ID", id) local data = getElementData(player, "Player.ID") setPlayerName(player, WhitoutSpace) setElementModel(player, skin) setElementPosition(player, pos[1], pos[2], pos[3]) end end )
  8. So I have the problem that every player gets an ID with setElementData when, for example, ID 1 appears based on the primary row of the SQL table But when the command is entered on the server, the system only works with a player with a specific ID, e.g. we can TP the player with a specific ID, etc.
  9. Yes, but does it need a name argument? However, I would like to solve it with ID
  10. But that returns a name, doesn't it?
  11. Now the problem is that the players have an ID, but the system only detects the individual ID and you can only TP on it, etc., etc.
  12. Hello, there is a small problem: the code does not break out of the cycle when I write the word break, here is the code (But what is before the break is executed, only after the break does not end the cycle) function gethere(player, cmd, ID) if getElementData(player, "Player.AdminLevel") > 1 then local players = getElementsByType ( "player" ) if tonumber(ID) then for i, p in ipairs(players) do if getElementData(p, "Player.ID") == tonumber(ID) then local x, y, z = getElementPosition(player) setElementPosition(p, x, y, z) break else outputChatBox("#000000<#910e07Wise#ffffffRolePlay#000000> #ffffff Rossz ID-t adtál meg.", player, 255, 255, 255, true) end end else outputChatBox("#000000<#910e07Wise#ffffffRolePlay#000000> #ffffff /gethere [ID]", player, 255, 255, 255, true) end end end addCommandHandler("gethere", gethere, false, false)
×
×
  • Create New...