samp-incognito / samp-streamer-plugin

Streamer Plugin for SA-MP (San Andreas Multiplayer)
Apache License 2.0
235 stars 93 forks source link

OnDynamicActorStreamOut doesn't get called in open.mp #469

Open ReshiramZekrom1 opened 1 year ago

ReshiramZekrom1 commented 1 year ago

As title, OnDynamicActorStreamOut doesn't work in open.mp. Tried with 2.9.4 and 2.9.6 versions but with same result. On the contrary, OnDynamicActorStreamIn works fine.



#include <streamer>

#include <izcmd>

main () {}

new dynamicactor;
new actor;

public OnGameModeInit() {

    dynamicactor = CreateDynamicActor(230, 466.1979,-1705.4946,11.0269, 0.0, 1, 100.0, 0, -1, -1, 10);

    actor = CreateActor(230, 466.1979,-1702.4946,11.0269, 0.0);

    CreateVehicle(411, 466.1979,-1698.4946,11.0269, 0.0, -1, -1, 5);

    return 1;
}

COMMAND:teleport(playerid, params[]) {

    SetPlayerPos(playerid, 466.1979,-1703.4946,13.0269);
    return 1;
}

public OnActorStreamIn(actorid, forplayerid) {

    new string[144];
    format(string, sizeof string, "Actor streamed IN: %d || actorvar %d", actorid, actor);
    SendClientMessage(forplayerid, -1, string);

    printf("Actor streamed IN: %d || actorvar %d", actorid, actor);

    return 1;
}

public OnActorStreamOut(actorid, forplayerid) {

    new string[144];
    format(string, sizeof string, "Actor streamed OUT: %d", actorid);
    SendClientMessage(forplayerid, -1, string);

    printf("Actor streamed OUT: %d", actorid);

    return 1;
}

public OnDynamicActorStreamIn(actorid, forplayerid) {

    new string[144];
    format(string, sizeof string, "DYN-Actor streamed IN: %d || dynamicactorvar %d", actorid, dynamicactor);
    SendClientMessage(forplayerid, -1, string);

    printf("DYN-Actor streamed IN: %d || dynamicactorvar %d", actorid, dynamicactor);

    return 1;
}

public OnDynamicActorStreamOut(actorid, forplayerid) {

    new string[144];
    format(string, sizeof string, "DYN-Actor streamed OUT: %d", actorid);
    SendClientMessage(forplayerid, -1, string);

    printf("DYN-Actor streamed OUT: %d", actorid, actorid);

    return 1;
}
ReshiramZekrom1 commented 1 year ago

I've noticed that the callback gets called (sometimes) when you teleport in a enough distant position (with SetPlayerPos) but it doesn't if you leave the area either by foot or vehicle