SA-MP Forums Archive
help me with vehicle! - 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 me with vehicle! (/showthread.php?tid=535407)



help me with vehicle! - Barnwell - 03.09.2014

when i /q the player can't see my vehicle why?
how i can change it? + rep who help me!


Re: help me with vehicle! - TeddyYeah - 03.09.2014

With /q you get out from the server...


Re: help me with vehicle! - Gogeta101 - 03.09.2014

use /dl to se your vehicle info


Re: help me with vehicle! - Barnwell - 03.09.2014

i mean in anthoer server when any player leave from the server the vehicle is stay
in my server when i /q the vehicle will gone i want when i /q the players can see my vehicle


Re: help me with vehicle! - Pawnify - 03.09.2014

Look under OnPlayerDisconnect, as that is what happens when you /q maybe it removes the vehicle there.


Re: help me with vehicle! - FrightenPython - 03.09.2014

Post us your OnPlayerDisconnect and we will tell you what to edit.


Re: help me with vehicle! - Fred1993 - 03.09.2014

Remove the code for Destroy player car under OnPlayerDisconnect, Show the whole OnPlayerDisconnect fuction here sow e can help you with that. It will be easier for all of use.


Re: help me with vehicle! - Barnwell - 03.09.2014

Код:
public OnPlayerDisconnect(playerid, reason)
{
	if(IsPlayerNPC(playerid)) {
		return 0;
	}
	paintballOnPlayerDisconnect(playerid, reason);
	vehOnPlayerDisconnect(playerid, reason);
	accountOnPlayerDisconnect(playerid, reason);
	RPOnPlayerDisconnect(playerid, reason);
	jobsOnPlayerDisconnect(playerid, reason);
	trainingOnPlayerDisconnect(playerid, reason);
	boxingOnPlayerDisconnect(playerid, reason);
	govOnPlayerDisconnect(playerid, reason);
	loggingOnPlayerDisconnect(playerid, reason);
	acOnPlayerDisconnect(playerid, reason);
	adminOnPlayerDisconnect(playerid, reason);
	medicOnPlayerDisconnect(playerid, reason);
	racingOnPlayerDisconnect(playerid, reason);
	//deleteRadioURLPVars(playerid);
	payphonesOnPayPhoneDisconnect(playerid, reason);
	//damageSystemOnPlayerDisconnect(playerid, reason);
	//weatherOnPlayerDisconnect(playerid, reason);
	//evidenceOnPlayerDisconnect(playerid);
	TextDrawOnPlayerDisconnect(playerid, reason);
	specialItemsOnPlayerDisconnect(playerid, reason);
	hungerOnPlayerDisconnect(playerid, reason);
	fishingOnPlayerDisconnect(playerid, reason);
	//voteKickOnPlayerDisconnect(playerid, reason);
	//SpeedTrapsOnPlayerDisconnect(playerid, reason);
	fpsCamOnPlayerDisconnect(playerid, reason);
	SQLQueriesOnPlayerDisconnect(playerid, reason);
	basketballOnPlayerDisconnect(playerid, reason);
	cheatsOnPlayerDisconnect(playerid, reason);
	eventOnPlayerDisconnect(playerid, reason);
	return 1;
}



Re: help me with vehicle! - Fred1993 - 03.09.2014

Quote:

vehOnPlayerDisconnect(playerid, reason);

Look under this function . There you'll find your thing


Re: help me with vehicle! - FrightenPython - 03.09.2014

Fred!!! Why you do this! Yeah, that's what I wanted to say too, it's under the function vehOnPlayerDisconnect(playerid, reason);

If I'm correct it's defined in vehicle.pwn as those lines:
Код:
	for(new i=0;i<sizeof(VehicleInfo);i++) {
		if(VehicleInfo[i][EVOwner] == playerid && VehicleInfo[i][EVType] == EVehicleType_Owned) {
			saveVehicle(i);
			VehicleInfo[i][EVType] = EVehicleType_Uninit;
			clearTrunk(i);
			DestroyVehicleToys(i, 0);
			DestroyVehicle(i);
		}
	}
Removing DestroyVehicle line should help.

Код:
	for(new i=0;i<sizeof(VehicleInfo);i++) {
		if(VehicleInfo[i][EVOwner] == playerid && VehicleInfo[i][EVType] == EVehicleType_Owned) {
			saveVehicle(i);
			VehicleInfo[i][EVType] = EVehicleType_Uninit;
			clearTrunk(i);
			DestroyVehicleToys(i, 0);
			DestroyVehicle(i);
		}
	}