SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 09/07/2015, 02:28 PM   #1
kurta999
High-roller
 
kurta999's Avatar
 
Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 1,397
Reputation: 583
Default Streamer Plugin with Vehicle Streamer

I've decided to open new topic, I don't want to trash original one. I would like if Incognito was merge it into offical streamer, but before hard testing needed to avoid bugs.

This streamer version is 2.9.1

Code:
#define STREAMER_TYPE_VEHICLE (8)

#define STREAMER_VEHICLE_TYPE_STATIC (0)
#define STREAMER_VEHICLE_TYPE_DYNAMIC (1)

native AttachDynamicObjectToVehicle(STREAMER_TAG_OBJECT objectid, vehicleid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz, vehicletype = STREAMER_VEHICLE_TYPE_DYNAMIC);
native STREAMER_TAG_3D_TEXT_LABEL CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, vehicletype = STREAMER_VEHICLE_TYPE_DYNAMIC, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_3D_TEXT_LABEL_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0);
native AttachDynamicAreaToVehicle(STREAMER_TAG_AREA areaid, vehicleid, vehicletype = STREAMER_VEHICLE_TYPE_DYNAMIC, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);

// Natives (Vehicles)
native STREAMER_TAG_VEHICLE CreateDynamicVehicle(modelid, Float:fX, Float:fY, Float:fZ, Float:fRot, color1, color2, respawndelay, addsiren = 0, worldid = -1, interiorid = 0, playerid = -1, Float:streamdistance = STREAMER_VEHICLE_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0);
native DestroyDynamicVehicle(STREAMER_TAG_VEHICLE vehicleid);
native IsValidDynamicVehicle(STREAMER_TAG_VEHICLE vehicleid);
native IsDynamicVehicleStreamedIn(STREAMER_TAG_VEHICLE vehicleid, forplayerid);
native GetDynamicVehicleSpawnInfo(STREAMER_TAG_VEHICLE vehicleid, &Float:fX, &Float:fY, &Float:fZ, &Float:fRot, &color1, &color2, &siren);
native GetDynamicVehiclePos(STREAMER_TAG_VEHICLE vehicleid, &Float:x, &Float:y, &Float:z);
native SetDynamicVehiclePos(STREAMER_TAG_VEHICLE vehicleid, Float:x, Float:y, Float:z);
native GetDynamicVehicleZAngle(STREAMER_TAG_VEHICLE vehicleid, &Float:z_angle);
native GetDynamicVehicleRotationQuat(STREAMER_TAG_VEHICLE vehicleid, &Float:w, &Float:x, &Float:y, &Float:z);
native SetDynamicVehicleZAngle(STREAMER_TAG_VEHICLE vehicleid, Float:z_angle);
native Float:GetDynamicVehDistanceFromPoint(STREAMER_TAG_VEHICLE vehicleid, Float:X, Float:Y, Float:Z);
native SetDynamicVehParamsForPlayer(STREAMER_TAG_VEHICLE vehicleid,playerid,objective,doorslocked);
native SetDynamicVehicleParamsEx(STREAMER_TAG_VEHICLE vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
native GetDynamicVehicleParamsEx(STREAMER_TAG_VEHICLE vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective);
native GetDynamicVehParamsSirenState(STREAMER_TAG_VEHICLE vehicleid);
native SetDynamicVehParamsCarDoors(STREAMER_TAG_VEHICLE vehicleid, driver, passenger, backleft, backright);
native GetDynamicVehParamsCarDoors(STREAMER_TAG_VEHICLE vehicleid, &driver, &passenger, &backleft, &backright);
native SetDynamicVehParamsCarWindows(STREAMER_TAG_VEHICLE vehicleid, driver, passenger, backleft, backright);
native GetDynamicVehParamsCarWindows(STREAMER_TAG_VEHICLE vehicleid, &driver, &passenger, &backleft, &backright);
native SetDynamicVehicleToRespawn(STREAMER_TAG_VEHICLE vehicleid);
native LinkDynamicVehicleToInterior(STREAMER_TAG_VEHICLE vehicleid, interiorid);
native GetDynamicVehicleInterior(STREAMER_TAG_VEHICLE vehicleid);
native AddDynamicVehicleComponent(STREAMER_TAG_VEHICLE vehicleid, componentid);
native RemoveDynamicVehicleComponent(STREAMER_TAG_VEHICLE vehicleid, componentid);
native ChangeDynamicVehicleColor(STREAMER_TAG_VEHICLE vehicleid, color1, color2);
native GetDynamicVehicleColor(STREAMER_TAG_VEHICLE vehicleid, &color1, &color2);
native ChangeDynamicVehiclePaintjob(STREAMER_TAG_VEHICLE vehicleid, paintjobid);
native GetDynamicVehiclePaintjob(STREAMER_TAG_VEHICLE vehicleid);
native SetDynamicVehicleHealth(STREAMER_TAG_VEHICLE vehicleid, Float:health);
native GetDynamicVehicleHealth(STREAMER_TAG_VEHICLE vehicleid, &Float:health);
native AttachTrailerToDynamicVehicle(STREAMER_TAG_VEHICLE trailerid, STREAMER_TAG_VEHICLE vehicleid);
native DetachTrailerFromDynamicVeh(STREAMER_TAG_VEHICLE vehicleid);
native IsTrailerAttachedToDynamicVeh(STREAMER_TAG_VEHICLE vehicleid);
native GetDynamicVehicleTrailer(STREAMER_TAG_VEHICLE vehicleid);
native SetDynamicVehicleNumberPlate(STREAMER_TAG_VEHICLE vehicleid, plate[]);
native GetDynamicVehicleNumberPlate(STREAMER_TAG_VEHICLE vehicleid, plate[], size = sizeof(plate));
native GetDynamicVehicleModel(STREAMER_TAG_VEHICLE vehicleid);
native GetDynamicVehComponentInSlot(STREAMER_TAG_VEHICLE vehicleid, slot); // There is 1 slot for each CARMODTYPE_*
native RepairDynamicVehicle(STREAMER_TAG_VEHICLE vehicleid); // Repairs the damage model and resets the health
native GetDynamicVehicleVelocity(STREAMER_TAG_VEHICLE vehicleid, &Float:X, &Float:Y, &Float:Z);
native SetDynamicVehicleVelocity(STREAMER_TAG_VEHICLE vehicleid, Float:X, Float:Y, Float:Z);
native SetDynamicVehAngularVelocity(STREAMER_TAG_VEHICLE vehicleid, Float:X, Float:Y, Float:Z);
native GetDynamicVehicleDamageStatus(STREAMER_TAG_VEHICLE vehicleid, &panels, &doors, &lights, &tires);
native UpdateDynamicVehDamageStatus(STREAMER_TAG_VEHICLE vehicleid, panels, doors, lights, tires);
native SetDynamicVehicleVirtualWorld(STREAMER_TAG_VEHICLE vehicleid, worldid);
native GetDynamicVehicleVirtualWorld(STREAMER_TAG_VEHICLEvehicleid);
native GetPlayerSurfingDynamicVehID(playerid);
native PutPlayerInDynamicVehicle(playerid, STREAMER_TAG_VEHICLE vehicleid, seatid);
native GetPlayerDynamicVehicleID(playerid);
native IsPlayerInDynamicVehicle(playerid, STREAMER_TAG_VEHICLE vehicleid);
native IsPlayerInAnyDynamicVehicle(STREAMER_TAG_VEHICLE vehicleid);
native IsDynamicVehicleOccupied(STREAMER_TAG_VEHICLE vehicleid);
native PlayerSpectateDynamicVehicle(playerid, STREAMER_TAG_VEHICLE targetvehicleid, mode = 0);

forward OnDynamicVehicleSpawn(vehicleid);
forward OnDynamicVehicleDeath(vehicleid, killerid);
forward OnPlayerEnterDynamicVehicle(playerid, vehicleid, ispassenger);
forward OnPlayerExitDynamicVehicle(playerid, vehicleid);
forward OnDynamicVehicleMod(playerid, vehicleid, componentid);
forward OnDynamicVehiclePaintjob(playerid, vehicleid, paintjobid);
forward OnDynamicVehicleRespray(playerid, vehicleid, color1, color2);
forward OnDynamicVehDamageStatusUpdate(vehicleid, playerid);
forward OnUnoccupiedDynamicVehUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z);
forward OnDynamicVehicleStreamIn(vehicleid, forplayerid);
forward OnDynamicVehicleStreamOut(vehicleid, forplayerid);
forward OnDynamicTrailerUpdate(playerid, vehicleid);
forward OnDynamicVehSirenStateChange(playerid, vehicleid, newstate);

