How to make a car system like this?
#1

[ame]http://www.youtube.com/watch?v=tZslVVbmoD0[/ame]

RE_Write:

Hey,
I could make this my self but I need to save cars in one enum. Cars spawned that arent saved need to not be saved unless the admin saves it. I only need help with the Saving really. I could do the loading my self the only thing I dont know how to do is load and unload player cars and save them to the right ID's. I can figure out the rest I unless I just dont know how to save every car to the right ID when not all the cars are spawned.
Reply
#2

You have cheat installed, you dont need that LOL
Reply
#3

Its not my video if it was I would have the car system. Read the post or dont post end of!
Reply
#4

upupup Sorry to bump but all I need is saving and loading the rest i can do myself.

Thanks remember +REP
Reply
#5

Use one from another gamemode? It's easy... It's as simple as the saving and loading of Player account variables.
Reply
#6

I can make my own but I want that as its loads easyer than making loads of saving and loading systems through Y_INI having loads of enums etc. The point of trying to recreate this is to make a car system where I can do everything in game I have dynamic ATM's houses everything it makes the mapping of the server as breeze for when I finish the coding.
Reply
#7

:/ As I said... Read some of the vehicle systems already made... They all have similar loading and saving systems... If you just want a plain vehicle system, and not a player owned vehicle system, you might take a look at Norn's CRP...
Reply
#8

There are NO systems like this. Also I dont need to steal code because if someone expains to me or gives an example of how to save i can do it. I am not a fan of using other peoples code and I like guidence from the people on these forums if the answer was out there I wouldnt have posted this thread as I was trolling for hours looking for the answer. The thing that makes it differnt is this car system is under ONE enum not loads. This saves making loads of save systems and store it into one in someways making saving quicker as there are less loops to run through.
Reply
#9

Sorry for bumping again. But my server really needs this now as I need it finished as without it it has stopped scripting progress on the server. Thanks for all the people who have had a think about it and looked at it. Hope somone can help me soon.
Reply
#10

Why did you PM me? how can I help without seeing the code..
Reply
#11

I dont have any code I need to know how to save it all I have is this.

pawn Код:
enum vInfo
{
    vOwner[MAX_PLAYER_NAME],
    vType,
    vFaction,
    vDealershipID,
    vSalePrice,
    vRentPrice,
    vLcoked,
    vColour1,
    vColour2,
    Float:vSpawnX,
    Float:vSpawnY,
    Float:vSpawnZ,
    Float:vSpawnAngle
}
new VehicleInfo[MAX_SAVED_VEHICLES][vInfo];

new bool:IsValidCar[MAX_VEHICLES];//Was used in an attempt to save cars as valid cars but I couldnt work out an index of a gang car.

//saving
forward LoadVehicles_Main(vehicleid, name[],value[]);
public LoadVehicles_Main(vehicleid, name[], value[])
{
    INI_String("Owner", VehicleInfo[vehicleid][vOwner], MAX_PLAYER_NAME);
    INI_Int("Type", VehicleInfo[vehicleid][vType]);
    INI_Int("FactionID", VehicleInfo[vehicleid][vFaction]);
    INI_Int("Dealership", VehicleInfo[vehicleid][vDealershipID]);
    INI_Int("Price", VehicleInfo[vehicleid][vSalePrice]);
    INI_Int("RentPrice", VehicleInfo[vehicleid][vRentPrice]);
    INI_Int("Locked", VehicleInfo[vehicleid][vLcoked]);
    INI_Int("Colour1", VehicleInfo[vehicleid][vColour1]);
    INI_Int("Colour2", VehicleInfo[vehicleid][vColour2]);
    VehicleCount++;
    return 1;
}

forward SaveVehicle(vehicleid);
public SaveVehicle(vehicleid)
{
    new INI:File = INI_Open(CarPath(vehicleid));
    INI_SetTag(File, "Main");
    INI_WriteString(File, "Owner", VehicleInfo[vehicleid][vOwner]);
    INI_WriteInt(File, "Type", VehicleInfo[vehicleid][vType]);
    INI_WriteInt(File, "FactionID", VehicleInfo[vehicleid][vFaction]);
    INI_WriteInt(File, "Dealership", VehicleInfo[vehicleid][vDealershipID]);
    INI_WriteInt(File, "Price", VehicleInfo[vehicleid][vSalePrice]);
    INI_WriteInt(File, "RentPrice", VehicleInfo[vehicleid][vRentPrice]);
    INI_WriteInt(File, "Locked", VehicleInfo[vehicleid][vLcoked]);
    INI_WriteInt(File, "Colour1", VehicleInfo[vehicleid][vColour1]);
    INI_WriteInt(File, "Colour2", VehicleInfo[vehicleid][vColour2]);
    INI_Close(File);
}

stock CarPath(saveindex)
{
    new string[128];
    format(string,sizeof(string), CAR_PATH, saveindex);
    return string;
}
Thats all the code I have I cant save the cars by there numbers as some cars arent always sapwned and some cars dont need to be saved. I need a way of indexing a vehicle correctly without having to have all cas spawned and by not saving all the cars that car temp cars.
Reply
#12

3rd page UP
Reply
#13

UP!..
Reply
#14

Can anyone atleast provide an example I cant do anything else with my server so I need to done and sorted for my server to continue to develop.
Reply
#15

Well thanks for the help but I think its time to get off my phone and enjoy my holiday. Good bye until I bump this.
Reply
#16

I am not exactly sure how the system works

As far as I can see it loads and saves all vehicles, thats fine

You say that there are cars which shouldnt be always spawned, I expect the vehicle who got an owner
Than I just would spawn all vehicle without an owner

pawn Код:
// creation part after loading all vehicles into VehicleInfo
    if(VehicleInfo[vehicleid][vOwner][0] != EOS)
    {
        CreateVehicle(...);
    }
For temp cars just dont save them in VehicleInfo
Reply
#17

bump
Reply
#18

I know how to load the car. I cant save the cars because I need them to save to the correct numbers. To do this I need to spawn all cars but I cant spawn all cars because that would mean either losing currant variable info or messing up the ID's. Could you recomend a way to help me with this issue?. THanks Snowman!.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)