12.05.2014, 11:34
CancelEdit(playerid)
Incognito is there a way to see how much dynamic objects are shown at a time globally, not for player?
I see that the limit is 500 and I think that I am getting near the limit as some dynamic objects start disapearing. (Mods sorry for double posts, the old post is 2 days old) |
Streamer_CountItems( STREAMER_TYPE_OBJECT )
I see that the limit is 500 and I think that I am getting near the limit as some dynamic objects start disapearing.
|
If you just want to count the amount of objects, you only need one cell to add the amount from each player.
pawn Код:
If you want to "mark" or "flag" streamer entities, don't store that data in the AMX space as streamer entities have no internal limit due to dynamic memory. You can store as much information as you want with each streamer entity by using the E_STREAMER_EXTRA_DATA array (which was updated today, check out 2.7.2). |
My3DText = Text3D: INVALID_3DTEXT_ID;
#include <a_samp> #include <streamer> #include <sscanf2> #define OBJECT_MODEL 1210 new ObjectID1; new ObjectID2; enum data { IntVar, Float:FloatVar, StringVar[MAX_PLAYER_NAME], IntVar1 }; new ObjectData[data]; public OnFilterScriptInit() { ObjectID1 = CreateDynamicObject(OBJECT_MODEL,1.0,1.0,1.0,0.0,0.0,0.0); ObjectData[IntVar] = 5; ObjectData[FloatVar] = 11.76543; sscanf("sexy_madafaka","s[24]",ObjectData[StringVar]); ObjectData[IntVar1] = 23; Streamer_SetArrayData(STREAMER_TYPE_OBJECT,ObjectID1,E_STREAMER_EXTRA_ID,ObjectData,sizeof(ObjectData)); ObjectID2 = CreateDynamicObject(OBJECT_MODEL,2.0,2.0,2.0,0.0,0.0,0.0); ObjectData[IntVar] = 776; ObjectData[FloatVar] = 3453.2342; sscanf("boss_roleplay","s[24]",ObjectData[StringVar]); ObjectData[IntVar1] = 1123; Streamer_SetArrayData(STREAMER_TYPE_OBJECT,ObjectID2,E_STREAMER_EXTRA_ID,ObjectData,sizeof(ObjectData)); SetTimer("PrintData",5000,0); return 1; } forward PrintData(); public PrintData() { Streamer_GetArrayData(STREAMER_TYPE_OBJECT,ObjectID1,E_STREAMER_EXTRA_ID,ObjectData,sizeof(ObjectData)); printf("ObjectData[IntVar]:%d",ObjectData[IntVar]); printf("ObjectData[FloatVar]:%f",ObjectData[FloatVar]); printf("ObjectData[StringVar]:%s",ObjectData[StringVar]); printf("ObjectData[IntVar1]:%d",ObjectData[IntVar1]); printf("\n\n"); Streamer_GetArrayData(STREAMER_TYPE_OBJECT,ObjectID2,E_STREAMER_EXTRA_ID,ObjectData,sizeof(ObjectData)); printf("ObjectData[IntVar]:%d",ObjectData[IntVar]); printf("ObjectData[FloatVar]:%f",ObjectData[FloatVar]); printf("ObjectData[StringVar]:%s",ObjectData[StringVar]); printf("ObjectData[IntVar1]:%d",ObjectData[IntVar1]); return 1; }
Console input: loadfs test [18:41:09] Filterscript 'test.amx' loaded. [18:41:15] ObjectData[IntVar]:5 [18:41:15] ObjectData[FloatVar]:11.765430 [18:41:15] ObjectData[StringVar]:sexy_madafaka [18:41:15] ObjectData[IntVar1]:23 [18:41:15] [18:41:15] ObjectData[IntVar]:776 [18:41:15] ObjectData[FloatVar]:3453.234130 [18:41:15] ObjectData[StringVar]:boss_roleplay [18:41:15] ObjectData[IntVar1]:1123
That's not really a usable bug report. As far as I know, those features are working fine on the latest version (I haven't noticed any problems recently).
It's likely that you're variables for storing entity IDs aren't being reset so when something is destroyed you still have a variable pointing to it so when a new one is created there are two variables pointing to it and if one is used in a Destroy function, the entity is destroyed. Always remember to reset variables to an invalid ID when destroying as the function doesn't do it for you. |