Note:
- This streamer doesn't support trains and might not in the near future.

Download:
Win & Linux: https://www.anonfiles.cc/file/c611eb...de48e8c4436c08
Source: https://github.com/kurta999/samp-streamer-plugin

Bugs:
- If you found any, please report it immendiately!

Last edited by kurta999; 09/07/2017 at 12:39 PM.
kurta999 is offline   Reply With Quote
Old 09/07/2015, 03:53 PM   #2
JaydenJason
Gangsta
 
JaydenJason's Avatar
 
Join Date: Oct 2014
Location: Netherlands
Posts: 723
Reputation: 51
Default Re: Streamer Plugin with Vehicle Streamer

Is the original streamer plugin integrated with this one? I don't quite understand.
JaydenJason is offline   Reply With Quote
Old 09/07/2015, 04:03 PM   #3
BroZeus
High-roller
 
BroZeus's Avatar
 
Join Date: Jan 2014
Location: India
Posts: 1,393
Reputation: 158
Default Re: Streamer Plugin with Vehicle Streamer

Quote:
Originally Posted by JaydenJason View Post
Is the original streamer plugin integrated with this one? I don't quite understand.
Yes it is, if you will look at source or inc file you can see that it has dynamic object, text lablel..etc functions too.
Nice work
Suggestion: You should add GetDynamicVehiclePoolSize() too because mostly people loops from 0 to MAX_VEHICLES.
__________________


