[Plugin] Streamer Plugin

@Kylla,
Quote:

CreateDynamicObject(modelid, Float, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0);

Reply

Kylla did you see what I posted? It is not possible to have it Streamed Objects under OnPlayerRequestClass, you must do what I did and it does not affect any objects hence there are no objects present under the OnPlayerRequestClass except the Global Objects that are destroyed after you spawn. So there is no issue if you have done what I have posted.
Reply

i gots teh problemz...

i removed about.. 40-100 Un-Needed objects from my script.

Now no objects ANYWHERE are loading, even my teleports..


I downloaded v2.3.3 (i had 2.3.2 or the earlier version before this 1, all i know is the .so/.dll was smaller.)

And this problem occured before i got latest script.. a little help?

EDIT:

Now my Hosted server (No updated files, no removed objects not touched) Isnt displaying any objects either.. somthing is fucked some where.....
Reply

Make sure there in the Proper Interior and World.
Reply

there all in same world, interior

i restarted server numerous times.. /setallworld 0.. still dont work
Reply

Quote:
Originally Posted by © HungryPinkPig ©
there all in same world, interior

i restarted server numerous times.. /setallworld 0.. still dont work
CreateDynamicObject(modelid, Float, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0);
Reply

Kylla: The SA-MP server reports the player's position as 0.0, 0.0, 0.0 if he is not spawned, so obviously, the plugin will not stream objects properly at the class selection screen. There is little I can do about this. You can easily script it yourself, but you have to take a few things into consideration so that your own objects do not conflict with those that the plugin creates:

pawn Код:
#define MAX_SERVER_PLAYERS 32
#define MAX_SS_OBJECTS 50

new
    gSSObjects[MAX_SERVER_PLAYERS][MAX_SS_OBJECTS],
    bool:gSSObjectsCreated[MAX_SERVER_PLAYERS];

public
    OnPlayerRequestClass(playerid, classid)
{
    // Check if the objects have not already been created for the player
    if (!gSSObjectsCreated[playerid])
    {
        // Create the objects for the player
        gSSObjects[playerid][0] = CreatePlayerObject(playerid, 2585, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
        gSSObjects[playerid][1] = CreatePlayerObject(playerid, 2586, 15.0, 15.0, 15.0, 0.0, 0.0, 0.0);
        // ...
        // Change the boolean variable so that objects cannot be created again
        gSSObjectsCreated[playerid] = true;
    }
}

public
    OnPlayerRequestSpawn(playerid)
{
    // Destroy all of the objects before the player spawns
    for (new i = 0; i < MAX_SS_OBJECTS; i++)
    {
        DestroyPlayerObject(playerid, gSSObjects[playerid][i]);
    }
    // Change the boolean variable so that objects can be created again
    gSSObjectsCreated[playerid] = false;
}
Do not attempt to destroy these objects under OnPlayerSpawn, because you could inadvertently destroy objects that the streamer is creating (the internal IDs are shared).

© HungryPinkPig ©: Make sure that you're compiling your scripts with the latest include file.
Reply

incongito, do you have a converter for this?

i used YSI object converter from www.convertffs.com/objects it worked but now idk if new include..
Reply

Quote:
Originally Posted by © HungryPinkPig ©
incongito, do you have a converter for this?

i used YSI object converter from www.convertffs.com/objects it worked but now idk if new include..
you know theres a Custom Format on that site lol... lrn2usethereplacetool
Reply

Tickrate 30 means every 30 milliseconds?
Reply

No, it's update in every 30 CPU Tick, but I no recommended lower vaule on 100, because your cpu usege will be too high.
I tested it and the "100" tickrate is about "300" ms.
Reply

Can you change Streamer_TickRate(tickrate) whenever you want? I mean for example via Admin command? (If you create such a command)
Reply

Quote:
Originally Posted by Double-O-Seven
Can you change Streamer_TickRate(tickrate) whenever you want? I mean for example via Admin command? (If you create such a command)
Yep.
Reply

Wow your streamer seems to be great :O Fast loading, less CPU usage, less lag then with my streamer
Reply

I didn't use it on every OnPlayerUpdate just every 20th update and only when the player wasn't at the last streamed position.

---

But there is something I really miss!
A second object update function to stream the objects at a defined position for a player:
pawn Код:
Streamer_UpdateObjectsEx(playerid, Float:x, Float:y, Float:z);
Such a function would be really great so you can stream the objects at a position where the player should be set with SetPlayerPos.
So he might not fall through the ground. Would be very useful.

But this streamer is really great, everything works like it should work.
Nice work.
Reply

Don't you get it, you have function Streamer_UpdateObjects(playerid). First move player with SetPlayerPos and right after use function to update objects.
Reply

Let me explain:

You want to set a player to x, y, z.
Now you could prestream the objects at this positon

This is what I mean:
pawn Код:
stock SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
{
Streamer_UpdateObjectsEx(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z);//Player will get set to position x y z and objects are already streamed.
}
This is what you mean:
pawn Код:
stock SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
{
SetPlayerPos(playerid,x,y,z);//Player will get set to position x y z and objects are not streamed.
Streamer_UpdateObjects(playerid);
/*Now you will stream the objects. BUT, the player hasn't update his position if I'm correct, because this only gets updated when OnPlayerUpdate is called.
So, what does this mean? If this is correct what I said about OnPlayerUpdate, than the objects will get streamed on the old position because between the functions, OnPlayerUpdate wont get called. So, the objects will stream at the correct position after player data has been updated. And then it may be too late... player falls through the ground.
Correct me if I'm wrong about OnPlayerUpdate.
*/

}
I had the system with streaming objects at the defined position before setting his no position and it was much better than setting the player to the position and streaming after this...
Do you know what I mean?
Reply

Just go IG and try yourself. I have been using this plugin since it was created and I know what I am talking.
Reply

Why does this crash the compiler?

pawn Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid);
{
  if (pickupid == piratepickup)
  {
        new RandomSpawn = random(2);
        if (RandomSpawn == 0)
        {
        TogglePlayerControllable(playerid, 0);
            ShowMenuForPlayer(PirateMenu, playerid);
        }
        if (RandomSpawn == 1)
        {
          TogglePlayerControllable(playerid, 0);
            ShowMenuForPlayer(PirateMenu2, playerid);
        }
        return 1;
    }
    return 0;
}
Reply

@BP13: Remove the ; from OnPlayerPickUpDynamicPickup(playerid, pickupid);
---
@Serg: I did exactly what you said. This is my code I'm always using:
pawn Код:
public SetPlayerPosEx(playerid,Float:x,Float:y,Float:z,Float:angle,interior)
{
    if(IsPlayerConnected(playerid))
    {
      StuntInfo[playerid][sExitedVehicle]=false;
      TeleportData[playerid][tImmunity]=ServerVariables[MAX_IMMUNITY];
        SpeedInfo[playerid][sLastPos][0]=x;
        SpeedInfo[playerid][sLastPos][1]=y;
        SpeedInfo[playerid][sLastPos][2]=z;
        SetPlayerPos(playerid,x,y,z);
        SetPlayerFacingAngle(playerid,angle);
        SetPlayerInterior(playerid,interior);
        Streamer_UpdateObjects(playerid);
        return 1;
    }
    return 0;
}
And I'm falling through the ground in 50% of all case I spawn at my mapped island.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)