Jump to content

Firespider

Members
  • Posts

    241
  • Joined

  • Last visited

Recent Profile Visitors

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

Firespider's Achievements

Red-Headed Stepchild

Red-Headed Stepchild (19/54)

3

Reputation

  1. Hi guys, the problem is that every time you log in, it sets the player's position, interior ID, dimension, etc. from a MySql table, but no matter how well you set it and write out the correct data, for some reason I can't see anything, only my character floating in the sky, although I think it's here in the Interior, it's just not visible for some reason. I also tried to handle the problem on the client side. ---SERVER SIDE local int = result[1]["interior"] local dim = result[1]["dim"] local pos = fromJSON(result[1]["pos"]) setTimer(function() spawnPlayer(player, pos[1], pos[2], pos[3]+1, 90, skin, tonumber(int), tonumber(dim)) setElementInterior(player, tonumber(int)) setElementDimension(player, tonumber(dim)) triggerClientEvent(player, "fixClientSpawn", root, tonumber(int), tonumber(dim)) end, 200, 1) --CLIENT SIDE addEvent("fixClientSpawn", true) addEventHandler("fixClientSpawn", root, function(int, dim) setElementInterior(localPlayer, int) setElementDimension(localPlayer, dim) setCameraTarget(localPlayer) outputDebugString("CLIENT FIX: INT "..int.." DIM "..dim) end)
  2. Hello guys! I have problem i can't turn off the basic nametag resource. Anyone can help? https://imgur.com/a/Y84OvxM
  3. I will testing tommorow but thanks
  4. 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
  5. 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
  6. So I threw my previous code into the SQL bin? What did I send?
  7. Could you explain what this code does?
  8. At each entry, you set a SetElementData for the value of the ID table
  9. 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 )
  10. 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.
  11. Yes, but does it need a name argument? However, I would like to solve it with ID
×
×
  • Create New...