[Plugin] Streamer Plugin

I still could not figure out I had to get this error, unfortunately, because of the passive one
Reply

@Omirrow What exactly is your problem? When you perform DestroyObject() it destroy's the wrong object?

Try using DestroyDynamicObject().
Reply

Incognito, you can add a function to find out which zone is the player? ( GetPlayerDynamicArea(playerid); )

It would be very useful.
Thanks.
Reply

Quote:
Originally Posted by Slava[LSW]
Посмотреть сообщение
Incognito, you can add a function to find out which zone is the player? ( GetPlayerDynamicArea(playerid); )

It would be very useful.
Thanks.
But what if the player is in multiple zones at once? What will GetPlayerDynamicArea return then? I think that's the reason why this function doesn't exist yet.
Reply

Quote:
Originally Posted by Basssiiie
Посмотреть сообщение
But what if the player is in multiple zones at once? What will GetPlayerDynamicArea return then? I think that's the reason why this function doesn't exist yet.
Have you ever heard about arrays?
Reply

Quote:
Originally Posted by Slava[LSW]
Посмотреть сообщение
Incognito, you can add a function to find out which zone is the player? ( GetPlayerDynamicArea(playerid); )

It would be very useful.
Thanks.
I whipped this up for hell of it.

pawn Код:
#include <a_samp>
#include <zcmd>
#include <streamer>

#define         MAX_DYNAMIC_AREAS           100
#define         INVALID_AREA_ID             (0xFFF)

new DynamicAreaList[MAX_DYNAMIC_AREAS] = { INVALID_AREA_ID, ... };

stock GetPlayerDynamicAreas(playerid, areas[MAX_DYNAMIC_AREAS])
{
    new findcount;
    for(new i = 0; i < MAX_DYNAMIC_AREAS; i++)
    {
        if(DynamicAreaList[i] == INVALID_AREA_ID) continue;
        if(IsPlayerInDynamicArea(playerid, DynamicAreaList[i])) areas[findcount++] = DynamicAreaList[i];
    }
}

stock GetDynamicAreaArray()
{
    for(new i = 0; i < MAX_DYNAMIC_AREAS; i++)
    {
        if(DynamicAreaList[i] == INVALID_AREA_ID) return i;
    }
    return INVALID_AREA_ID;
}

stock DestroyDynamicAreaEx(areaid)
{
    for(new i = 0; i < MAX_DYNAMIC_AREAS; i++)
    {
        if(DynamicAreaList[i] == areaid)
        {
            DestroyDynamicArea(areaid);
            DynamicAreaList[i] = INVALID_AREA_ID;
            return 1;
        }
    }
    return 0;
}

// Usage


// Creating
public OnFilterScriptInit()
{
    new Float:step;
   
    for(new i = 0; i < MAX_DYNAMIC_AREAS; i++)
    {
        DynamicAreaList[GetDynamicAreaArray()] = CreateDynamicSphere(0.0, step, 0.0, 20.0);
        step += 5.0;
    }

}

// Destroying
public OnFilterScriptExit()
{
    for(new i = 0; i < MAX_DYNAMIC_AREAS; i++) { DestroyDynamicAreaEx(DynamicAreaList[i]); }
}

// Testing
CMD:getareas(playerid, arg[])
{
    new areas[MAX_DYNAMIC_AREAS] = { INVALID_AREA_ID, ... };
    GetPlayerDynamicAreas(playerid, areas);
    new line[32];
    for(new i = 0; i < MAX_DYNAMIC_AREAS; i++)
    {
        if(areas[i] != INVALID_AREA_ID)
        {
            format(line, sizeof(line), "You are in areaid: %i", areas[i]);
            SendClientMessage(playerid, 0xFF00FFFF, line);
        }
    }
    return 1;
}

// Teleport to testing area
CMD:000plz(playerid, arg[])
{
    SetPlayerPos(playerid, 0.0, 0.0, 5.0);
    return 1;
}
Reply

I'm using "DestroyDynamicObject"

But bug trying
Reply

