Quote:
Originally Posted by ******
Trust me, using many files and searching through them all will put HUGE strain on your server and is likely to introduce noticeable lag in your server, which will drastically reduce players' experiences.
|
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;
}
}
vehicles.ini:
Quote:
12 Biesmen 420 1780.105 -1860.396 13.271 269.02 -1 -1
|
the logged[playerid]/[carowner] thing, is my system. So don't worry about that