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) {
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();
});
// ---------------------------------------------------------------------------