[Plugin] Streamer Plugin

Hmm

I just downloaded the streamer and included it

it\'s my first time adding a streamer to my server


So my questions are:

To spawn an object i have to write: CreateDynamicObject(...)

in this i have to write the playerid

for what? can only this player see the object then?


also i wanted to add vehicles

but i wasn\'t able to read the code for this in the informations

when i tried to add them by writing: AddStaticVehicle(..)

they just didn\'t spawn


and my third question:

why does my OnPlayerCommandText(playerid, cmdtext[]) funktion

not do anything anymore

when i write a command

the script writes: Unkown command



i hope anyone can help


sorry for my bad english, I\'m from austria xP
Reply

E_STREAMER_ATTACHED_PLAYER,

E_STREAMER_ATTACHED_VEHICLE,


What is it, what can i do with it ??
Reply

I find that CreateDynamic3DTextLabel seems to be unable to change the line of sight.
No matter if I turned it on or not it still have line of sight.

pawn Код:
CreateDynamic3DTextLabel("Bank staff",COLOR_YELLOW,0.0,0.0,0.2,30.0,playerid,INVALID_VEHICLE_ID,1,0,0,-1,80);//ID of the NPC in OnPlayerSpawn
CreateDynamic3DTextLabel("Bank staff",COLOR_YELLOW,0.0,0.0,0.2,30.0,playerid,INVALID_VEHICLE_ID,0,0,0,-1,80);
Both give the same result - LOS is on.
Reply

Why are the objects loading slow ?
Reply

Since SA-MP 0.3c the server console puts out an error because of this script code:

Streamer_GetFloatData(STREAMER_TYPE_CP,cp[cpid],E_STREAMER_X,cx);

The error: *** Streamer_GetFloatData: Invalid data specified

I want to GetFloatData from checkpoints, which can be active or inactive. What is my mistake? The strange thing is, the error comes since 0.3c
Reply

the function
pawn Код:
CountDynamicObjects
/\ Displays objects existing in sever ??ї
Reply

Yes,

it displays how many objects you created using CreateDynamicObject(...);
Reply

Quote:
Originally Posted by Manuel1948
Посмотреть сообщение
Since SA-MP 0.3c the server console puts out an error because of this script code:

Streamer_GetFloatData(STREAMER_TYPE_CP,cp[cpid],E_STREAMER_X,cx);

The error: *** Streamer_GetFloatData: Invalid data specified

I want to GetFloatData from checkpoints, which can be active or inactive. What is my mistake? The strange thing is, the error comes since 0.3c
cuz you haven't stored any checkpoint ID into cp[cpid](probably it is not created).
you need to make some check for it, for example:
pawn Код:
if(cp[cpid] != -1)//-1 is your value that it means no checkpoint ID is assigned to it
{
    Streamer_GetFloatData(STREAMER_TYPE_CP,cp[cpid],E_STREAMER_X,cx);
    //Some more of your code
}
else
{
    //Your code when no checkpoint ID is assigned to that.
}
Reply

Hey this plugin is allocating some wrong memory adresses?
I did not format any strings with 'public OnPlayerConnect' but WTF look at this:


edit after fixing the problemk code is not important, If you need it to fix the error/ whatever I will pm it to you.
Looks like it's not scripting based error. But it can be 'fixed' with scripting.
Edit:
Okay it's fixed (with a temporary solution?) , added everywhere string terminator's , a few spaces and _'s

EDIT3:
NOT SLOVED, still reappears after adding a few strings!!

pawn Код:
format(InfoBoxStr[7],64,"%s\0",InfoBoxStr[6]);
    format(InfoBoxStr[6],64,"%s\0",InfoBoxStr[5]);
    format(InfoBoxStr[5],64,"%s\0",InfoBoxStr[4]);
    format(InfoBoxStr[4],64,"%s\0",InfoBoxStr[3]);
    format(InfoBoxStr[3],64,"%s\0",InfoBoxStr[2]);
    format(InfoBoxStr[2],64,"%s\0",InfoBoxStr[1]);
    format(InfoBoxStr[1],64,"%s\0",InfoBoxStr[0]);
    format(InfoBoxStr[0],64,"%s\0",msg);

    format(infostr,255,"~w~%s~n~~w~%s~n~~w~%s~n~~w~%s~n~~w~%s~n~~w~%s~n~~w~%s \0",InfoBoxStr[0],InfoBoxStr[1],InfoBoxStr[2],InfoBoxStr[3]);
    format(infostr2,255,"~w~%s~n~~w~%s~n~~w~%s~n~~w~%s~n~~w~%s~n~~w~%s~n~~w~%s \0",InfoBoxStr[4],InfoBoxStr[5],InfoBoxStr[6],InfoBoxStr[7]);