"Be the change that you wish to see in the world."

Check out my Github profile!
BroZeus is offline   Reply With Quote
Old 09/07/2015, 04:18 PM   #4
kurta999
High-roller
 
kurta999's Avatar
 
Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 1,397
Reputation: 583
Default Re: Streamer Plugin with Vehicle Streamer

Quote:
Originally Posted by BroZeus View Post
Yes it is, if you will look at source or inc file you can see that it has dynamic object, text lablel..etc functions too.
Nice work
Suggestion: You should add GetDynamicVehiclePoolSize() too because mostly people loops from 0 to MAX_VEHICLES.
Maybe a deprecated function, but you can do this with all streamer items
Code:
Streamer_GetUpperBound(STREAMER_TYPE_VEHICLE)
kurta999 is offline   Reply With Quote
Old 09/07/2015, 08:04 PM   #5
Swedky
Banned
 
Join Date: Jun 2013
Location: Argentina.
Posts: 2,100
Reputation: 827
Default Respuesta: Streamer Plugin with Vehicle Streamer

Amazing!
Swedky is offline   Reply With Quote
Old 09/07/2015, 11:31 PM   #6
ExTaZZ69
Big Clucker
 
ExTaZZ69's Avatar
 
Join Date: Mar 2015
Location: Romania
Posts: 141
Reputation: 17
Default Re: Streamer Plugin with Vehicle Streamer

Kurta, the only difference between the samp vehicle streamer and your vehicle streamer is the modified respawn system?
ExTaZZ69 is offline   Reply With Quote
Old 09/07/2015, 11:37 PM   #7
kurta999
High-roller
 
kurta999's Avatar
 
Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 1,397
Reputation: 583
Default Re: Streamer Plugin with Vehicle Streamer

Quote:
Originally Posted by ExTaZZ69 View Post
Kurta, the only difference between the samp vehicle streamer and your vehicle streamer is the modified respawn system?
No. With samp vehicle streamer you can create only 2000 vehicles, with this unlimited*.

