11.11.2010, 14:13
Quote:
|
I would store all the data on the cars, including the owner, in a single file, then have a reference to which car a player owns in their user file too.
|
Quote:
|
Okay, I'll try to use your way.
But I'm quite new to something like that, so it'll take a time for me to add new lines in one file by a command. Edit: But how do I make it spawn when the player logs on. This is one of the main reasons I used seperated files. Something like.. Код:
GetPlayerName(playerid, carowner, sizeof(carowner));
new File:ownvehicles=fopen("vehicles.ini", io_read);
new idx;
while(fread(ownvehicles, string)){
idx = 0
carid = strval(strtok(string,idx));
carowner = strtok(string,idx);
modelid = strval(strtok(string,idx));
carX = floatstr(strtok(string,idx));
carY = floatstr(strtok(string,idx));
carZ = floatstr(strtok(string,idx));
carRot = floatstr(strtok(string,idx));
pC1 = strval(strtok(string,idx));
sC2 = strval(strtok(string,idx));
if(logged[carowner] == 1) {
vehicle[carid] = CreateVehicle(modelid, X, Y, Z, carRot, pC1, sC2, 0);
return 1;
}
}
Код:
12 Biesmen 420 1780.105 -1860.396 13.271 269.02 -1 -1 |


