SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 13/06/2018, 02:13 PM   #11
Freshncool
High-roller
 
Freshncool's Avatar
 
Join Date: Aug 2014
Location: Kingdom of Pakistan Reputation: 9999
Posts: 1,222
Reputation: 348
Default Re: SDV ( Semi Dynamic Vehicle ) Plugin

what the fuck
__________________
🍔🍔🍔🍔🍔🍔🍔🍔🍔🍔🍔🍔
Freshncool is online now   Reply With Quote
Old 13/06/2018, 02:24 PM   #12
DeitY
Huge Clucker
 
DeitY's Avatar
 
Join Date: Aug 2012
Location: Serbia
Posts: 323
Reputation: 14
Default Re: SDV ( Semi Dynamic Vehicle ) Plugin

I have around 900 players online, and struggle with 2000 limit of vehicles.

So, i have made option to destroy vehicle upon disconnect, and create when player logs in.

Its basically same or there are some better features?
__________________
Serbian RolePlay Server! 5+ Years SAMP server, 3+ years highest number of players in balcan!

DeitY is offline   Reply With Quote
Old 13/06/2018, 02:26 PM   #13
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,943
Reputation: 1468
Default Re: SDV ( Semi Dynamic Vehicle ) Plugin

> semi dynamic
> semi stable
i guess that makes you... semi pro
[HLF]Southclaw is online now   Reply With Quote
Old 13/06/2018, 02:41 PM   #14
jlalt
High-roller
 
Join Date: Oct 2014
Location: Iran
Posts: 1,445
Reputation: 366
Default Re: SDV ( Semi Dynamic Vehicle ) Plugin

Quote:
Originally Posted by DeitY View Post
I have around 900 players online, and struggle with 2000 limit of vehicles.

So, i have made option to destroy vehicle upon disconnect, and create when player logs in.

Its basically same or there are some better features?
lets assume that server has 2000 vehicles created(streamed), and you have 2,000 more cars pending to be streamed.

X = It first goes in a loop checks if any player is in the pending vehicle stream range, if yes, it find THE NEAREST player distance to this vehicle.

Y[2000] = it goes in a loop checks the nearest player to every single car of those 2,000 created vehicles.

So now we have nearest player distance to created vehicles Y[j] and nearest player to should be created vehicle X

we go in a loop again and get the FARTHEST nearest player to created vehicle. ( comparing Y values to get the highest value )

if farthest "nearest" player is farther than X distance vehicle N will be destroyed and vehicle M which X distance belong to it will be created.

[ the above words describe the way GetFarestCarID function works )
Quote:
Originally Posted by [HLF]Southclaw View Post
> semi dynamic
> semi stable
i guess that makes you... semi pro
Correct I guess d: , by the way because the system uses the above method, rather than unstream when player is far it only unstream when its necessary I called it "semi dynamic"

Last edited by jlalt; 13/06/2018 at 06:13 PM.
jlalt is online now   Reply With Quote
Old 13/06/2018, 02:44 PM   #15
DeitY
Huge Clucker
 
DeitY's Avatar
 
Join Date: Aug 2012
Location: Serbia
Posts: 323
Reputation: 14
Default Re: SDV ( Semi Dynamic Vehicle ) Plugin

Quote:
Originally Posted by jlalt View Post
lets assume that server hes 2000 vehicles created(streamed), and you have 2,000 more cars pending to be streamed.

X = It first goes in a loop checks if any player is in the pending vehicle stream range, if yes, it find THE NEAREST player distance to this vehicle.

Y[2000] = it goes in a loop checks the nearest player to every single car of those 2,000 created vehicles.

So now we have nearest player distance to created vehicles Y[j] and nearest player to should be created vehicle X

we go in a loop again and get the FARTHEST nearest player to created vehicle. ( comparing Y values to get the highest value )

if farthest "nearest" player is farther than X distance vehicle N will be destroyed and vehicle M which X distance belong to it will be created.

Correct I guess d: , by the way because the system uses the above method rather than unstream when player is far it only unstream when its necessary I called it "semi dynamic"

