Jump to content

Dimension bug


DREFTHUN

Recommended Posts

Hello!

 

My problem is, that if I set my dimension to, let's say 2, and I set my friend's dimension to 1, I can still see him, but it is very much desynced... His position only gets updated every one second, etc.

I really need to get this bug fixed, cause at the moment, I can't use interiors, etc.

I made a modification to the mtaserver.conf file:

<!-- Player sync interval. Default: 100 -->
 <player_sync_interval>50</player_sync_interval>

But this is all.

Link to comment

I used this, but even the simple setElementDimension is bugged out somehow...

function setdim(thePlayer, cmd, targetPlayer, szam)
	if getElementData(thePlayer, "acc:admin") > 0 then
		if not targetPlayer or not szam then
			outputChatBox("#ff9000[Usage]: #FFFFFF/"..cmd.." [ID / Name] [Dimension]", thePlayer, 0, 0, 0, true)
		return end
		szam = tonumber(szam)
		targetPlayer = findPlayer(thePlayer, targetPlayer)
		if not getElementData(targetPlayer, "loggedin") then
			outputChatBox("#D64541[Error]: #FFFFFFThe player you are trying to use the command on isn't logged in yet!", thePlayer, 0, 0, 0, true)
		return end
		setElementDimension(targetPlayer, szam)
		outputChatBox("Succesfully set "..getPlayerName(targetPlayer).."'s dimension to "..szam,thePlayer, 0, 0, 0, true)
	else
		outputChatBox("#D64541[Error]: #FFFFFFAcces denied!", thePlayer,0,0,0,true)
	end
end
addCommandHandler("setdim", setdim, false, false)

--Before that, the spawning is used with spawnPlayer, and even this way it is bugged out. I will provide video later on...
Link to comment

Here is a video demostrating my problem:

 

My friend doesn't disappear, he just gets desynced...

function setdim(thePlayer, cmd, targetPlayer, num)
	num = tonumber(num)
	targetPlayer = getPlayerFromName(targetPlayer)
	setElementDimension(targetPlayer, num)
	outputChatBox("Succesfully set dimension to "..num,root, 255, 255, 255, true)
end
addCommandHandler("setdim", setdim, false, false)

 

Edited by DREFTHUN
Link to comment

That's very strange, i use dimensions myself and i've never had this issue. It looks like it gets set on the server but the client still thinks that you are in the same dimension (but then why does the nametag disappear?). Try running getElementDimension() on you and the other player after you set the dimension using that command. Or just:

addEventHandler("onClientRender", root,
  function ()
    dxDrawText("localPlayer: " .. getElementDimension(localPlayer) .. "\nremotePlayer: " .. getElementDimension(getPlayerFromName("teszt1")), 200, 200)
  end)

I know, i know it's an awful code, but it's just for debug.

Link to comment

I use this:

function getPos()
	x, y, z = getElementPosition(localPlayer)
	rot = getPedRotation(localPlayer)
	int = getElementInterior(localPlayer)
	dim = getElementDimension(localPlayer)
	position = x .. ", ".. y .. ", ".. z
	outputChatBox(position)
	outputChatBox("Rot: "..rot)
	outputChatBox("Int: "..int)
	outputChatBox("Dim: "..dim)
	setClipboard(position)
end
addCommandHandler("getpos", getPos)

It is client-sided, and it still returns the dimension I gave...

And no debug errors... Not even warnings...

 

I tried even reinstalling the server, and everything...

Just in case, I added that code to my script, to see what happens. http://kephost.com/image/wlEg

Got the source of the problem! Gonna change hostings now! Thank you for your help anyways!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...