[Include] vDealer, probally the most simple vehicledealer system (Supports Y_INI & MYSQL!) Make your own vehicleshops in 1 line!
#1

vDealer 1.1
What is it ?
vDealer is an include that allows you VERY EASILY to create vehicledealers anywhere you like.
It has the following features:

*Userfriendly dialogged gui!
*Very easy system (you can create a store with just 1 command!)
*You can add the vehicles per shop yourself!
*A pickup, mapicon and 3DTextLabel will be created
*The labels & pickup will be streamed with the build-in streamer
*System supports Y_INI for fast filewriting, AND MYSQL in case you preffer to use a database
*All bought vehicles are private for the owner only
*The player can use /park to save his vehicle position
*The player can use /sellvehicle to sell the vehicle for 20% of his original price (Can be adjusted in the defines)
*A LOT of extra options/features in the defines


Rewards


Changelog
Код:
V1.1:
- Bug fixed with dialogspam (thanks to [KO]KillerThriller for reporting)
- You can now define the pickupmodel if you want to change it
- System can now also use checkpoints instead of pickups
- OnGameModeInit bug fixed (i failed, lol)
- System is now using Incognito's streamer
- Multiple other bugs are fixed
Screenshots
I took these on my old crappy pc, so sorry for the quality
This is an exampleshop at Wang's cars:



This is how the dialogs looks like:


Functions
Код:
	native CreateVehicleDealer(dealername[],Float:x,Float:y,Float:z) // returns dealerid
	native ToggleDealer(dealerid,toggle)
	native AddVehicleToDealer(dealerid,vehiclename[],modelid,price) // returns dealer-vehicle id
	native ToggleDealerVehicle(dealerid,dealervehicleid,toggle)
	vDEALER: // defines 'New ', so you can easy save the shopid
Example how to use
pawn Код:
#include <a_samp>
#define FILTERSCRIPT //ALWAYS define this if your including it into a filterscript
#include <vdealer>

public OnFilterScriptInit()
{
    //vDEALER: dealername = CreateVehicleDealer(name[],x,y,z);
    vDEALER: wang_cars = CreateVehicleDealer("Wang Car's",-1974.075439, 280.052734, 34.742362);
    //AddVehicleToDealer(dealerid,vehiclename[],vehiclemodelid,price);
    AddVehicleToDealer(wang_cars,"Sabre",475,5000);
    AddVehicleToDealer(wang_cars,"Turismo",451,15000);
    AddVehicleToDealer(wang_cars,"SuperGT",506,20000);
    AddVehicleToDealer(wang_cars,"Infernus",411,25000);
   
   
    //another shop
    vDEALER: farmer_shop = CreateVehicleDealer("Farmer Shop",-7.8484,53.6393,3.1172);
    AddVehicleToDealer(farmer_shop,"Tractor",531,3000);
   
    //Example how to disable a vehicle in the dealerlist
    new combine = AddVehicleToDealer(farmer_shop,"Combine Harvester",532,20000);
    ToggleDealerVehicle(farmer_shop,combine,0); //0 = disabled, 1 = enabled
    return 1;
}
Define options
pawn Код:
#define RESPAWN_DELAY       5000    //Respawn time in miliseconds
#define DIALOG_RANGE        0       //dialog range
#define MAP_ICON            55      //mapicon for dealer
#define MAP_ICON_ID         1337    //Temporary mapicon ID when a dealer is streamed (to avoid any of your own mapicons to got removed)

//sell vehicle settings
#define SELL_DIVIDE         5       //Original price / SELL_DIVIDE = sellback money you get

//streamer settings
#define STREAMER_DISTANCE   100     //Streamdistance for the build-in streamer
#define STREAMER_INTERVAL   1000    //Streamer tickratio (due to the loops, this shouldnt be really lower as 600-700 i think, i recommend setting it to 1000 though)

//FILEPATHS
#define VEHICLE_PATH        "vDealer_vehicles/%i.ini"

//SQL Settings:
#define USE_MYSQL_DATABASE  false
#define SQL_SERVER          "localhost"
#define SQL_TABLE           "vDealer_vehicles"
#define SQL_USER            "root"
#define SQL_PASS            ""
Credits
****** for sscanf2
****** for YSI
G-sTyLeZzZ - MySQL plugin
Zeex for zcmd
Me for yoursql and the main script

Downloadlink
If you just want to take a "peek" on the source, heres a pastebin link.

Fixed version!
All files:
Reply
#2

Awesome!!!
Reply
#3

Awesome work dude
Reply
#4

Nice man.!
Reply
#5

Going to give it ago!
Reply
#6

Thank you, I have been looking for one of these!
Reply
#7

nice
Reply
#8

I created fs that in 25 minutes,cool include
Reply
#9

Suggestion:
Make it choosable between:
-Checkpoint
or
-Pickup
Reply
#10

