From 8a899e543b9b23c4f0ac0b9ba3ca660c3a28ecb9 Mon Sep 17 00:00:00 2001 From: VortrexFTW Date: Mon, 7 Sep 2020 11:15:24 -0500 Subject: [PATCH] Fix sent blips, add util net handlers --- scripts/client/main.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/client/main.js b/scripts/client/main.js index b939995c..6d3a291d 100644 --- a/scripts/client/main.js +++ b/scripts/client/main.js @@ -91,7 +91,7 @@ addEventHandler("onElementStreamIn", function(event, element) { addNetworkHandler("ag.blips", function(blipData) { for(let i in blipData) { - allServerBlips.push(blipData); + allServerBlips.push(blipData[i]); } }); @@ -127,9 +127,7 @@ function getIslandFromPosition(position) { // --------------------------------------------------------------------------- addEventHandler("onPedSpawn", function(event, ped) { - console.log("localPlayer: " + localPlayer); - - // Nasty workaround since localPlayer is null as the player spawns (reported as client bug #194) + // Nasty workaround since localPlayer is null as the player spawns (reported as client bug #194) setTimeout(attemptToShowBlipsOnSpawn, 500, ped); }); @@ -141,4 +139,16 @@ function attemptToShowBlipsOnSpawn(ped) { } } +// --------------------------------------------------------------------------- + +addNetworkHandler("ag.skin", function(ped, skin) { + ped.skin = skin; +}); + +// --------------------------------------------------------------------------- + +addNetworkHandler("ag.removeFromVehicle", function() { + localPlayer.removeFromVehicle(); +}); + // --------------------------------------------------------------------------- \ No newline at end of file