SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 07/05/2017, 04:00 PM   #5621
coool
Huge Clucker
 
Join Date: Feb 2013
Location: Pakistan, Sindh
Posts: 448
Reputation: 28
Default Re: Streamer Plugin

Quote:
Originally Posted by rt-2 View Post
No it's not in the wiki (like I said), the function is in the native list, but no parameters description is given, but on this page it was given before. So the information was available but is not anymore.
https://github.com/samp-incognito/sa...tives-(Objects)
__________________
My Writing Works
Lost In Future

coool is offline   Reply With Quote
Old 07/05/2017, 04:55 PM   #5622
IstuntmanI
High-roller
 
IstuntmanI's Avatar
 
Join Date: Mar 2009
Location: Romania
Posts: 1,884
Reputation: 366
Default Re: Streamer Plugin

Quote:
Originally Posted by AbyssMorgan View Post
E_STREAMER_EXTRA_ID is integer not array
E_STREAMER_EXTRA_ID internally is a "std::vector< int >" . So, technically, it is an array (1D/vector, of integers), not an integer, but it can be used as both because Incognito added the possibility to use it with the natives manipulating just an integer (Streamer_SetIntData and Streamer_GetIntData) by actually setting/getting only the first value in that vector of extra integers (you can check getFirstValueInContainer and setFirstValueInContainer in the source code).

--------------------------

Quote:
Originally Posted by Riddick94 View Post
<>
Ok, so here's my try to help you. In your first post you didn't post everything. The first "if" line and the whole code block looks ok ( you are even checking first if it is valid, but this means that PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID] will NEVER be set to INVALID_OBJECT_ID (actually, it would be 0, because Streamer_GetItemStreamerID returns 0 if it isn't a dynamic object ID, here is your error: invalid default ID set) there because lookingat_objectid is not a "ValidDynamicObject" [ in the "if" check before checking for PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID] ] ), which means that the problem is from the second block of code ("else"), which is called if he isn't looking at any dynamic object.
Did you set PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID] to INVALID_OBJECT_ID when the player connects ? If it isn't INVALID_OBJECT_ID (0xFFFF/65535) that check will be true which means that it will go to this ( assuming that variable is set to 0 (or, well, any other invalid dynamic object ID, if not set as INVALID_OBJECT_ID) ):
PHP Code:
Streamer_GetArrayData(STREAMER_TYPE_OBJECT/*PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID]*/E_STREAMER_EXTRA_IDobject_datasizeof(object_data));

if(
Streamer_IsInArrayData(STREAMER_TYPE_OBJECT/*PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID]*/E_STREAMER_EXTRA_IDobject_data[9])) 
hence your warnings, exactly in that order:
Quote:
*** Streamer Plugin: Streamer_GetArrayData: Invalid ID specified.
*** Streamer Plugin: Streamer_IsInArrayData: Invalid ID specified.
By the way, INVALID_OBJECT_ID is actually a really valid object ID in Streamer Plugin (Dynamic Object ID 65535), so you'd better initialize it with 0 (or INVALID_STREAMER_ID), as object IDs are starting from 1, just in case. Also, you should really use the latest Streamer Plugin, in v2.9.0 the function GetPlayerCameraTargetDynObject was added, which returns 0 (INVALID_STREAMER_ID) when he isn't targeting any dynamic object.

To simply check if my theory is correct, you should add IsValidDynamicObject(PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID]) after the first check:
Code:
if(PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID] != INVALID_OBJECT_ID)
=>
Code:
if(PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID] != INVALID_OBJECT_ID && IsValidDynamicObject(PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID]))
I don't see anything else which could cause that in the code you posted, so this should really be the problem. Always keep in mind the possible functions return values. Sorry if you didn't understand, but I think that I explained as much as possible (maybe too much, so this might rise problems in understanding what I said xD).

--------------------------

When requesting help you have post the whole code blocks, not only just a part, maybe the problem isn't really from where you think it is from, just like in this case.
__________________


IstuntmanI is offline   Reply With Quote
Old 07/05/2017, 07:17 PM   #5623
Riddick94
High-roller
 
Riddick94's Avatar
 
Join Date: Mar 2010
Location: Poland
Posts: 1,947
Reputation: 185
Default Re: Streamer Plugin

