Only a simple suggestion, i was wondering if it's possible made the list when you want to restore a random vehicle in an alphabetic order, because sometimes there is the need to restore only 1 car and not all with /restoreall, so it's nice to see the list in order so you can find the vehicle easier and faster.
(http://img535.imageshack.us/img535/2497/samp744r.png) (http://imageshack.us/photo/my-images/535/samp744r.png/)
not logic order
I think you can /rm "carname"
this list really should be with alphabetic order :)
Wow, I saw only in this pictrues 4 Club cars, gz man
Nice suggestion, +1 for it
1
The list in /phone->services->car insurance can be in alphabetic order as well.
Nope.
Ordering array alphabetically it a lot of work for me and the server each time the list is displayed.
Quote from: mick88 on June 01, 2012, 14:12
Nope.
Ordering array alphabetically it a lot of work for me and the server each time the list is displayed.
At least by IDs or something, not randomly :o
Quote from: $nake on June 01, 2012, 23:51
Quote from: mick88 on June 01, 2012, 14:12
Nope.
Ordering array alphabetically it a lot of work for me and the server each time the list is displayed.
At least by IDs or something, not randomly :o
my guess is they are ordered by ID, at least when the server starts, but as you restore cars, and they get different IDs, they get randomized, and again, its a lot of work on the server to reorder an array.
Quote from: Storm94 on June 02, 2012, 00:31
Quote from: $nake on June 01, 2012, 23:51
Quote from: mick88 on June 01, 2012, 14:12
Nope.
Ordering array alphabetically it a lot of work for me and the server each time the list is displayed.
At least by IDs or something, not randomly :o
my guess is they are ordered by ID, at least when the server starts, but as you restore cars, and they get different IDs, they get randomized, and again, its a lot of work on the server to reorder an array.
I meant by player ID of vehicles, like 1-75 for me :)
Basically what mick said is, it would take ages to code, and then the server might lag everytime someone went into a list, as it tried to arrange it to look nice for you.
It's a waste of time for mick, and resources for the server to do this.
and i think the array size used for vehicle player is large, because I see $nake got like 60-70 vehicles still he can buy more, and i saw a 30 slot house as well, 30X4=120, but i am not aware of samp scripting, I don't know about it, nor the server's script, or size or size of array, i am just imagining,
and yeah,
sorting them alphabetically = it will take so many loops depending on similarity of car names (like same names such as Roadtrain and Roadtrain) and array size (because it will compare just 2 letters of two words/cars in a single loop)
I think the worst case complexity can turn out to be O(n
3) , even more, this really too much loops just for a simple command like /mycars.
So yeah its too much work for the server as it already has enough of processes going on.
So I agree with mick.
Quote from: $nake on June 02, 2012, 08:55
Quote from: Storm94 on June 02, 2012, 00:31
Quote from: $nake on June 01, 2012, 23:51
Quote from: mick88 on June 01, 2012, 14:12
Nope.
Ordering array alphabetically it a lot of work for me and the server each time the list is displayed.
At least by IDs or something, not randomly :o
my guess is they are ordered by ID, at least when the server starts, but as you restore cars, and they get different IDs, they get randomized, and again, its a lot of work on the server to reorder an array.
I meant by player ID of vehicles, like 1-75 for me :)
I think the IDs are given automatically when you buy the vehicle (it gets added as an element to next free array element). Its according to those ids (it will be according to when you bought them).
What you mean by player ids?
Quote from: Deff on June 02, 2012, 17:04
and i think the array size used for vehicle player is large, because I see $nake got like 60-70 vehicles still he can buy more, and i saw a 30 slot house as well, 30X4=120, but i am not aware of samp scripting, I don't know about it, nor the server's script, or size or size of array, i am just imagining,
and yeah,
sorting them alphabetically = it will take so many loops depending on similarity of car names (like same names such as Roadtrain and Roadtrain) and array size (because it will compare just 2 letters of two words/cars in a single loop)
I think the worst case complexity can turn out to be O(n3) , even more, this really too much loops just for a simple command like /mycars.
So yeah its too much work for the server as it already has enough of processes going on.
So I agree with mick.
Actually, I think the complexity will be O(n^2), because even though vehicle names would need additional loop, don't depend on the problem size (number of vehicles). But nice to see someone with basics of algorithms here.
Easy solution. Sell 90% of those and only keep the 6 that you actually use. Problem solved and parking freed up.
Quote from: ThomasKirkman on June 02, 2012, 22:54
Easy solution. Sell 90% of those and only keep the 6 that you actually use. Problem solved and parking freed up.
This, I think, Is the best solution.