[Plugin] Streamer Plugin

Quote:
Originally Posted by Sanady
Посмотреть сообщение
How it can have any type? So far I know that ID is number, I haven`t seen that ID in SA-MP are letters. Maybe I am wrong but that is what I know.
SA-MP is SA-MP, streamer is streamer. Don't mix them up. Streamer is a separate software from SA-MP, even if it is a plugin for the latter.
And ID stands for identification, there is no rule that it must be a number.

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

main()
{
	#define SIZE 10
	new writefrom[SIZE], readto[SIZE];

	for(new i = 0; i != SIZE; ++i)
		writefrom[i] = i*10;

	new item = CreateDynamicSphere(10.0, 20.0, 30.0, 40.0);
	Streamer_SetArrayData(STREAMER_AREA_TYPE_SPHERE, item, E_STREAMER_EXTRA_ID, writefrom, SIZE);
	Streamer_GetArrayData(STREAMER_AREA_TYPE_SPHERE, item, E_STREAMER_EXTRA_ID, readto, SIZE);

	for(new i = 0; i != SIZE; ++i)
		printf("%d", readto[i]);
}
Run that code and see the output.
Reply

Quote:
Originally Posted by Sanady
Посмотреть сообщение
How it can have any type? So far I know that ID is number, I haven`t seen that ID in SA-MP are letters. Maybe I am wrong but that is what I know.
There are examples with both cell and array data, with Streamer_SetArrayData, working for E_STREAMER_EXTRA_ID. I suppose it can be any type, then. Not sure why it is called "ID", though.
Reply

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
E_STREAMER_EXTRA_ID is integer value
Quote:
Originally Posted by Sanady
Посмотреть сообщение
How it can have any type? So far I know that ID is number, I haven`t seen that ID in SA-MP are letters. Maybe I am wrong but that is what I know.
It is an integer value (it's a simply part of an enum for streamer to recognize), but it can be used to access whatever type of data you've set it to, here's a guide for you, adapt it to use it with setting array data.
https://sampforum.blast.hk/showthread.php?tid=611692
I do encourage you to use it and I do encourage you to use it to the fullest, I have a whole system around Set n Get ArrayData.
Reply

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
You can use Streamer_GetNearbyItems to get all the near by items streamed.
pawn Код:
native Streamer_GetNearbyItems(Float:x, Float:y, Float:z, type, STREAMER_ALL_TAGS items[], maxitems = sizeof items, Float:range = 300.0);
Usage example:
pawn Код:
const
    MAX_OBJECTS_ON_RANGE = 150,
    Float:MAX_VISIBLE_RANGE = 250.0
;
new streamerObjectArray[MAX_OBJECTS_ON_RANGE] = {-1, ...};

//To hold all the objects visible on a range.
new
    Float:fX, Float:fY, Float:fZ;
GetPlayerPos(playerid, fX, fY, fZ);
Streamer_GetNearbyItems(fX, fY, fZ, STREAMER_TYPE_OBJECT, streamerObjectArray, sizeof(streamerObjectArray), MAX_VISIBLE_RANGE);

//streamerObjectArray now holds the ids of visible objects of "playerid".

for(new i = 0; streamerObjectArray[i] != -1; i++) //Loop through
Uhmm... where did you find that function? I downloaded the latest streamer and it isn't there
Reply

Quote:
Originally Posted by wallee
Посмотреть сообщение
Uhmm... where did you find that function? I downloaded the latest streamer and it isn't there
Eh, it most definitely is.
Reply

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Eh, it most definitely is.
No?

Reply

Quote:
Originally Posted by wallee
Посмотреть сообщение
No?

Perhaps you should try downloading the latest version then? You'll have to compile it of course, but it most definitely is there.

@incognito... Perhaps it's time for a release? There's been a lot of stuff added in the past 8 months!
Reply

Just ran into a problem with the plugin not loading with x64 Redistributable Package on x64 system. Download and install x86 version of the Redistributable Package and all is well.
Reply

I found a bug:
When go far away from where attached streamer objects on a object and then go back here, the attached objects change their position(desync).
The video can show you the bug of the streamer plugin.
https://www.youtube.com/watch?v=a48wswSNrwI

Tell me please how to solve the problem. I want to create a ship system using the plugin. Do not offer to use CreateObject, as it is limited.
Reply

Can I add new variables to Enumerator?

Becouse I try like this:

Код:
CMD:setperm(playerid, params[])
{
	if(isnull(params)) return SendClientMessage(playerid, -1, "Tip: /setperm [value]");
	
	new string[128], Float:m_x,Float:m_y,Float:m_z,Float:m_rx,Float:m_ry,Float:m_rz, permission, sampid = PlayerData[playerid][pObjectEdit];

	//Result
	permission = Streamer_GetIntData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_PERM);

    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_X, m_x);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_Y, m_y);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_Z, m_z);

    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RX, m_rx);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RY, m_ry);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RZ, m_rz);
    
    format(string,sizeof(string),"Result [ sampid: %d, perm: %d, pos: %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f ]", sampid,permission,m_x,m_y,m_z,m_rx,m_ry,m_rz);
	SendClientMessage(playerid, -1, string);
	
	
	//Update
	Streamer_SetIntData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_PERM, strval(params));
	
	permission = Streamer_GetIntData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_PERM);

    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_X, m_x);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_Y, m_y);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_Z, m_z);

    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RX, m_rx);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RY, m_ry);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RZ, m_rz);

    format(string,sizeof(string),"Update [ sampid: %d, perm: %d, pos: %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f ]", sampid,permission,m_x,m_y,m_z,m_rx,m_ry,m_rz);
	SendClientMessage(playerid, -1, string);
	return 1;
}
Код:
enum
{
	E_STREAMER_ATTACHED_OBJECT,
	E_STREAMER_ATTACHED_PLAYER,
	E_STREAMER_ATTACHED_VEHICLE,
	E_STREAMER_ATTACH_OFFSET_X,
	E_STREAMER_ATTACH_OFFSET_Y,
	E_STREAMER_ATTACH_OFFSET_Z,
	E_STREAMER_ATTACH_R_X,
	E_STREAMER_ATTACH_R_Y,
	E_STREAMER_ATTACH_R_Z,
	E_STREAMER_ATTACH_X,
	E_STREAMER_ATTACH_Y,
	E_STREAMER_ATTACH_Z,
	E_STREAMER_COLOR,
	E_STREAMER_DRAW_DISTANCE,
	E_STREAMER_EXTRA_ID,
	E_STREAMER_INTERIOR_ID,
	E_STREAMER_MAX_X,
	E_STREAMER_MAX_Y,
	E_STREAMER_MAX_Z,
	E_STREAMER_MIN_X,
	E_STREAMER_MIN_Y,
	E_STREAMER_MIN_Z,
	E_STREAMER_MODEL_ID,
	E_STREAMER_MOVE_R_X,
	E_STREAMER_MOVE_R_Y,
	E_STREAMER_MOVE_R_Z,
	E_STREAMER_MOVE_SPEED,
	E_STREAMER_MOVE_X,
	E_STREAMER_MOVE_Y,
	E_STREAMER_MOVE_Z,
	E_STREAMER_NEXT_X,
	E_STREAMER_NEXT_Y,
	E_STREAMER_NEXT_Z,
	E_STREAMER_PLAYER_ID,
	E_STREAMER_R_X,
	E_STREAMER_R_Y,
	E_STREAMER_R_Z,
	E_STREAMER_SIZE,
	E_STREAMER_STREAM_DISTANCE,
	E_STREAMER_STYLE,
	E_STREAMER_SYNC_ROTATION,
	E_STREAMER_TEST_LOS,
	E_STREAMER_TYPE,
	E_STREAMER_WORLD_ID,
	E_STREAMER_X,
	E_STREAMER_Y,
	E_STREAMER_Z,
E_STREAMER_GATE_X,
E_STREAMER_GATE_Y,
E_STREAMER_GATE_Z,
E_STREAMER_GATE_RX,
E_STREAMER_GATE_RY,
E_STREAMER_GATE_RZ,
E_STREAMER_GATE_PERM,
E_STREAMER_GATE_USE
}
But this don't change value. :O
Reply

Quote:
Originally Posted by mroq98
Посмотреть сообщение
Can I add new variables to Enumerator?

Becouse I try like this:

Код:
CMD:setperm(playerid, params[])
{
	if(isnull(params)) return SendClientMessage(playerid, -1, "Tip: /setperm [value]");
	
	new string[128], Float:m_x,Float:m_y,Float:m_z,Float:m_rx,Float:m_ry,Float:m_rz, permission, sampid = PlayerData[playerid][pObjectEdit];

	//Result
	permission = Streamer_GetIntData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_PERM);

    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_X, m_x);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_Y, m_y);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_Z, m_z);

    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RX, m_rx);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RY, m_ry);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RZ, m_rz);
    
    format(string,sizeof(string),"Result [ sampid: %d, perm: %d, pos: %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f ]", sampid,permission,m_x,m_y,m_z,m_rx,m_ry,m_rz);
	SendClientMessage(playerid, -1, string);
	
	
	//Update
	Streamer_SetIntData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_PERM, strval(params));
	
	permission = Streamer_GetIntData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_PERM);

    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_X, m_x);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_Y, m_y);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_Z, m_z);

    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RX, m_rx);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RY, m_ry);
    Streamer_GetFloatData(STREAMER_TYPE_OBJECT, sampid, E_STREAMER_GATE_RZ, m_rz);

    format(string,sizeof(string),"Update [ sampid: %d, perm: %d, pos: %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f ]", sampid,permission,m_x,m_y,m_z,m_rx,m_ry,m_rz);
	SendClientMessage(playerid, -1, string);
	return 1;
}
Код:
enum
{
	E_STREAMER_ATTACHED_OBJECT,
	E_STREAMER_ATTACHED_PLAYER,
	E_STREAMER_ATTACHED_VEHICLE,
	E_STREAMER_ATTACH_OFFSET_X,
	E_STREAMER_ATTACH_OFFSET_Y,
	E_STREAMER_ATTACH_OFFSET_Z,
	E_STREAMER_ATTACH_R_X,
	E_STREAMER_ATTACH_R_Y,
	E_STREAMER_ATTACH_R_Z,
	E_STREAMER_ATTACH_X,
	E_STREAMER_ATTACH_Y,
	E_STREAMER_ATTACH_Z,
	E_STREAMER_COLOR,
	E_STREAMER_DRAW_DISTANCE,
	E_STREAMER_EXTRA_ID,
	E_STREAMER_INTERIOR_ID,
	E_STREAMER_MAX_X,
	E_STREAMER_MAX_Y,
	E_STREAMER_MAX_Z,
	E_STREAMER_MIN_X,
	E_STREAMER_MIN_Y,
	E_STREAMER_MIN_Z,
	E_STREAMER_MODEL_ID,
	E_STREAMER_MOVE_R_X,
	E_STREAMER_MOVE_R_Y,
	E_STREAMER_MOVE_R_Z,
	E_STREAMER_MOVE_SPEED,
	E_STREAMER_MOVE_X,
	E_STREAMER_MOVE_Y,
	E_STREAMER_MOVE_Z,
	E_STREAMER_NEXT_X,
	E_STREAMER_NEXT_Y,
	E_STREAMER_NEXT_Z,
	E_STREAMER_PLAYER_ID,
	E_STREAMER_R_X,
	E_STREAMER_R_Y,
	E_STREAMER_R_Z,
	E_STREAMER_SIZE,
	E_STREAMER_STREAM_DISTANCE,
	E_STREAMER_STYLE,
	E_STREAMER_SYNC_ROTATION,
	E_STREAMER_TEST_LOS,
	E_STREAMER_TYPE,
	E_STREAMER_WORLD_ID,
	E_STREAMER_X,
	E_STREAMER_Y,
	E_STREAMER_Z,
E_STREAMER_GATE_X,
E_STREAMER_GATE_Y,
E_STREAMER_GATE_Z,
E_STREAMER_GATE_RX,
E_STREAMER_GATE_RY,
E_STREAMER_GATE_RZ,
E_STREAMER_GATE_PERM,
E_STREAMER_GATE_USE
}
But this don't change value. :O
No, you can't do that. However, that's precisely what E_EXTRA_ID is for! Use Streamer_SetArray*Data.
Reply

I seem to solve my problem. I set coords to my attached objects the same as main object has and now they dont desync(dont change their position, dont disappear)

Right code:
PHP код:
//creating mainObj somewhere above
new atObj CreateDynamicObject(1944,x,y,z,0.0,0.0,0.0);//attached object with coords x,y,z. Without they it doesn`t work
AttachDynamicObjectToObject(atObjmainObj1.00.00.430.00.00.0); //attaching atObj to mainObj
//it`s working very well 
Reply

