14.06.2008, 21:02
(
Последний раз редактировалось MidoBan; 20.08.2010 в 16:15.
)
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.By MidoBan
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
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);
pawn Код:
CreateStreamObject(971, 22.344, 6543.454, 34.556, 0.444, 6.000, 0.000, 200.0);
pawn Код:
MoveStreamObject(obj, 48.344, 6541.454, 34.556, 2.5);
pawn Код:
AttachStreamObjectToPlayer(obj, playerid, 2.5, 1.7, 1.0, 0.0, 0.0, 90.0);
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.
- 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.
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.