SA-MP Forums Archive
Help [Script deleting cars owned cars] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help [Script deleting cars owned cars] (/showthread.php?tid=522445)



Help [Script deleting cars owned cars] - TheBlaze243 - 27.06.2014

Hey everyone! I have a problem. When a player buy a vehicle, everything works fine, but unce he leave the server, his cars got automatically deleted by the script. Then he needs to buy them again on login. Here is what I seen in the script about that.

Код:
	}
	if(PlayerInfo[playerid][PlayerVehicleModel1] != 0)
	{
		ResetPlayerVehicle(playerid,1);
	}
	if(PlayerInfo[playerid][PlayerVehicleModel2] != 0)
	{
		ResetPlayerVehicle(playerid,2);
	}
	if(PlayerInfo[playerid][PlayerVehicleModel3] != 0)
	{
		ResetPlayerVehicle(playerid,3);
	}
	if(PlayerInfo[playerid][PlayerVehicleModel4] != 0)
	{
		ResetPlayerVehicle(playerid,4);
	}
	if(PlayerInfo[playerid][PlayerVehicleModel5] != 0)
	{
		ResetPlayerVehicle(playerid,5);
	}
    printf("//Deleting Vehicles For ID: %d", playerid);
	return 1;
}
"Deleting Vehicles for ID " is exact what is writing at the panel. Please if anyone know what is going on, help me!


Re: Help [Script deleting cars owned cars] - TheBlaze243 - 27.06.2014

Log from server.

Quote:

[16:59:55] //Deleting Vehicles For ID: 0
[16:59:55] [part] KC_BIaze has left the server (0:1)
[17:05:41] --- Server Shutting Down.
[17:05:41]




Re: Help [Script deleting cars owned cars] - TheBlaze243 - 27.06.2014

This is really annoying.


Respuesta: Help [Script deleting cars owned cars] - SickAttack - 27.06.2014

So you don't want the vehicles to destroy when they leave? I didn't really get it.

If so, search for "DestroyVehicle" in the stock "ResetPlayerVehicle" and remove the lines with "DestroyVehicle".


Re: Help [Script deleting cars owned cars] - TheBlaze243 - 27.06.2014

It's a RP server. When a player buy vehicle, it should remain always with him, untill he sells it.

But now, player buy a car, everything works fine, but once he leave the server, his car is beeing deleted from the server, and it's like he never owned one. When he login again, he needs to buy another car.