* 2000 at same time.
kurta999 is offline   Reply With Quote
Old 10/07/2015, 03:04 AM   #8
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,308
Reputation: 1164
Default Re: Streamer Plugin with Vehicle Streamer

I still think this is a wasted effort it's like trying to use the object pool to stream objects for players. The more players you have the less vehicles that can be streamed per player.

When someone with a large server actually tries to use this there is going to be all sorts of problems with vehicles not streaming when they should be. It's fine it works on your smaller server but that does no justice if this was actually to be used as intended on a large server.

Just picture a large amount of cars in one area and you can't get your car because it won't stream in because the server has 200 players all streaming.
Pottus is offline   Reply With Quote
Old 10/07/2015, 04:29 AM   #9
Calgon
Godfather
 
Calgon's Avatar
 
Join Date: Jan 2009
Posts: 6,424
Reputation: 1060
Default Re: Streamer Plugin with Vehicle Streamer

Quote:
Originally Posted by Pottus View Post
I still think this is a wasted effort it's like trying to use the object pool to stream objects for players. The more players you have the less vehicles that can be streamed per player.

When someone with a large server actually tries to use this there is going to be all sorts of problems with vehicles not streaming when they should be. It's fine it works on your smaller server but that does no justice if this was actually to be used as intended on a large server.

Just picture a large amount of cars in one area and you can't get your car because it won't stream in because the server has 200 players all streaming.
Agreed with this, for some reason I've always had problems in SA-MP with vehicle IDs swapping (so you lose track of the vehicle but it still exists, or doesn't, etc) which I've known many others to have problems with also, this streamer would not only make that worse but also the idea itself is just generally not the best for SA-MP.
__________________
Calgon is offline   Reply With Quote
Old 11/07/2015, 04:52 PM   #10
kurta999
High-roller
 
kurta999's Avatar
 
Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 1,397
Reputation: 583
Default Re: Streamer Plugin with Vehicle Streamer

Quote:
Originally Posted by Pottus View Post
I still think this is a wasted effort it's like trying to use the object pool to stream objects for players. The more players you have the less vehicles that can be streamed per player.

When someone with a large server actually tries to use this there is going to be all sorts of problems with vehicles not streaming when they should be. It's fine it works on your smaller server but that does no justice if this was actually to be used as intended on a large server.

Just picture a large amount of cars in one area and you can't get your car because it won't stream in because the server has 200 players all streaming.
Yes, that's true. But I don't have that much amount of players and lof of servers doesn't - anyway same will happens with pickups, from your view pickup streamer is useless too?

In back of samp, till no per-player textdraws, servers with 400-500 just can use normal speedometer, and 1-2 textdraws for players because textdraw pool is 2048 AFAIK.

Fallout speedometer 3 TD per player in server with 500 slots, 1500 TD. One free slot remain free for per-player usage. But servers like mine and others too, it wasn't problem because I has only 60 slot server. Same with vehicle streamer, I made it because I want to get maximum from samp. Which server playerbase is around 100, it's a big help for them if want to use lot vehicles. (Please don't say that it will lagg, because it's not if you not place 100 vehicles at same location. You can create your own island outside of SA, create jumps in air and you can use vehicles in different worlds too)
kurta999 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
Streamer Plugin: CreateDynamicObject: Expecting 12 parameter(s) but found 11 With latest streamer plugin/include Bashur Scripting Help 16 16/03/2015 08:28 PM
Incognitos Streamer plugin: When player exits the vehicle; objects load? denNorske Scripting Help 3 23/09/2014 12:24 AM
[Plugin] Streamer Plugin v2.7.2 with vehicle streamer Swimor Plugin Development 86 11/08/2014 01:59 PM
[Include] Checkpoint / Area sub-streamer for incognito's streamer plugin Pottus Includes 11 21/03/2014 07:31 PM
Need 3dtextlabel Streamer And Gangzone Streamer !! Please Help . Not streamer plugin . jame42 Scripting Help 4 30/05/2012 08:33 AM


All times are GMT. The time now is 09:26 AM.


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