06.05.2017, 13:25
Quote:
E_STREAMER_EXTRA_ID could be array, could be integer. Are you sure it happens in that function? Add some debug, print the object's id and ensure that this object exist.
|
So, I have commented the line where the timer is being called for player in OnPlayerSpawn and the warning message doesn't appear in the console.
So, the issue appears to be in the "OnPlayerLookAt" code. As I have said before, I have added IF statement validations to check if the object exists or not for the player so it SHOULDN'T come up with anything like that in the console.
Some more code, if you'd like:
native
pawn Код:
stock GetPlayerCameraDynamicObject(playerid)return Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_OBJECT, GetPlayerCameraTargetObject(playerid));
pawn Код:
new lookingat_objectid = GetPlayerCameraDynamicObject(playerid);
if(IsValidDynamicObject(lookingat_objectid))
{
if(PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID] == INVALID_OBJECT_ID)
{
new object_data[10];
Streamer_GetArrayData(STREAMER_TYPE_OBJECT, lookingat_objectid, E_STREAMER_EXTRA_ID, object_data, sizeof(object_data));
new itemid = object_data[0];
if(ItemData[itemid][E_ITEM_TYPE] != ITEM_TYPE_NONE)
{
if(Streamer_IsInArrayData(STREAMER_TYPE_OBJECT, lookingat_objectid, E_STREAMER_EXTRA_ID, INVALID_3DTEXT_ID))
{
PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID] = lookingat_objectid;
object_data[9] = _:CreateDynamic3DTextLabel(ItemData[itemid][E_ITEM_NAME], COLOR_NICK, Float:object_data[3], Float:object_data[4], Float:object_data[5], 2.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, false, object_data[6], object_data[7], playerid, 5.0);
Streamer_SetArrayData(STREAMER_TYPE_OBJECT, lookingat_objectid, E_STREAMER_EXTRA_ID, object_data, sizeof(object_data));
Streamer_Update(playerid, STREAMER_TYPE_3D_TEXT_LABEL);
}
}
}
}
else
{
if(PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID] != INVALID_OBJECT_ID)
{
new object_data[10];
Streamer_GetArrayData(STREAMER_TYPE_OBJECT, PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID], E_STREAMER_EXTRA_ID, object_data, sizeof(object_data));
if(Streamer_IsInArrayData(STREAMER_TYPE_OBJECT, PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID], E_STREAMER_EXTRA_ID, object_data[9]))
{
DestroyDynamic3DTextLabel(Text3D:object_data[9]);
Streamer_Update(playerid, STREAMER_TYPE_3D_TEXT_LABEL);
object_data[9] = INVALID_3DTEXT_ID;
Streamer_SetArrayData(STREAMER_TYPE_OBJECT, PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID], E_STREAMER_EXTRA_ID, object_data, sizeof(object_data));
}
PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID] = INVALID_OBJECT_ID;
}
}