SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 14/06/2008, 09:02 PM   #1
MidoBan
Huge Clucker
 
MidoBan's Avatar
 
Join Date: Jan 2008
Posts: 208
Reputation: 10
Default MidoStream - Flexible Object Streamer

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:
Code:
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 Code:
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 Code:
CreateStreamObject(971, 22.344, 6543.454, 34.556, 0.444, 6.000, 0.000, 200.0);

MoveStreamObject:
pawn Code:
MoveStreamObject(obj, 48.344, 6541.454, 34.556, 2.5);

AttachStreamObjectToPlayer:
pawn Code:
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 Code:
    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.

Last edited by MidoBan; 20/08/2010 at 04:15 PM.
MidoBan is offline   Reply With Quote
Old 14/06/2008, 09:58 PM   #2
yom
Gangsta
 
Join Date: Jul 2006
Posts: 988
Reputation: 6
Default Re: MidoStream - Object Streamer attach/move/create/destroy...

Nicely scripted, almost same style as me
yom is offline   Reply With Quote
Old 15/06/2008, 06:21 AM   #3
MidoBan
Huge Clucker
 
MidoBan's Avatar
 
Join Date: Jan 2008
Posts: 208
Reputation: 10
Default Re: MidoStream - Object Streamer attach/move/create/destroy...

Quote:
Originally Posted by yom
Nicely scripted, almost same style as me
Thanks yom!
MidoBan is offline   Reply With Quote
Old 15/06/2008, 06:37 AM   #4
Zh3r0
High-roller
 
Join Date: Mar 2008
Posts: 4,512
Reputation: 398
Default Re: MidoStream - Object Streamer attach/move/create/destroy...

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 .
__________________
Zh3r0 is offline   Reply With Quote
Old 15/06/2008, 06:45 AM   #5
MidoBan
Huge Clucker
 
MidoBan's Avatar
 
Join Date: Jan 2008
Posts: 208
Reputation: 10
Default Re: MidoStream - Object Streamer attach/move/create/destroy...

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).
MidoBan is offline   Reply With Quote
Old 15/06/2008, 07:10 AM   #6
Amit_B
Huge Clucker
 
Amit_B's Avatar
 
Join Date: Nov 2007
Location: Israel
Posts: 349
Reputation: 69
Default Re: MidoStream - Object Streamer attach/move/create/destroy...

Very nice script :P
edit: WTF look at the AMX size :X
__________________
- Leading the Israeli SA-MP Community, SA-MP.co.il - SAMP-IL
- Currently working on the first anime project on SA-MP, Naruto Shippuden gamemode: #1, #2, #3

https://github.com/Amit-B/
Amit_B is offline   Reply With Quote
Old 15/06/2008, 07:23 AM   #7
MidoBan
Huge Clucker
 
MidoBan's Avatar
 
Join Date: Jan 2008
Posts: 208
Reputation: 10
Default Re: MidoStream - Object Streamer attach/move/create/destroy...

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..
MidoBan is offline   Reply With Quote
Old 15/06/2008, 08:02 AM   #8
cocakiller
Little Clucker
 
Join Date: Dec 2007
Posts: 18
Reputation: 0
Default Re: MidoStream - Object Streamer attach/move/create/destroy...

Dude thats almost stolen by Einstein...
sorry for you, you can't do sth. yourself
cocakiller is offline   Reply With Quote
Old 15/06/2008, 08:07 AM   #9
[IB]Scorcher
High-roller
 
[IB]Scorcher's Avatar
 
Join Date: Nov 2007
Posts: 1,007
Reputation: 39
Default Re: MidoStream - Object Streamer attach/move/create/destroy...

Thanks alot.
[IB]Scorcher is offline   Reply With Quote
Old 15/06/2008, 08:07 AM   #10
Yaheli_Faro
Huge Clucker
 
Join Date: Feb 2008
Posts: 315
Reputation: 8
Default Re: MidoStream - Object Streamer attach/move/create/destroy...

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
Yaheli_Faro is offline   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
Help! Midostream object sXecookie Help Archive 3 08/01/2010 08:49 PM
[Include] [INC] >>Object Streamer Object<<< (OStreamerO) DorkAZoid Includes 9 11/12/2009 02:28 PM
Dominator's Object Streamer - a wize and new streamer - invisible objects fix tsha Filterscripts 23 19/09/2009 08:37 PM
Need help! Object Streamer. paultje162 Help Archive 0 01/07/2009 03:25 PM
Object Streamer - Looking for a little streamer! ~300 obj. BeCometA Help Archive 1 26/06/2009 05:47 PM


All times are GMT. The time now is 05:32 AM.


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