await player.showMap();
сожалеем, однако покажи чего накодил. Вариантов масса, ну точнее, те что в голове у меня, то невозможно не заметитьСделал смерть по ивенту, игрок появляется, все нормально, однако не открывается карта на ESC
сожалеем, однако покажи чего накодил. Вариантов масса, ну точнее, те что в голове у меня, то невозможно не заметить
let deathWindow = null;
mp.game.gameplay.setFadeOutAfterDeath(false);
mp.events.add("showDeath", () =>
{
deathWindow = mp.browsers.new("package://web/deathWindow/cef/index.html");
});
function closeDeath ()
{
deathWindow.destroy();
mp.events.callRemote('onDeath');
player.showMap();
}
mp.keys.bind(0x20, true, closeDeath);
[RemoteEvent("onDeath")]
private void onDeath(Player player)
{
int frac = DB.GetFrac(player);
Vector3 spawnPosFib = new Vector3(112.04594, -748.9708, 45.75185);
Vector3 spawnPosBloods = new Vector3(906.9918, -1564.5182, 30.793032);
Vector3 spawnPosFamilies = new Vector3(-11.124917, -1399.207, 29.357016);
Vector3 spawnPosBallas = new Vector3(103.1921, -1939.2186, 20.80371);
Vector3 spawnPosVagos = new Vector3(853.2516, -2346.9343, 30.331299);
Vector3 spawnPosMarabunbta = new Vector3(1378.9304, -2066.0679, 51.998558);
switch (frac)
{
case 1:
player.Position = spawnPosFib;
player.Dimension = 0;
player.Health = 100;
player.Armor = 0;
break;
case 2:
player.Position = spawnPosBloods;
player.Dimension = 0;
player.Health = 100;
player.Armor = 0;
break;
case 3:
player.Position = spawnPosFamilies;
player.Dimension = 0;
player.Health = 100;
player.Armor = 0;
break;
case 4:
player.Position = spawnPosBallas;
player.Dimension = 0;
player.Health = 100;
player.Armor = 0;
break;
case 5:
player.Position = spawnPosVagos;
player.Dimension = 0;
player.Health = 100;
player.Armor = 0;
break;
case 6:
player.Position = spawnPosMarabunbta;
player.Dimension = 0;
player.Health = 100;
player.Armor = 0;
break;
default:
break;
}
}
А у тебя в F11 или на клиентку ошибку не выдаёт? странно на самом, если это всё, то по сути ничего не запрещает escJavaScript:let deathWindow = null; mp.game.gameplay.setFadeOutAfterDeath(false); mp.events.add("showDeath", () => { deathWindow = mp.browsers.new("package://web/deathWindow/cef/index.html"); }); function closeDeath () { deathWindow.destroy(); mp.events.callRemote('onDeath'); player.showMap(); } mp.keys.bind(0x20, true, closeDeath);
C#:[RemoteEvent("onDeath")] private void onDeath(Player player) { int frac = DB.GetFrac(player); Vector3 spawnPosFib = new Vector3(112.04594, -748.9708, 45.75185); Vector3 spawnPosBloods = new Vector3(906.9918, -1564.5182, 30.793032); Vector3 spawnPosFamilies = new Vector3(-11.124917, -1399.207, 29.357016); Vector3 spawnPosBallas = new Vector3(103.1921, -1939.2186, 20.80371); Vector3 spawnPosVagos = new Vector3(853.2516, -2346.9343, 30.331299); Vector3 spawnPosMarabunbta = new Vector3(1378.9304, -2066.0679, 51.998558); switch (frac) { case 1: player.Position = spawnPosFib; player.Dimension = 0; player.Health = 100; player.Armor = 0; break; case 2: player.Position = spawnPosBloods; player.Dimension = 0; player.Health = 100; player.Armor = 0; break; case 3: player.Position = spawnPosFamilies; player.Dimension = 0; player.Health = 100; player.Armor = 0; break; case 4: player.Position = spawnPosBallas; player.Dimension = 0; player.Health = 100; player.Armor = 0; break; case 5: player.Position = spawnPosVagos; player.Dimension = 0; player.Health = 100; player.Armor = 0; break; case 6: player.Position = spawnPosMarabunbta; player.Dimension = 0; player.Health = 100; player.Armor = 0; break; default: break; } }
Ошибок нетА у тебя в F11 или на клиентку ошибку не выдаёт? странно на самом, если это всё, то по сути ничего не запрещает esc
Помогло, спасибоПопробуй использоватьC#:NAPI.Player.SpawnPlayer(player, /*твоя позиция*/);