[FilterScript] Vehicle Objects Streamer
#1

Vehicle Objects Streamer
by mick88
I couldn't find this script, so I'm releasing my own. Many said it's impossible to stream objects attached to vehicle, because player objects cannot be attached. My streamer works in similar fashion as Incognito's Streamer (streaming pickups) and streams object to all players once any of the players is in the object streaming range. I believe this is still helpful since not all vehicles are streamed in all at once. You can set your streaming distance to something low to stream only objects attached to vehicles that are being used.

Available functions:

pawn Код:
CreateVehicleObject(modelid, vehicleid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:stream_distance=100.0); //creates object and attaches it to vehicle. Returns Vehicle Object ID
DestroyVehicleObject(vobjectid); //Destroys object
RemoveObjectsFromVehicle(vehicleid); //Destroys all objects attached to the vehicle
Example of use:

pawn Код:
CMD:neon(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid),
    neon1 = CreateVehicleObject(18648, vehicleid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0, 50),
    neon2 = CreateVehicleObject(18648, vehicleid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0, 50);
    if (neon1) SendClientMessage(playerid, 0xFFFFFFFF, "Neon1 installed!");
    if (neon2) SendClientMessage(playerid, 0xFFFFFFFF, "Neon2 installed!");
    return 1;
}

CMD:removeobjects(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid),
        msg[128];
    format(msg, 128, "%d vehicle objects removed", RemoveObjectsFromVehicle(vehicleid));
    SendClientMessage(playerid, 0xFFFFFFFF, msg);
    return 1;
}
Default streaming interval: 500
Default max vehicle objects: 100
(these values can be changed by editing defines in vehicle_object_streamer.pwn)

Video: Streamed object vs static object. I set timer interval to 1000 and streaming distance to 15 for this video.


Download link
Reply
#2

Woot woot nice work mick ALways making new and useful stuff!
Reply
#3

Nice work dude keep it up.
Reply
#4

Pretty nice, good job!
Reply
#5

Good job
Reply
#6

Nice work! i like it
Reply
#7

i also like it
Reply
#8

Good job.
Reply
#9

That will come in handy, thanks.

Great work.
Reply
#10

Great! Can you convert it to CreateDynamicObject [Incognito one] because CreateObject might cause some problems if there will be more objects, or not? Thanks ! Correct me if am wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)