Each vehicle, own ID. -
Ihsan-Cingisiz - 24.01.2011
Hello,
I never attached a ID to a vehicle for its own, but now i want to
do it. It will be more easy to make a vehicle system, but i don't
exactly know how can i can a vehicle their own ID. Is it just this:
Код:
new car1, car2;
car1 = CreateVehicle(...);
car2 = CreateVehicel(...);
Is it possible to make a vehicle buy system with this manner?
If not, what should i do and how?
K. Regards,
I. C.
Re: Each vehicle, own ID. -
Ihsan-Cingisiz - 24.01.2011
* Bump *
Re: Each vehicle, own ID. -
Cameltoe - 24.01.2011
Yes it is possible but i would recommend you to either use Mysql or any other flat file saving, as you would have to recompile every time someone buys an veh.
Re: Each vehicle, own ID. -
Baboon - 24.01.2011
Myself I don''t like Mysql, you could do it with player variabels.
For a roleplay server or however, you could make with the playervariables (by using the dini include) a car system.
That every owner has his own car.
Re: Each vehicle, own ID. -
Outcast - 24.01.2011
To get an id, make a variable that is only for one player (like: car1[playerid] = CreateVehic...). Make it read co-ordinates from the user file (of the player) and make the car spawn when a player spawns on login. I hope I helped.
Re: Each vehicle, own ID. -
Ihsan-Cingisiz - 24.01.2011
Quote:
Originally Posted by Outcast
To get an id, make a variable that is only for one player (like: car1[playerid] = CreateVehic...). Make it read co-ordinates from the user file (of the player) and make the car spawn when a player spawns on login. I hope I helped.
|
Hmm.. Thanks for all your answers. It's a bit confusing for
what I should use. Does someone has a simple tutorial for
vehicle ownership or something?
Re: Each vehicle, own ID. -
Cameltoe - 24.01.2011
I did write an mysql-vehicle ownership tutorial back in the days, let me find the link.
https://sampforum.blast.hk/showthread.php?tid=186495
Re: Each vehicle, own ID. -
Gabe - 24.01.2011
PHP код:
new car1, car2;
car1 = CreateVehicle(...);
car2 = CreateVehicle(...);
CreateVehicle returns the car ID that the server has given it. So in the above code car1 = 0 and car2 = 1 if they are the first vehicles streamed onto your server.
It wold be wise for you to link your database IDs to the server IDs if you want different types of cars.
Take a look at how the VorteX gamemode does it if you are interested.
Re: Each vehicle, own ID. -
Ihsan-Cingisiz - 25.01.2011
Quote:
Originally Posted by Cameltoe
|
Thanks for the reply, but do i need a MYSQL database for this to use
of can i just use it without connecting to a database?