21.01.2015, 08:32
I tested spawn system on vanilla server:
And with Shoebill:
It works right only on vanilla server. On Shoebill when I use player.spawn() event PlayerSpawnEvent calls, but player doesn't spawn (he is still on class selection).
Код:
public OnPlayerRequestClass(playerid, classid) { SetTimerEx("SkipSpawn", 1, 0, "i", playerid); return 1; } forward SkipSpawn(playerid); public SkipSpawn(playerid) { SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); SpawnPlayer(playerid); return 1; }
Код:
eventManagerNode.registerHandler(PlayerRequestClassEvent.class, (e) -> { Player player = e.getPlayer(); PlayerData playerData = playerLifecycleHolder.getObject(player, PlayerData.class); if(playerData.getSkin() != -1) { Timer.create(1, 1, (factualInterval) -> { player.setSpawnInfo(playerData.getSpawnInfo()); player.spawn(); }).start(); } });