News:

Server address: server.convoytrucking.net
Get SA-MP 0.3.7 here: Click Here to download SA-MP 0.3.7

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Joshy

#16
The used vehicle trading system was meant to be used as a dealership and not as a direct way to trade vehicles between players, and the dealerships only have a limited amount of space on their lot for the vehicles. Under the assumption that the trading lots would be mostly full, expensive vehicles (i.e. more expensive than "New" price) don't sell that well and will end up wasting space on the lot.

At some point during the development of the dealerships, the maximum price cap did in fact go up with the odometer, however it was removed before the Dev Team tested it.
Quote from: Joshy on January 31, 2015, 22:30
Notes relating to previous test:
  • maximum price no longer scales with odometer, while I liked the fact higher odo vehicles were more rare and so more expensive, I also think there isn't enough demand for this. Maybe in the future this will be re-implemented.

Considering the lots are empty these days the price cap may as well be removed - however when trading vehicles (or removing it from the dealership) you will lose some of the cash due to trading fees (I think it was 3%), so if you trade an RT for $2m you will lose $60k. Maybe this fee should be derived from the new price of the vehicle or become a fixed fee.

Ideally a direct trading system would be made alongside the trading lots instead of removing the max price, and then make evicted players' vehicles automatically sell in the dealerships (which would fill them up).
#17
4020
#18
Forum games / Re: last post wins
April 10, 2017, 21:28
After I have posted this, I will be winning.

edit: am winning
#19
Suggestions / Re: Block user
February 14, 2017, 20:00
Quote from: TheSandman on February 14, 2017, 09:36
This has come up before, besides being a good idea, there is a performance factor in this. Everytime someone sends a message, the server has to decide who not to send that message to, (eg you have blocked starfish).
Performance really isn't a concern for an upper bound of 100 players...
#20
The source code is available at https://github.com/xdjoshuaaz/CTSignatureGenerator if anyone wants to improve it.

The generator was put together really quickly so if it doesn't work, it probably doesn't like a symbol in your name or something.

It seems to work in IE11, Firefox, and Chrome, but I have no idea about other browsers.
#21
Off Topic / Re: Wishes for Christmas?
December 21, 2016, 13:34
Quote from: StarFish on December 21, 2016, 10:32
A lot of weed and an ice bong for 60 euros but this all will come in January when I get my salary. Cherry Mristmas to all!  :winkcmas: O:-) <3
You're going to need a plentiful supply of food ;)

Hopefully after Christmas I can get a new graphics card for a little bit less (or wait until AMD release their stuff)
#22
Suggestions / Re: Trading Aircraft?
December 18, 2016, 11:18
Quote from: CarlJohnson on December 18, 2016, 04:32
Quote from: Joshy on December 17, 2016, 12:59
Quote from: CarlJohnson on December 17, 2016, 06:19
This is fairly elaborated post of how things will work.

