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.
|
#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]); }
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.
|
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.
|
You can use Streamer_GetNearbyItems to get all the near by items streamed.
pawn Код:
pawn Код:
|
Uhmm... where did you find that function? I downloaded the latest streamer and it isn't there
|
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 }
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 } |
//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(atObj, mainObj, 1.0, 0.0, 0.4, 30.0, 0.0, 0.0); //attaching atObj to mainObj
//it`s working very well
native GetPlayerDynamicAreas(playerid, STREAMER_TAG_AREA areas[], maxareas = sizeof areas);
native GetPlayerNumberDynamicAreas(playerid);
If i have like 50k items on server, and every item object has DynamicArea.
Should i use: pawn Код:
|
D:\Server\pawno\include\streamer.inc(254) : error 017: undefined symbol "OBJECT_MATERIAL_SIZE_256x128" |
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. |
[14:56:08] *** Streamer Plugin: Streamer_UpdateEx: Expecting 8 parameter(s), but found 9