Quote:
Originally Posted by [KO]KillerThriller
Посмотреть сообщение
Suggestion:
Make it choosable between:
-Checkpoint
or
-Pickup
A pickup
Reply
#11

Really gooood!!

Congratulations
Reply
#12

AWESOME ! ! !

Reply
#13

Quote:
Originally Posted by [RSS]Cops_sandu
Посмотреть сообщение
Quote:
Originally Posted by [KO]KillerThriller
Посмотреть сообщение
Suggestion:
Make it choosable between:
-Checkpoint
or
-Pickup
A pickup
@[RSS]Cops_sandu: What do you mean ? this alreay has a pickup

@[KO]KillerThriller: i dont really see the point why you would use a checkpoint..


Anyway thanks all for the comments i appreciate
Reply
#14

Quote:
Originally Posted by gamer931215
Посмотреть сообщение
@[RSS]Cops_sandu: What do you mean ? this alreay has a pickup

@[KO]KillerThriller: i dont really see the point why you would use a checkpoint..


Anyway thanks all for the comments i appreciate
"i dont really see the point why you would use a checkpoint.."
Seriously?
What is most popular in all servers, using vehicle ownership systems?
Checkpoints...
Still it's a suggestion, and a good one.
Reply
#15

Quote:
Originally Posted by [KO]KillerThriller
Посмотреть сообщение
"i dont really see the point why you would use a checkpoint.."
Seriously?
What is most popular in all servers, using vehicle ownership systems?
Checkpoints...
Still it's a suggestion, and a good one.
Il might add it if you think its so important (maybe other people want it too), but still i dont see the (functional) point....
Reply
#16

Nice job although i did find a few minor things lol

Green & Orange colours when choosing your colour need switching round :P

Maybe it was me but anything more than 5 vehicles in the vehicle selection menu refuses to show up in the dialog (it's late lol could be me)
Reply
#17

Really good work!
Reply
#18

I've a problem.

I insert it in my GF/LARP edit.
I dont use SQL, I use, y_ini.
I start the server but see the GM unknown.
їAny solutions?
(Incognito's stremaer and sscanf loads)

EDIT: Now, using SQL, saya that file is compiled but no show nothing in the compiler window (A { or } isnt correct)
I only edit the defines of the inc
pawn Код:
#define USE_MYSQL_DATABASE  false
#define SQL_SERVER          "***.***.***.***"
#define SQL_TABLE           "***_***"
#define SQL_USER            "***_*****"
#define SQL_PASS            "*****"
Reply
#19

Quote:
Originally Posted by SuperMarioRol
Посмотреть сообщение
I've a problem.

I insert it in my GF/LARP edit.
I dont use SQL, I use, y_ini.
I start the server but see the GM unknown.
їAny solutions?
(Incognito's stremaer and sscanf loads)

EDIT: Now, using SQL, saya that file is compiled but no show nothing in the compiler window (A { or } isnt correct)
I only edit the defines of the inc
pawn Код:
#define USE_MYSQL_DATABASE  false
#define SQL_SERVER          "***.***.***.***"
#define SQL_TABLE           "***_***"
#define SQL_USER            "***_*****"
#define SQL_PASS            "*****"
Thats odd, that part works fine here at GrandLarc & LVDM...
however i discovered some bugs, so im trying to fix it arround tomorrow
check it tomorrow again.
Reply
#20

Quote:
Originally Posted by [KO]KillerThriller
Посмотреть сообщение
Suggestion:
Make it choosable between:
-Checkpoint
or
-Pickup
Quote:
Originally Posted by barneystinson
Посмотреть сообщение
Nice job although i did find a few minor things lol

Green & Orange colours when choosing your colour need switching round :P

Maybe it was me but anything more than 5 vehicles in the vehicle selection menu refuses to show up in the dialog (it's late lol could be me)
Quote:
Originally Posted by SuperMarioRol
Посмотреть сообщение
I've a problem.

I insert it in my GF/LARP edit.
I dont use SQL, I use, y_ini.
I start the server but see the GM unknown.
їAny solutions?
(Incognito's stremaer and sscanf loads)

EDIT: Now, using SQL, saya that file is compiled but no show nothing in the compiler window (A { or } isnt correct)
I only edit the defines of the inc
pawn Код:
#define USE_MYSQL_DATABASE  false
#define SQL_SERVER          "***.***.***.***"
#define SQL_TABLE           "***_***"
#define SQL_USER            "***_*****"
#define SQL_PASS            "*****"

Thanks all for the bug reports
all bugs should be fixed now in Version 1.1:
Changelog
Код:
V1.1:
- Bug fixed with dialogspam (thanks to [KO]KillerThriller for reporting)
- You can now define the pickupmodel if you want to change it
- System can now also use checkpoints instead of pickups
- OnGameModeInit bug fixed (i failed, lol)
- System is now using Incognito's streamer
- Multiple other bugs are fixed
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)