Quote:
Originally Posted by IstuntmanI View Post
...
Would have never thought of anyone to be that experienced with Streamer and to be that happy to help.

Thanks.

That's what I had in my OnPlayerConnect:
Code:
PlayerData[playerid][E_PLAYER_LOOKING_AT_ITEMID] = PlayerData[playerid][E_PLAYER_LOOKING_AT_PLAYERID] = -1;

Let me play around a bit with the informations you have gave me and I will come up with the solution for sure. Also, have changed right away the function:

Code:
new lookingat_objectid = GetPlayerCameraTargetDynObject(playerid);

I will edit this post.

edit://
The issue was with the OnPlayerConnect where I haven't set the 2D Array value to INVALID but to '-1' instead. Thanks a lot!
__________________
Have spent some great time of my life here since 0.1b version of SA-MP. I will never-ever forget the times I have had so much fun with people around here, during gameplay, scripting and being invented in so many SA-MP projects. Maybe I wasn't so active in FS/INC/GM sections to some of you and never have released that much but there's a reason behind it which isn't actually work mentioning. I am here to say goodbye to everyone and thanks for all the good times. TLoU (SA-MP) project shall never be finished because of me - but there's nothing we can do about it really. I think I am too old for all of it and same for the gaming (I guess) - I just can not let myself spend any more time in this addictive modification for GTA:SA. I have got something out of it and I respect it so much. Saying that I owe SA-MP my current job that I have is more than enough. There's not any certain steps that you have to take in order to achieve your goals.

Much love from Uncle Riddick and take care everyone
Riddick94 is online now   Reply With Quote
Old 08/05/2017, 02:07 PM   #5624
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montréal, Québec, Canada
Posts: 275
Reputation: 24
Default Re: Streamer Plugin

I will do that next time I HAVE to dig to find information,, just weird that they previously provided it and just removed it instead of transfering.
__________________
rt-2
My hardcore first person 1994 simulation in development:
SA Advance Roleplay
rt-2 is offline   Reply With Quote
Old 10/05/2017, 07:30 PM   #5625
Riddick94
High-roller
 
Riddick94's Avatar
 
Join Date: Mar 2010
Location: Poland
Posts: 1,947
Reputation: 185
Default Re: Streamer Plugin

IsPlayerInDynamicArea - capable of recognizing only PLAYER. Is this possible to get it to work on NPCs too?

response:// @down,
You are probably mad. I'm not gonna use timer for that.
__________________
Have spent some great time of my life here since 0.1b version of SA-MP. I will never-ever forget the times I have had so much fun with people around here, during gameplay, scripting and being invented in so many SA-MP projects. Maybe I wasn't so active in FS/INC/GM sections to some of you and never have released that much but there's a reason behind it which isn't actually work mentioning. I am here to say goodbye to everyone and thanks for all the good times. TLoU (SA-MP) project shall never be finished because of me - but there's nothing we can do about it really. I think I am too old for all of it and same for the gaming (I guess) - I just can not let myself spend any more time in this addictive modification for GTA:SA. I have got something out of it and I respect it so much. Saying that I owe SA-MP my current job that I have is more than enough. There's not any certain steps that you have to take in order to achieve your goals.

Much love from Uncle Riddick and take care everyone

Last edited by Riddick94; 12/05/2017 at 03:10 PM.
Riddick94 is online now   Reply With Quote
Old 10/05/2017, 08:43 PM   #5626
ForT
Gangsta
 
ForT's Avatar
 
Join Date: Sep 2012
Location: Brasil - Florianópolis
Posts: 632
Reputation: 235
Default Re: Streamer Plugin

Quote:
Originally Posted by Riddick94 View Post
IsPlayerInDynamicArea - capable of recognizing only PLAYER. Is this possible to get it to work on NPCs too?
Take the position of the NPC and use IsPointInDynamicArea
__________________

Português | English | Español
ForT is online now   Reply With Quote
Old 18/05/2017, 08:52 AM   #5627
iLearner
Banned
 
Join Date: Apr 2017
Posts: 431
Reputation: 89
Default Re: Streamer Plugin

Is there any function like CreateDynamicPlayer3DTextLabel ? (per player labels)
iLearner is offline   Reply With Quote
Old 18/05/2017, 08:55 AM   #5628
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,264
Reputation: 323
Default Re: Streamer Plugin

