Fix sent blips, add util net handlers
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user