If i have like 50k items on server, and every item object has DynamicArea.
Should i use:
pawn Код:
native GetPlayerDynamicAreas(playerid, STREAMER_TAG_AREA areas[], maxareas = sizeof areas);
native GetPlayerNumberDynamicAreas(playerid);
Or should i keep track when player enter/leave dynamic area and store it into array and loop thru that instead?
Reply

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
If i have like 50k items on server, and every item object has DynamicArea.
Should i use:
pawn Код:
native GetPlayerDynamicAreas(playerid, STREAMER_TAG_AREA areas[], maxareas = sizeof areas);
native GetPlayerNumberDynamicAreas(playerid);
Or should i keep track when player enter/leave dynamic area and store it into array and loop thru that instead?
So... EVERY object in your server has a dynamic area? :O



I'd suggest y_iterate but that would be a LOT of indexes... Storing them in an standard array could be inefficient... So I think those natives would be helpful.

The best way would be to find a more efficient way to do what you're currently trying to do. That is a lot of areas.
Reply

Thx, i guess i will just keep track of player zones when he gets in/out of one.
Reply

Hello, i have problem now. I makes a streamer plugins but i have 1 fatal eror
Quote:

D:\Server\pawno\include\streamer.inc(254) : error 017: undefined symbol "OBJECT_MATERIAL_SIZE_256x128"

i makes SAMP server 0.3.7-R2 Windows Server and SAMP client 0.3.7. i have done chenges SAMP 0.3.7 server to SAMP 0.3e but my SAMP Client still 0.3.7,but not working.

Can you fix my problem ?,pliss

#Sorry for my bad english
Reply

How does the priority parameter work? Does 1 have more priority over 2 or is it the opposite way?

Nevermind, found my answer:

Quote:

This adds a 'priority' parameter to all of the creation natives (except
for areas) as well as E_STREAMER_PRIORITY to the data manipulation
natives. The priority can be any number. It is set to 0 by default.
Items with higher priorities will always be streamed before items with
lower priorities.

Reply

Plugin works on Linux but not on Windows, what can be the reason? The plugin loads fine without any errors but ingame the streamed items do not appear.

Edit: Nevermind, changing the plugin load order fixed it.
Reply

It seems that something is wrong with Streamer_UpdateEx in 2.9.0. I aways get this warning:

Код:
[14:56:08] *** Streamer Plugin: Streamer_UpdateEx: Expecting 8 parameter(s), but found 9
Maybe the "freezeplayer" parameter isn't properly implemented?
Reply

I don't see DynamicActors
http://i.imgur.com/12pFK93.png

Server said: visible actors 0
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)