Fix sent blips, add util net handlers

This commit is contained in:
VortrexFTW
2020-09-07 11:15:24 -05:00
parent 72f7173e3c
commit 8a899e543b

View File

@@ -91,7 +91,7 @@ addEventHandler("onElementStreamIn", function(event, element) {
addNetworkHandler("ag.blips", function(blipData) { addNetworkHandler("ag.blips", function(blipData) {
for(let i in blipData) { for(let i in blipData) {
allServerBlips.push(blipData); allServerBlips.push(blipData[i]);
} }
}); });
@@ -127,8 +127,6 @@ function getIslandFromPosition(position) {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
addEventHandler("onPedSpawn", function(event, ped) { 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); setTimeout(attemptToShowBlipsOnSpawn, 500, ped);
}); });
@@ -142,3 +140,15 @@ function attemptToShowBlipsOnSpawn(ped) {
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
addNetworkHandler("ag.skin", function(ped, skin) {
ped.skin = skin;
});
// ---------------------------------------------------------------------------
addNetworkHandler("ag.removeFromVehicle", function() {
localPlayer.removeFromVehicle();
});
// ---------------------------------------------------------------------------