Quote:
Originally Posted by Omirrow
Посмотреть сообщение
I'm using "DestroyDynamicObject"

But bug trying
Any details?
Reply

AttachDynamicObjectToVehicle isn't working for me.

What I did was install the new streamer plugin and include, then i changed all the instances of AttachObjectToVehicle to AttachDynamicObjectToVehicle, then i changed all the objects to be attached to CreateDynamicObject, then I compiled with no errors or warnings, but in the game there are no objects attached to any of my vehicles although it was working fine before i changed to AttachDynamicObjectToVehicle.

Any suggestions?
Reply

The maximum stream distance for a non-LOD object is 300. This is a game limit, not a streamer limit. It cannot be changed.
Reply

Quote:
Originally Posted by Aliassassin123456
Посмотреть сообщение
i set my CreateDynamicObject drawdistance to 600 but draw distance not changed in game,
Please help me to how set a distance for any object.
Quote:
Originally Posted by Vince
Посмотреть сообщение
The maximum stream distance for a non-LOD object is 300. This is a game limit, not a streamer limit. It cannot be changed.
If you use CreateDynamicObjectEx though, you can use the draw distance parameter to go past this 300 meter limit. :3

The point is that there's a difference between streaming distance and draw distance. CreateDynamicObject only allows you to choose a streaming distance. CreateDynamicObjectEx allows you to choose both a streaming distance and a draw distance. The streaming distance specifies at which distance the plugin should spawn the object server-side and send the info to the client. The draw distance specifies at which distance the object will be drawn on the client's game, but note that the game can't draw the object if the server hasn't send any info to the client yet.
Reply

So, there isn't any Solution for this? (
Reply

Quote:
Originally Posted by Aliassassin123456
Посмотреть сообщение
So, there isn't any Solution for this? (
There is a solution: use CreateDynamicObjectEx.
Reply

Ali, if you don't see any difference between "CreateDynamicObject" and "CreateDynamicObjectEx" you're doin something wrong.

Use "CreateDynamicObjectEx" instead of "CreateDynamicObject" and put 600.0 in both, stream_distance and draw_distance parameters. Then you will see the difference.

For example:

CreateDynamicObjectEx(13592, 0.0, 0.0, 20.0, 0.0, 0.0, 0.0, 600.0, 610.0);

Put this in your code and you will see the loop at the middle of the map in a 600 meters radius.

The Red one ist the DrawDistance (Client-sided) and the Green one ist the StreamDistance (Server-sided).
Reply

Quote:
Originally Posted by Vince
Посмотреть сообщение
The maximum stream distance for a non-LOD object is 300. This is a game limit, not a streamer limit. It cannot be changed.
Then SA-MP got updated to 0.3e and there's no limit anymore.
Reply

Could you test it with a normal (non-streamed) object (CreateObject(..)) ?
If it doesnt show too, it's the object not showin from that distance.

Or try changing the weather, it could be that it is blocked by clouds or smth.

Btw are you using 0.3x ?

I don't think an image is helpful, cause I won't see it too if you don't :P
Reply

Do you see the streamed object when you are near it?
Are there other (many) objects in that range or near the position you want to see it?
If not, I don't know what's wrong, sorry.
Reply

How you mean "Streamer can't load 2 objects" ?

Well if there are many objects, you should lower the stream distance of some of them to avoid all objects being streamed from far away.

Or use the following function in OnGameModeInit:

Streamer_VisibleItems(STREAMER_TYPE_OBJECT, 800);

This allows streaming 800 objects at a time.
Try to decrease this to 600 to see if the problem still occurs.
Reply

i have this problem too
anyone can help us?
Reply

Does SetDynamicObjectRot bugs after or before MoveDynamicObject?
Example code..
The object just move (MoveDynamicObject) but do not rotate
pawn Код:
MoveDynamicObject(object,PPOS[0],PPOS[1],PPOS[2],speed);
SetDynamicObjectRot(object, 0.0, 0.0, Angle2D(POS[0],POS[1],PPOS[0],PPOS[1]) + angle);
Reply


Forum Jump:


Users browsing this thread: 23 Guest(s)