Check file of an other username
#13

Quote:
Originally Posted by Y_Less
Посмотреть сообщение
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:
Originally Posted by Biesmen
Посмотреть сообщение
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:
Код:
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
Reply


Messages In This Thread
Load and read username.ini - by Biesmen - 08.11.2010, 20:14
Re: Check file of an other username - by Biesmen - 09.11.2010, 08:29
Re: Check file of an other username - by Biesmen - 09.11.2010, 16:12
Re: Check file of an other username - by Hiddos - 09.11.2010, 16:34
Re: Check file of an other username - by Biesmen - 09.11.2010, 17:52
Re: Check file of an other username - by Mike_Peterson - 09.11.2010, 20:10
Re: Check file of an other username - by Biesmen - 10.11.2010, 15:02
Re: Check file of an other username - by Biesmen - 10.11.2010, 17:36
Re: Check file of an other username - by SuperS82 - 10.11.2010, 17:46
Re: Check file of an other username - by Biesmen - 10.11.2010, 18:16
Re: Check file of an other username - by SuperS82 - 10.11.2010, 18:20
Re: Check file of an other username - by kacperoo - 11.11.2010, 09:25
Re: Check file of an other username - by Biesmen - 11.11.2010, 14:13
Re: Check file of an other username - by TheXIII - 11.11.2010, 14:45
Re: Check file of an other username - by TheXIII - 11.11.2010, 15:19
Re: Check file of an other username - by Biesmen - 12.11.2010, 15:18
Re: Check file of an other username - by Biesmen - 18.11.2010, 17:26

Forum Jump:


Users browsing this thread: 1 Guest(s)