a_samp.inc
PHP Code:
CreatePlayer3DTextLabel(playeridtext[], colorFloat:XFloat:YFloat:ZFloat:DrawDistanceattachedplayer=INVALID_PLAYER_IDattachedvehicle=INVALID_VEHICLE_IDtestLOS=0); 
streamer.inc
Code:
CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance,
attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0,
worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_3D_TEXT_LABEL_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0);
AbyssMorgan is offline   Reply With Quote
Old 28/05/2017, 10:37 AM   #5629
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: Next to Oblivion (Kalcor's place)
Posts: 1,222
Reputation: 174
Default Re: Streamer Plugin

Quote:
Originally Posted by AbyssMorgan View Post
a_samp.inc
PHP Code:
CreatePlayer3DTextLabel(playeridtext[], colorFloat:XFloat:YFloat:ZFloat:DrawDistanceattachedplayer=INVALID_PLAYER_IDattachedvehicle=INVALID_VEHICLE_IDtestLOS=0); 
streamer.inc
Code:
CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance,
attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0,
worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_3D_TEXT_LABEL_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0);
I've worked with dynamic labels per player but for some reason they get attached to wrong player when the player disconnects/ dies/ spectates, while I also destroy label on OnPlayerDeath, OPDisconnect and in such other places.
__________________
Providing SA-MP, G-MOD, Minecraft, MTA and Web hosting @ https://www.prestigesteve.com.
Top notch quality experience and support!
Logic_ is offline   Reply With Quote
Old 09/06/2017, 03:34 PM   #5630
Riddick94
High-roller
 
Riddick94's Avatar
 
Join Date: Mar 2010
Location: Poland
Posts: 1,947
Reputation: 185
Default Re: Streamer Plugin

This is my function, when admin creates an item on the server:

Code:
PublicEx OnAdminCreateItem(playerid, objectid, itemid, modelid, quantity, Float:x, Float:y, Float:z)
{
Streamer_UpdateEx(playerid, x, y, z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));

new object_data[10];
object_data[0] = itemid;
SerwerData[E_SERWER_LAST_ITEM_UID] = object_data[1] = cache_insert_id();
object_data[2] = modelid;
object_data[3] = _:x;
object_data[4] = _:y;
object_data[5] = _:z;
object_data[6] = GetPlayerVirtualWorld(playerid);
object_data[7] = GetPlayerInterior(playerid);
object_data[8] = quantity;
object_data[9] = INVALID_3DTEXT_ID;

Streamer_SetArrayData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_EXTRA_ID, object_data, sizeof(object_data));

I want to add an extra array 'object_data[10]' but it has to be a string which can hold 64 characters.

Code:
strmid(object_data[10][......], "My text has 64 chars or whatever", 0, 64, 64);

object_data[10] and then it needs to know the amount of chars which is [64]... I can't figure it out and dunno how to do it.

Anyone?
__________________
Have spent some great time of my life here since 0.1b version of SA-MP. I will never-ever forget the times I have had so much fun with people around here, during gameplay, scripting and being invented in so many SA-MP projects. Maybe I wasn't so active in FS/INC/GM sections to some of you and never have released that much but there's a reason behind it which isn't actually work mentioning. I am here to say goodbye to everyone and thanks for all the good times. TLoU (SA-MP) project shall never be finished because of me - but there's nothing we can do about it really. I think I am too old for all of it and same for the gaming (I guess) - I just can not let myself spend any more time in this addictive modification for GTA:SA. I have got something out of it and I respect it so much. Saying that I owe SA-MP my current job that I have is more than enough. There's not any certain steps that you have to take in order to achieve your goals.

Much love from Uncle Riddick and take care everyone
Riddick94 is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Checkpoint / Area sub-streamer for incognito's streamer plugin Pottus Includes 11 21/03/2014 07:31 PM
Need 3dtextlabel Streamer And Gangzone Streamer !! Please Help . Not streamer plugin . jame42 Scripting Help 4 30/05/2012 08:33 AM
Streamer plugin 0.3d rt-2 Plugin Development 7 05/12/2011 07:17 PM
Streamer Plugin Help! ColdXX Everything and Nothing 2 21/08/2010 11:28 PM
Streamer Plugin! ColdXX Help Archive 10 18/07/2010 01:47 PM


All times are GMT. The time now is 07:03 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.