SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Reply
 
Thread Tools Display Modes
Old 20/06/2012, 02:37 PM   #41
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 17,503
Reputation: 2435
Default Re: How To Write The Best Streamer - Or, Streamer Discussion

I'd say the best existing one is the streamer plugin, but I don't know what sort of algorithms are used internally. This was a discussion about them, not about any specific implementation.
Y_Less is offline   Reply With Quote
Old 20/06/2012, 03:09 PM   #42
Coicatak
Huge Clucker
 
Join Date: Nov 2008
Posts: 354
Reputation: 0
Default Re: How To Write The Best Streamer - Or, Streamer Discussion

Is it ok to hook functions like this? (I'm asking because I can't test it atm)
Code:
#define SetPlayerPos(%0,%1,%2,%3) SafeSetPlayerPos(%0,%1,%2,%3)

stock SafeSetPlayerPos(id, Float:x, Float:y, Float:z)
{
    #undef SetPlayerPos
    SetPlayerPos(id, x, y, z);
    SafeTP[id] = true; // or any other code you want to call with SetPlayerPos
}
Coicatak is offline   Reply With Quote
Old 20/06/2012, 03:09 PM   #43
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 17,503
Reputation: 2435
Default Re: How To Write The Best Streamer - Or, Streamer Discussion

Sort of - do the define AFTER the function and look up ALS to avoid conflicts with other libraries.
Y_Less is offline   Reply With Quote
Old 20/06/2012, 03:13 PM   #44
Coicatak
Huge Clucker
 
Join Date: Nov 2008
Posts: 354
Reputation: 0
Default Re: How To Write The Best Streamer - Or, Streamer Discussion

Oops, I posted on the wrong thread. But nevermind, so is this ok?
But why should the define be after the function? I use undef so that it doesn't create problem. If I put it after i have to remove the #undef.
Btw I don't know what ALS is (haven't been on SAMP for 2 years)
Coicatak is offline   Reply With Quote
Old 20/06/2012, 03:13 PM   #45
MadeMan
High-roller
 
MadeMan's Avatar
 
Join Date: Jun 2007
Posts: 3,472
Reputation: 231
Default Re: How To Write The Best Streamer - Or, Streamer Discussion

Quote:
Originally Posted by Coicatak View Post
So, what is the best streamer to use right now?

And is it really useful to use streamers for 3DText, pickups and all? I think only object streamers are useful because it allows the server to create more objects than SAMP allows it.
The main reason for using a streamer is if you want to add more than the SA-MP limits allow (http://wiki.sa-mp.com/wiki/Limits). So if you don't need more, there is no need for a streamer.
MadeMan is offline   Reply With Quote
Old 07/01/2014, 07:07 PM   #46
ikey07
High-roller
 
ikey07's Avatar
 
Join Date: Jul 2010
Location: Latvia,Riga
Posts: 1,086
Reputation: 127
Default Some theory for samp vehicle streamer

So, last night I though about one thing, about "If none sees it, its not needed."

Let me explain, I talk about some kind of vehicle streamer, which destory vehicles on the server if none of the player sees them aka when they streams out and there is no player who sees it, and create it again once one of the players gets closer to it.

I haven't made any script yet, as I can't think if there isn't any things which could ruin my idea.

In basic there should be a counter at OnVehicleStreamIn/Out which count for how many players this car is streamed in, and if count gets to 0, vehicle gets destroyed, but before it gets Pos/Rot/Color/Damage/Lights/Engine/VW/Int etc, and there should need some Timer which detects if any of the players is in range of vehicle pos, int and right vw, and it would create it again.


So, could this actually work ?


Because I believe many who have used some car mods in SAMP, will notice that some car parts/tuning parts gets darker, if you are on the server with alot of different car models, and just as I said, if none sees those cars, they are not needed on the server, so you could also make a loops with less cars, by looping only for cars which are streamed in for some of the players.
__________________


Vehicle mods for SAMP



Truly DDoS protected VPS solutions, use EKA5%OFF code and get 5% life time off on any VPS!
ikey07 is online now   Reply With Quote
Old 07/01/2014, 07:11 PM   #47
1FreeHost
Big Clucker
 
1FreeHost's Avatar
 
Join Date: Jan 2014
Location: -EARTH-VI
Posts: 160
Reputation: 18
Default Re: Some theory for samp vehicle streamer

I don't know anything about this i am just commenting to say its a good idea thats all.
__________________

Ever Wanted To Play In A Different Kind Of PVT Server Join Us!
Click Here To Open Server
FMGS is a fresh type of PVT(Police .VS. Terrorists) gamemode, with great custom objects modifications and additions.
For more info click me
1FreeHost is offline   Reply With Quote
Old 07/01/2014, 07:32 PM   #48
maddinat0r
Gangsta
 
Join Date: Jun 2010
Location: good ol' bavaria
Posts: 592
Reputation: 200
Default Re: Some theory for samp vehicle streamer

I'm actually (very) slowly are planning on creating such a streamer that streams things only when a player can see it. The streamer will be a plugin that relies on multi-threading. It will poll data (player facing angle, camera mode, maybe camera facing vector) in the main thread (PAWN thread) and forward it to some worker threads, which will process that data and determine, which objects (not limited to vehicles, I am also planning on doing the same for pickups, normal objects, etc) should be created. This is not the final concept, just like I said, I'm currently in the planning stage.

We can gather more informations/critics/problems/solutions about such a streamer here and discuss it, maybe there are more good/important things to implement.
maddinat0r is offline   Reply With Quote
Old 07/01/2014, 07:42 PM   #49
ikey07
High-roller
 
ikey07's Avatar
 
Join Date: Jul 2010
Location: Latvia,Riga
Posts: 1,086
Reputation: 127
Default Re: Some theory for samp vehicle streamer

So far I have found only 2 issues, there is no GetVehicleColor and GetVehicleInterior as native functions.
__________________


Vehicle mods for SAMP



Truly DDoS protected VPS solutions, use EKA5%OFF code and get 5% life time off on any VPS!
ikey07 is online now   Reply With Quote
Old 07/01/2014, 07:43 PM   #50
dusk
Gangsta
 
dusk's Avatar
 
Join Date: Jul 2008
Posts: 732
Reputation: 10
Default Re: Some theory for samp vehicle streamer

I believe it would work. But it should be harder(my opinion) than just "destroying vehicles when nobody sees them", I mean when you re-create them you will have to add components, change colours/paintjobs.

maddinat0r, for some reason I love that you try to make everything on a separate thread.

What's great about this idea is that some cheaters tend to teleport all unused vehicles to one location and by doing that crash nearby clients..With it it should make this much much harder.

to sum up: go for it.


EDIT: I believe there's a non-native GetVehicleColour
__________________

I always want to learn!
If I ask for help, i'm interested in WHAT did I do wrong, not only how to fix it.
dusk 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
[Include] [INC] TSS - tAxI's Streamer Systems: full Streamer + HOUSING SYSTEM Utillity cptnsausage Includes 101 24/08/2012 12:05 AM
Need 3dtextlabel Streamer And Gangzone Streamer !! Please Help . Not streamer plugin . jame42 Scripting Help 4 30/05/2012 07:33 AM
[Include] [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! Yaheli_Faro Includes 46 20/04/2010 02:53 PM
Dominator's Object Streamer - a wize and new streamer - invisible objects fix tsha Filterscripts 23 19/09/2009 08:37 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 06:49 PM.


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