How a dealership works.
#1

https://sampforum.blast.hk/showthread.php?tid=460706

I've followed this tutorial but as you can see he sets the vehicle Model to 1 on every car. How do you make the vehicle the players car and not anyone elses? I know how to do everything else apart from that. Would it work if I set the vehicleModel to the vehicle's ID? If yes, would the vehicle ID change in any way possible?(other than being deleted)
Reply
#2

anyone?
Reply
#3

I don't really know but I can guess. You save down every vehicle information into different files and give them all unique ID's. Like if you're using Y_ini or any file system you would save into like "/FolderName/%d.ini" and then each time a new vehicle is created you will create a new file in a for loop that goes from 0 to the highest amount of vehicles allowed on your server which you define above in the script like: "#define maxVehicles 1000", then you use in the for loop something like: "for(i = 0; i< maxVehicles…." and in this for loop it will go through if the file exists or not and before that do a format(all, sizeof(all), "folder name/%d.ini", i); and then in the search for if the file exist"if(fexist(all))".

So far so good? Now you have to assign this "unique vehicle ID" to a player. That you do by saving the vehicle ID into a player's file in a new tag or in an already existing or if you're even using tags or not. In each unique vehicle ID file you write down ALL the necessary information to spawn a vehicle, its x, y, z coords, which vehicle model etc.

This is how I think, do not take this for granted that it is like this! This is just how I would try it if I were to create a system like this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)