G1R:MP Forum Alpha
Log in Join
Gothic 1 Remake Multiplayer

The Colony Forum

News, support, development discussions, server communities, and stories from beyond the Barrier.

Colony discussion

onPlayerJoin event with spawnPlayer

Started by Xardas0327 in Scripting Help

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
08-30-2026, 05:50 PM (This post was last modified: 08-30-2026, 05:52 PM by Xardas0327.)
#1
I don't know these things are bugs or features.
So, I write them here.

There are 2 simple functions.
Quote:addEventHandler("onPlayerJoin", root, function(playerId)
      outputDebugString("onPlayerJoin Start")
      spawnPlayer(playerId, 12.0, 24.0, 2.0, 90)
      outputDebugString("onPlayerJoin End")
end)

addCommandHandler("default", function(playerId, commandName)
      spawnPlayer(playerId, 12.0, 24.0, 2.0, 90)
end)


  1. If a player join to the server, the player should be spawned on that position. ( x= 12.0, y = 24.0, z = 2.0)
    But it doesn't work. I have seen the 2 debug logs, but the player are still on the default position, where we start the game.
  2. If you the /default command, it is fine.
    But I see similar messages in the server log:
    Quote:[security] movement snapshot held player=2 violation=4 score=0.00 horizontal=4313.8/240.0 vertical=399.1/400.0 authorityGrace=1TRAFFIC_GUARD acceptedConnections=2 rejectedConnections=0 droppedPackets=4 disconnectedPeers=1 blockedAddresses=0 invalidPackets=0 oversizedPackets=0 trackedAddresses=1

  3. If I spawn the player another places like in the Gomez's castle, the game is loading and I get a new player id. (x= 1116.75, y = -1007.51, z = -36.66)
    And I see similar messages in the server log:
    Quote:[security] movement snapshot held player=1 violation=4 score=0.00 horizontal=43267.8/240.0 vertical=6120.6/400.0 authorityGrace=1
    CONNECT_PENDING player=2 address=xxx.xxx.xxx.xxx peer=0000020538CEE540

  4. If I use setPlayerPosition instead of  spawnPlayer, I get the same results.
Forum Jump: