[Include] MidoStream - Flexible Object Streamer
#1

MidoStream - Object Streamer
By MidoBan
MidoStream is a new and flexible object streamer. I decided making a new object streamer because any of the other object streamers i found lacked lots of functions that are needed for managing all of the objects from within the streamer.
Therefore, many people used a streamer, and in addition, had some objects outside of the streamer.
The streamer has all the functions you need in order to manage all of your objects in it without exceptions.
It works in a method that none of the moving or attached objects will get out of synch.
The streamer can be used in multiple filterscripts as well.

The functions:
Код:
CreateStreamObject(modelid,Float:xpos,Float:ypos,Float:zpos,Float:xrot,Float:yrot,Float:zrot,Float:viewdist) - Create a streamed object
DestroyStreamObject(id) - Destroy a streamed object
GetStreamObjectPos(id,&Float:xpos,&Float:ypos,&Float:zpos) - Get the position of a streamed object
GetStreamObjectRot(id,&Float:xrot,&Float:yrot,&Float:zrot) - Get the rotation of a streamed object
SetStreamObjectPos(id,Float:xpos,Float:ypos,Float:zpos) - Set the position of a streamed object
SetStreamObjectRot(id,Float:xrot,Float:yrot,Float:zrot) - Set the rotation of a streamed object
AttachStreamObjectToPlayer(id,playerid,Float:xoff,Float:yoff,Float:zoff,Float:xrot,Float:yrot,Float:zrot) - Attach a streamed object to a player
MoveStreamObject(id,Float:movx,Float:movy,Float:movz,Float:speed) - Move a streamed object
MidoStreamDisconnect(playerid) - Goes under OnPlayerDisconnect
Usage:
The streamer functions are in the same format as the native pawn functions format.
Here is a usage demonstration of some of the streamer functions:

CreateStreamObject:
Like CreateObject, the ID of the CreateStreamObject can be also stored in a variable, for example:
pawn Код:
new obj;
obj = CreateStreamObject(971, 22.344, 6543.454, 34.556, 0.444, 6.000, 0.000, 200.0);
Of course you can also create an object regularly without assigning it to a variable:
pawn Код:
CreateStreamObject(971, 22.344, 6543.454, 34.556, 0.444, 6.000, 0.000, 200.0);
MoveStreamObject:
pawn Код:
MoveStreamObject(obj, 48.344, 6541.454, 34.556, 2.5);
AttachStreamObjectToPlayer:
pawn Код:
AttachStreamObjectToPlayer(obj, playerid, 2.5, 1.7, 1.0, 0.0, 0.0, 90.0);
Installation:
In order to use the streamer, all you need to do is:
  • Place MidoStream.inc in your includes folder
  • Place MidoStream.pwn in your filterscripts folder
  • Compile MidoStream.pwn
  • Put MidoStream in your server.cfg (before all the scripts that use MidoStream)
  • On The first script in your server.cfg or in a script where u have a working OnPlayerDisconnect function, put this:
    pawn Код:
    public OnPlayerDisconnect(playerid,reason)
    {
      MidoStreamDisconnect(playerid);
    }
  • Dont forget! Always change the #define MAX_STREAM_OBJECTS number on top of the MidoStream.pwn to the overall number of objects you got.
  • Thats it! now you can freely use all the functions above by putting #include <MidoStream> at the top of your script.
Known bugs:
  • SetStreamObjectRot is not working because SetPlayerObjectRot isn't a working function (untested in SA-MP 0.3).
  • AttachStreamObjectToPlayer is not working because AttachPlayerObjectToPlayer was removed in SA-MP 0.3.
I'll be happy to hear any comment/bug report in this topic.
Enjoy!

Download:
MidoStream v1.3 - New and improved!





Converters:
convertFFS
Server Hex

Change log:
15/6/08 - I removed some unused array, the only thing it'll do is reduce the size of the .amx, redownload to get the update (only the .pwn file changed, just replace it and compile). Recommended.

15/6/08 - The MoveStreamObject synch bug have been fixed. Everything works perfectly without any bugs. You can use it for any fast MoveObject scripts as you want. Redownload the latest bug free version (very important update!).

21/6/08 - Updated something regarding destroying objects while moving, and creating objects immediately after it. If you encountered a problem with it, redownload to get the update.

28/6/08 - MidoStream v1.1 - The MoveStreamObject synch part was significantly improved. It's highly recommended. Redownload to get the update!

2/7/08 - MidoStream v1.2 - I know it hasn't been a long time since v1.1 but there are two major updates that are improving the streamer's performance in a way that it can clearly be declared as a new version.
- The MoveStreamObject logic has been changed a lot, Its way more accurate and efficient at the same time. For the ones interested, look at the differences between v1.1 and v1.2.
- A function in the script has been improved (upgraded speed and efficiency - could even increase the object/lag limit) - Thanks to ******.
I recommend all of the streamer users to download in order to get even better performance.

