[Help] Car Ownership
#1

The script that I use: Gagi's car ownership
A detailed description of the problem: So when i buy car and exmp. drive him around los santos and then sell him
and after i relog all si well but when i restart server, the car wich i sold is again at place where i buyed him and i again can sell them
Reply
#2

Think this is better posted in the filterscript you got it from.

not sure what your sayin but sell the car and serversave then restart see if that helps
Reply
#3

Save player car ids when player disconnects.I think that if a player sell's the car,the script does not save that new stats.
Reply
#4

Quote:
Originally Posted by TaLhA XIV
Посмотреть сообщение
Save player car ids when player disconnects.I think that if a player sell's the car,the script does not save that new stats.
OnPlayerDisconnect code
Код:
public OnPlayerDisconnect(playerid, reason)
{
	TextDrawDestroy(CoSTD0[playerid]);
	TextDrawDestroy(AlarmTD0[playerid]);
	TextDrawDestroy(AlarmTD1[playerid]);
	new
        pFile[35];

   format(pFile, 35, Player_File, GetName(playerid));
    new
    INI:UserFile = INI_Open(pFile);
    INI_WriteInt(UserFile, "Veh1", Player[playerid][Veh1]);
    INI_WriteInt(UserFile, "Veh2", Player[playerid][Veh2]);
    INI_Close(UserFile);
	return 1;
}
OnPlayerConnect code, where is problem?
Код:
public OnPlayerConnect(playerid)
{
CoSTD0[playerid] = TextDrawCreate(215.000000, 380.000000, "~y~Naziv: ~w~Cheetah   ~y~Cijena: ~g~$5~n~          ~y~Maximalna brzina: ~w~200");
TextDrawBackgroundColor(CoSTD0[playerid], 255);
TextDrawFont(CoSTD0[playerid], 2);
TextDrawLetterSize(CoSTD0[playerid], 0.370000, 1.000000);
TextDrawColor(CoSTD0[playerid], -1);
TextDrawSetOutline(CoSTD0[playerid], 1);
TextDrawSetProportional(CoSTD0[playerid], 1);

AlarmTD0[playerid] = TextDrawCreate(40.000000, 150.000000, "~n~");
TextDrawBackgroundColor(AlarmTD0[playerid], 255);
TextDrawFont(AlarmTD0[playerid], 1);
TextDrawLetterSize(AlarmTD0[playerid], 0.360000, 3.300000);
TextDrawColor(AlarmTD0[playerid], -1);
TextDrawSetOutline(AlarmTD0[playerid], 0);
TextDrawSetProportional(AlarmTD0[playerid], 1);
TextDrawSetShadow(AlarmTD0[playerid], 1);
TextDrawUseBox(AlarmTD0[playerid], 1);
TextDrawBoxColor(AlarmTD0[playerid], -206);
TextDrawTextSize(AlarmTD0[playerid], 117.000000, 0.000000);

AlarmTD1[playerid] = TextDrawCreate(40.000000, 150.000000, "~p~~h~Alarm: ~r~ON~n~~n~~p~~h~Alarm: ~w~OFF");
TextDrawBackgroundColor(AlarmTD1[playerid], 255);
TextDrawFont(AlarmTD1[playerid], 2);
TextDrawLetterSize(AlarmTD1[playerid], 0.290000, 0.899999);
TextDrawColor(AlarmTD1[playerid], -1);
TextDrawSetOutline(AlarmTD1[playerid], 1);
TextDrawSetProportional(AlarmTD1[playerid], 1);
new pFile[48];
format(pFile, 48, Player_File, GetName(playerid));

if(!fexist(pFile))
{
    new
    INI:UserFile = INI_Open(pFile);
    INI_WriteInt(UserFile, "Veh1",9999);
    INI_WriteInt(UserFile, "Veh2", 9999);
    INI_Close(UserFile);
}
INI_ParseFile(pFile, "LoadPlayerData", .bExtra = true, .extra = playerid);
Priceo[playerid] = 0;
Seller[playerid] = 999;
return 1;
}
Reply
#5

Do not close the console for server restart, type 'gmx' instead in the console. When you close it, it doesn't have time to save.
Reply
#6

so that is normal?
Reply
#7

but after i dont close server for a while after i close it it bug all sold cars
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)