u are fucking god of samp, i'll try this with my server, and check how's it working.i'm sure it will be some new lags and timers, but its definitely worth it
__________________
Serbian RolePlay Server! 5+ Years SAMP server, 3+ years highest number of players in balcan!

DeitY is offline   Reply With Quote
Old 13/06/2018, 02:47 PM   #16
jlalt
High-roller
 
Join Date: Oct 2014
Location: Iran
Posts: 1,445
Reputation: 366
Default Re: SDV ( Semi Dynamic Vehicle ) Plugin

Quote:
Originally Posted by DeitY View Post
u are fucking god of samp, i'll try this with my server, and check how's it working.i'm sure it will be some new lags and timers, but its definitely worth it
Actually you're right like it was taking 600 ms to execute when there's 500 players and 4 thousand vehicles ( I put fake data to do benchmark ) that's why I've made the checks on separate thread.

[ if you check CheckTheCars function you will see a separate thread being ran to check the should be streamed and to be removed vehicles ]
jlalt is online now   Reply With Quote
Old 13/06/2018, 07:33 PM   #17
KoloradO
Big Clucker
 
KoloradO's Avatar
 
Join Date: Mar 2016
Posts: 180
Reputation: 13
Default Re: SDV ( Semi Dynamic Vehicle ) Plugin

Would it be possible for a function to disable the radar / gps vehicle?
Example:

Code:
DisableDynamicVehicleRadar();
__________________
Scavenge And Survive - Apocalypse

IP: 167.114.201.72:7777

~ Best survive server sa-mp

~ WhatsApp: 053 8135-9966
KoloradO is offline   Reply With Quote
Old 13/06/2018, 08:04 PM   #18
jlalt
High-roller
 
Join Date: Oct 2014
Location: Iran
Posts: 1,445
Reputation: 366
Default Re: SDV ( Semi Dynamic Vehicle ) Plugin

Quote:
Originally Posted by KoloradO View Post
Would it be possible for a function to disable the radar / gps vehicle?
Example:

Code:
DisableDynamicVehicleRadar();
What you mean by gps? :0
jlalt is online now   Reply With Quote
Old 13/06/2018, 08:08 PM   #19
LennyH
Little Clucker
 
LennyH's Avatar
 
Join Date: Feb 2016
Posts: 46
Reputation: 68
Default Re: SDV ( Semi Dynamic Vehicle ) Plugin

What exactly the native AttachPlayerObjectToVehicle is going to be doing?
Is it something that lets you attach a player to a vehicle? If not, I really suggest it, could be very interesting having a native like AttachPlayerToVehicle to place players on side of helicopters, in trunks, on in the back of a pickup truck, with an option to apply an animation.
__________________
San Andreas + Vice City + Liberty City
More than 2600 new skins from GTA III, GTA VC, GTA LCS, GTA VCS, Bully, Manhunt, Manhunt 2
More than 300 new weapons (Custom damage, sound and animation)
More than 250 new vehicles (Custom handling and sound)
LennyH is offline   Reply With Quote
Old 13/06/2018, 08:09 PM   #20
DTV
Gangsta
 
DTV's Avatar
 
Join Date: Dec 2010
Posts: 507
Reputation: 95
Default Re: SDV ( Semi Dynamic Vehicle ) Plugin

Quote:
Originally Posted by jlalt View Post
What you mean by gps? :0
I think he means the grey blips on the map that show where a vehicle is on the minimap.
__________________




Bringing the nuclear post apocalyptic setting to SA-MP, click the banners to view the forum or Discord server.
DTV 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
[FilterScript] [E.V.O] Elite Vehicle Ownership [V1.0] [Dynamic Vehicle System] DarkSkull Filterscripts 10 20/05/2018 06:02 PM
Dynamic Vehicle morocco Scripting Help 1 20/07/2013 08:47 PM
Dynamic Vehicle morocco Scripting Help 0 19/07/2013 07:03 AM
Dynamic Vehicle Tanush123 Scripting Help 4 07/07/2013 11:54 PM


All times are GMT. The time now is 01:36 PM.


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