It has to be somewhere here...

When I add short strings is appears, when I add very long strings, about 4 times it dissapears.
Eh the streamer affects all my format()s!
WuT.. is going on?
You have spawned OnPlayerConnect succefully.. what the hell... Should be a carname!
Can it be bacause this code is wrong: ?
pawn Код:
stock SendFormatInfo(const msg[],bool:check=false,{Float,_}:...)
{
    new len = strlen(msg),d=0,posArg = 2;
    new dest[512];
    for(new i=0;i<len;i++)
    {
        if(msg[i] == '%')
        {
            switch (msg[i+1])
            {
                case 's':
                {
                    new pos,arg,tmppos;
                    new str[128];
                    while(getarg(posArg,pos)!='\0')
                    {
                        arg=getarg(posArg,pos++);
                        str[tmppos]=arg;
                        tmppos++;
                    }
                    strins(dest,str,d,strlen(str));
                    d+=strlen(str);
                    posArg++;
                    i++;
                }
                case 'i', 'd':
                {
                    new str[128];
                    format(str,sizeof(str),"%d",getarg(posArg));
                    strins(dest,str,d,strlen(str));
                    d+=strlen(str);
                    posArg++;
                    i++;
                }
                case 'f':
                {
                    new str[128];
                    format(str,sizeof(str),"%f",getarg(posArg));
                    strins(dest,str,d,strlen(str));
                    d+=strlen(str);
                    posArg++;
                    i++;
                }
                case '.':
                {
                    new len2 = msg[i+2];
                    if(len2 == 0)
                    {
                        dest[d] = msg[i];
                        d++;
                    }
                    else
                    {
                        new str[32],formatting[5];
                        formatting[0] = '%';
                        formatting[1] = '.';
                        formatting[2] = len2;
                        formatting[3] = 'f';
                        format(str,sizeof(str),formatting,getarg(posArg));
                        strins(dest,str,d,len2);
                        d+=len;
                        posArg++;
                        i+= 2;
                    }
                }
                default:
                {
                    dest[d] = msg[i];
                    d++;
                }
            }
        }
        else
        {
            dest[d] = msg[i];
            d++;
        }
    }
    return SendInfo(dest,check);
}
Ah nevermind I will try to fix it myself lol..
Reply

Quote:
Originally Posted by gamer_Z
Посмотреть сообщение
...
Take a look at my code:
http://forum.sa-mp.com/showpost.php?...postcount=1473

But better use CPF from ZeeX or ****** or just the simple define. They're faster.
Reply

thanks I'll try that and let ya know.
Reply

well this dont work with more than 3000 objects.....as i have tested it with my own GM .....
Reply

Dude, there is no worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0 paramater, can't you see that they are Optional. and createobject is the same thing as that. createobject creates in all worlds, interiors, for all players, and drawdistance 200.0 ( u can actually change this.)
Reply

Heh, but anyway its a mistake. Optional or not BUT.
Reply

its not a mistake, thats how it was done..
Reply

Quote:
Originally Posted by BaubaS
View Post
Heh, but anyway its a mistake. Optional or not BUT.
If it's a mistake the code will fail.
Try to convert that and use it in your script,
and you will know if it is a "bug".
If you want those parameters why don't you use Ctrl+H?
Reply

I will use it
Reply

Quote:
Originally Posted by FireWol
View Post
I will use it
You must use it! =))
Reply

Hello Incognito!

I use this plugin on my server to stream everything. (except mapicons)
The problem is that, that my server randomly crashes. I downloaded the crashdetect plugin which says:
Quote:

[17:28:37] The server has crashed due to an unexpected error in filterscripts\objects.amx.
[17:28:37] Stack trace of filterscripts\flife_objects.amx (most recent call first):
[17:28:37] #0: OnFilterScriptInit (entry point) in streamer.inc

The objects.pwn only includes the streamed objects (about 2500), and looks like this:

Code:
#include <a_samp>
#include streamer
public OnFilterScriptInit()
{
// aprox. 2500 objects in CreateDynamicObject format
return 1;
}
public OnFilterScriptExit()
{
	DestroyAllDynamicObjects();
	return 1;
}
Reply

Do map icons work in interiors? I can't get them to work in interiors, only outside interiors, and I'm not a noob.
Reply


Forum Jump:


Users browsing this thread: 26 Guest(s)