22/9/09 - MidoStream v1.3 - Been a long time since the last version.. Added support in the GMX command (now the objects won't multiply after a GMX) and updated to the new SA-MP object limit - 254 objects per area.

29/9/09 - In order to prevent complications, i posted a SA-MP 0.2x version and a 0.3 one. The only difference is the 150 objects per area in the 0.2x and the 254 in the 0.3.

25/12/09 - Hi everyone, I'm almost sure i found the reason objects kept disappearing on you since the SA-MP 0.3 MidoStream version. It was a ridiculous typing mistake in the MidoStreamDisconnect function. I have no option to test it right now but i'm almost certain that it was the problem, download again and try. Post if it was solved.
Reply
#2

Nicely scripted, almost same style as me
Reply
#3

Quote:
Originally Posted by yom
Nicely scripted, almost same style as me
Thanks yom!
Reply
#4

Quote:
Originally Posted by yom
Nicely scripted, almost same style as me
Very nice MidoBan , but how many objects it stream? what is the limit .
Reply
#5

Quote:
Originally Posted by [DSK
Zh3r0 ]
Very nice MidoBan , but how many objects it stream? what is the limit .
I havent really tested it to its limit, but it worked good with 10000 objects when i was alone in my privet server.
And its working fine with ~1500 objects on my public server (50-80 players at mid day hours).

I cant test it any further on my public server because i cant do tests on it.. If u got a server and u wanna test it, please do and say how it went.

Dont forget the #define MAX_STREAM_OBJECTS (look on the main post).
Reply
#6

Very nice script :P
edit: WTF look at the AMX size :X
Reply
#7

Quote:
Originally Posted by Amit B
Very nice script :P
edit: WTF look at the AMX size :X
It's ok.. its just the arrays of the player objects.
Most of these cells are empty and the streamer doesn't even goes through the empty ones.
As you change the MAX_STREAM_OBJECTS value the size of the amx will reduce either..
Reply
#8

Dude thats almost stolen by Einstein...
sorry for you, you can't do sth. yourself
Reply
#9

Thanks alot.
Reply
#10

Quote:
Originally Posted by cocakiller
Dude thats almost stolen by Einstein...
sorry for you, you can't do sth. yourself
They have nothing in common, it doesn't look copied at all. Nice work Mido
Reply
#11

Quote:
Originally Posted by cocakiller
Dude thats almost stolen by Einstein...
sorry for you, you can't do sth. yourself
Please dont post unproven assumptions.
Check before you point with stuff like that.
The script is 100% original, i dont need/want to copy nothing from anyone!
Reply
#12

Go go Midoban! :P

נמרוד יפרו
Reply
#13

Quote:
Originally Posted by TalBarami
Go go Midoban! :P

נמרוד יפרו
Tal since when do you use the samp forums?

חחח יצרת משתמש רק כדי להגיב פה?

תקפיץ את הנושא של האדמין מוד שלי
Reply
#14

Quote:
Originally Posted by Yaheli
Quote:
Originally Posted by TalBarami
Go go Midoban! :P

נמרוד יפרו
YAH, what is this Language :O //\-/=-=-/+ :P
Tal since when do you use the samp forums?

חחח יצרת משתמש רק כדי להגיב פה?

תקפיץ את הנושא של האדמין מוד שלי
Reply
#15

It's Hebrew.

And you probably can't see it correctly on your PC.
Reply
#16

Quote:
Originally Posted by Yaheli
Quote:
Originally Posted by TalBarami
Go go Midoban! :P

נמרוד יפרו
Tal since when do you use the samp forums?

חחח יצרת משתמש רק כדי להגיב פה?

תקפיץ את הנושא של האדמין מוד שלי
האנגלית ממש גרועה.. תתעלם :S

i'm not posting here usually...
only when it's something important enough to post for..

and [DSK]Zh3r0, it's calls "Hebrew" :P
Reply
#17

Very good Mido
I think it the best streamer that I saw, and it's really great that you have done all those functions
MoveObject or AttachObjectToPlayer and other stuff in the streamer..
Are'nt you the first to do it? man you're great :]
Reply
#18

Quote:
Originally Posted by NewB
Very good Mido
I think it the best streamer that I saw, and it's really great that you have done all those functions
MoveObject or AttachObjectToPlayer and other stuff in the streamer..
Are'nt you the first to do it? man you're great :]
Thanks..
I know Y_Objects had those funcs but for some reason it didn't work for me..
So i couldn't find any streamer with those, this might be the first one published with those funcs.
Reply
#19

Damn What A Awsome Streamer
Mido, i Allways knew that u are the best
man, no one done a streamer like this ever,
now every singel object even if its a MoveObject it will be in your streamer.
i recommands hardly for every each server to use this streamer.
Damn youre Good :P
Reply
#20

Quote:
Originally Posted by NewB
Very good Mido
I think it the best streamer that I saw, and it's really great that you have done all those functions
MoveObject or AttachObjectToPlayer and other stuff in the streamer..
Are'nt you the first to do it? man you're great :]
hes not the first but hes defo the best so far i recon - my TSS has them but urs is better for objects mido hehe - very nicely coded
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)