Players will be able to put their air type vehicles like Maverick, Shamal, etc on sale by going to the Abandoned Airport or the Verdant Meadows (as of now I've planned it to be done here). The maximum price and the minimum price of plane would be determined by system which does it for cars as of now.

After putting the vehicle on sale the vehicle will be parked beside the airstrip so the helicopter missions aren't intervened, the buyer could enter the plane, see its details like Odo, fuel, insurance and decide to buy it or not.
If the vehicle isn't sold for a long duration of time, the vehicle will be removed from the forsale list and will go back to the owner, in the meantime owner can also take back the vehicle if he wants to but it will cost him some price (the same way it works for car trading now), also the oldest vehicle on the list will be removed if the capacity of the airport/trade location is being fully utilized.

So your point here Ethan that the airports will be overthrown with planes and helicopters is invalid because there will be a limit to the amount of vehicle which can be put up on the sale, say 10 vehicles can be put up on the forsale list, once the 11th vehicle is put up on sale by player the 1st vehicle or the oldest one on the list by date gets removed and goes back to owner.

Any more questions?
FYI to make a new trading lot, you basically need to define these things somewhere:

  • where should the map icon be, and which icon to use
  • where should the pickup marker be, and which pickup to use
  • where should the 3d text label be, and what should it say
  • define a dynamic area where vehicles will remain in (sphere, cube, polygon) (when vehicles are removed from this area they respawn)
  • declare which vehicle types they can and cannot sell
  • make a spawning function for your trading lot - basically the current system uses SA-MP's vehicle model info to retrieve vehicle sizes and park them properly. Using this you can also test how many vehicles the trading lot can hold (newest to oldest), and any vehicles that are unable to fit on the trading lot will be untraded automatically

At the time my code quality wasn't great so you'll end up copying and pasting stuff everywhere, but it'll work.
Yes, I noticed, I might redo the code if I get time otherwise copy pasting would work fine. I might also allow players to trade club vehicles.

Also, don't I need to add the dealer in DB?
Nah, it's all hardcoded =)))
#23
Suggestions / Re: Trading Aircraft?
December 17, 2016, 12:59
Quote from: CarlJohnson on December 17, 2016, 06:19
This is fairly elaborated post of how things will work.

Players will be able to put their air type vehicles like Maverick, Shamal, etc on sale by going to the Abandoned Airport or the Verdant Meadows (as of now I've planned it to be done here). The maximum price and the minimum price of plane would be determined by system which does it for cars as of now.

After putting the vehicle on sale the vehicle will be parked beside the airstrip so the helicopter missions aren't intervened, the buyer could enter the plane, see its details like Odo, fuel, insurance and decide to buy it or not.
If the vehicle isn't sold for a long duration of time, the vehicle will be removed from the forsale list and will go back to the owner, in the meantime owner can also take back the vehicle if he wants to but it will cost him some price (the same way it works for car trading now), also the oldest vehicle on the list will be removed if the capacity of the airport/trade location is being fully utilized.

So your point here Ethan that the airports will be overthrown with planes and helicopters is invalid because there will be a limit to the amount of vehicle which can be put up on the sale, say 10 vehicles can be put up on the forsale list, once the 11th vehicle is put up on sale by player the 1st vehicle or the oldest one on the list by date gets removed and goes back to owner.

Any more questions?
FYI to make a new trading lot, you basically need to define these things somewhere:

  • where should the map icon be, and which icon to use
  • where should the pickup marker be, and which pickup to use
  • where should the 3d text label be, and what should it say
  • define a dynamic area where vehicles will remain in (sphere, cube, polygon) (when vehicles are removed from this area they respawn)
  • declare which vehicle types they can and cannot sell
  • make a spawning function for your trading lot - basically the current system uses SA-MP's vehicle model info to retrieve vehicle sizes and park them properly. Using this you can also test how many vehicles the trading lot can hold (newest to oldest), and any vehicles that are unable to fit on the trading lot will be untraded automatically

At the time my code quality wasn't great so you'll end up copying and pasting stuff everywhere, but it'll work.
#24
Off Topic / Re: Random Picture
December 15, 2016, 18:13
Quote from: TheFoxman on December 14, 2016, 23:05
How can u be that bored to post shiat like this :D
For those who code, tinkering with other people's websites / code can be quite fun since you might learn something, you could find a security vulnerability or an easter egg, and generally it's a good thing to ask yourself "how do other people do stuff"

Plus bored people tend to do anything to stimulate them.
#25
Off Topic / Re: Random Picture
December 14, 2016, 18:34
https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en

You could probably paste a Bootstrap theme into this extension and style the website however you want.
#26
Help / Re: H3lp
December 09, 2016, 19:36
Quote from: Deff on December 09, 2016, 06:23
Quote from: Ethan on December 09, 2016, 01:29
yeah, for some odd reason my profile picture I chose changed to some random thing.. I had to change it... maybe becasue of Viky updated it?

Oh its public, anyone can make signature for anyone. But I have disabled it now. Those who have already made, it will work for them, no one can make/edit signatures now, this can't be authenticated as of now, hence disabled.
That's quite unfortunate, it was good to see the API being used by someone other than Mick (CT Android app).

You should suggest API authentication (OAuth2 or something), Django REST framework probably has it built in.

As a short term workaround you could send people unique URLs that only work for their profile via PM, that way in order to make a signature they'll have to PM you and then you make them a URL / token for their account. Idk if it's worth the effort though.


edit: here's how I would do this in PHP (it's been a while since I wrote any PHP, C# ftw) (also this is totally untested) (it's probably not bulletproof and/or cryptographically secure but who cares lol ¯\_(ツ)_/¯):

const SECRET_KEY "some secret constant string here";

function 
generate_token($username) {
   return 
hash_hmac("sha256"$usernameSECRET_KEY);
}

// function which is able to verify a MAC for a given username
function verify_token($username$token) {
    
// basically you re-create the MAC for a given username and then verify it against the passed in MAC
    
return hash_equals(generate_mac($username), $token); // interesting fact: hash_equals isn't susceptible to timing attacks, however "==" is
}

// to verify a URL
$username = isset($_GET["username"]) ? $_GET["username"] : NULL;
$token = isset($_GET["token"]) ? $_GET["token"] : NULL;

if (empty(
$username) || empty($token)) {
    echo 
"kek nice try...";
    return;
}

$isActuallyTheUser verify_token($username$token);

if (
$isActuallyTheUser) {
    
// Do signature stuff
} else {
    
// Firewall the user's IP address into oblivion
}

////////////////

// for giving out URLs (put this behind a password or something)
const BASE_URI "http://cvt.is-great.net/signature/";
// URL generation
function generate_url_with_token($username) {
    
$token generate_token($username);
    return 
BASE_URI "?" http_build_query(array("username" => $username"token" => $token));
}

$username = isset($_GET["username"]) ? $_GET["username"] : NULL;
if (empty(
$username)) {
    echo 
"Good joke viky... srsly";
    return;
}
echo 
generate_url_with_token($username);


The result I got with that "secret" key and my username is http://cvt.is-great.net/signature/?username=Joshy&token=44939cf6f335a44a6a7acdc09566691d7c5f7bec3c1b321f13dc6f9e64d80ea2

You can use the code at https://repl.it/EmJm/3 to test your environment to make sure it works properly (some web hosting disable hash_hmac for "security" - klol).
#27
Help / Re: H3lp
December 06, 2016, 18:30
Quote from: Kakeshi on December 06, 2016, 15:25
Quote from: Deff on December 04, 2016, 21:59
or you can try this:
http://cvt.is-great.net/signature/

Just made a quick script when I saw this thread.

@viky I think the achievements data is bugged. It is showing that i have 6 achievemnts(I have only 4) and ethan is having 57/17 :D
@viky player.achievements is an integer field containing a bitwise representation of achievement states.

I know (1 << 0) is artic (1)
And that (1 << 1) is probably dumper (2)

You can check an achievements status by bitwise-ANDing the field against the achievement number, e.g. how to check if i have dumper achievement is:
var hasDumper = player.achievements & (1 << 1) == (1 << 1)
You can count the number of set bits (I.e. number of achievements) by either iterating through all bits and adding them up, or use an algorithm called popcount/Hamming weight. This is the iterative approach:

var achCount = 0;
for (var achIndex = 0; achIndex < 18 /*There are 17 achs*/; achIndex++) {
    if (player.achievements & (1 << achIndex) == (1 << achIndex)) {
        achCount++;
    }
}


Idk what the achievement numbers are but if all you're after is the count, the above code should do.
#28
Galaxy S7, Nougat 7.0 (beta) using Nova Launcher - I took the wallpaper myself and cranked the contrast up, it works pretty well on an AMOLED screen (especially in the dark). Icons from Pixel Icon Pack, the top and middle rows of icons have swipe actions (left-to-right order: Gmail, Android Wear, Battery Stats, Authy, Snapchat, Instagram).


Windows 10, background is the album art of Space Cadet by Nigel Good (it's the same thing on second monitor)
#29
General Talk / Re: Prices
November 06, 2016, 11:17
Quote from: DeadWalker on November 05, 2016, 19:41
List for all the material prices per km

        Material                Price per kilometer       
        Steel Sheets & gypsum                1620$       
tr]
        Food                1820$       
        Supplies                1760$       
        Machines                2060$       
        Explosives                2060$       
        Glass                2180$       
Interesting, but sadly not correct.
#30
Quote from: Vinny on November 04, 2016, 05:29


Over the past few days my phones been drastically losing battery over night, going from around 95 to 70% in around 6 hours, by simply being idle with deactivated mobile data and with power saving mode activated. The screenshot above shows that Android system and Android os are responsible for over 30% of the battery loss each. Has anyone had the same problem and found a potential fix for it ?
Android system and OS are usually within the top 3 on my S7 as well, something has to use battery after all.

95 to 70% over 6 hours implies it's not going into doze and there is a wakelock somewhere. Download Wakelock Detector Lite (you'll need a PC for it to work since it uses ADB for battery stats)

Also in Developer Options in Settings (if you don't see it, go to About phone, then Software info, then tap the Build numbers 7 times), enable "Show CPU usage" (this is more useful if your phone is noticeably warm when it's off) and have a look in "Running services" for any potential things in the background.

If you install Greenify you can enable Aggressive Doze and have a notification appear when your phone goes into Doze mode.

If you have Oculus Gear VR stuff installed, try disabling it for a bit just to make sure it's not that. You can disable pretty much most of the bloatware using Package Disabler Pro (Samsung specific method of disabling apps, using Knox)

Check out reddit.com/r/galaxys7 for more info

Off topic: my phone went from 100% to 30% in 5 hours (1 hour screen on time) because of Google Play Services a few days ago :/ makes app development hard since my PC's USB can't push enough power to not discharge the battery