SA-MP Forums Archive
Help Car Delete But No Lost - 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 Car Delete But No Lost (/showthread.php?tid=665620)



Help Car Delete But No Lost - IndonesiaScripter - 11.04.2019

Hi Guys can help for car spawn system? cant Lost after exit vehicle

Code:
CMD:v(playerid,params[])
{
	new car;
	new string[128];
	new Float:X, Float:Y, Float:Z;
	GetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
	if(sscanf(params,"i", car)) return SendClientMessage(playerid,0xff0000ff,"USAGE: /v <Vehicle ID 400 - 611>");
	else if(car < 400 || car >611) return SendClientMessage(playerid, 0xff0000ff, "ERROR: ID Vehicle tidak valid!");
	{
	if(Vehicle[playerid] != 0)
	{
		DestroyVehicle(Vehicle[playerid]);
	}
	Vehicle[playerid] = CreateVehicle(car, X, Y, Z + 2.0, 0, -1, -1, 1);
	format(string,sizeof(string),"Kamu berhasil spawn kendraan ID %i",car);
	SendClientMessage(playerid, 0xffffffff, string);
	PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
	}
	return 1;
}



Re: Help Car Delete But No Lost - Yukie - 11.04.2019

what is the error?


Re: Help Car Delete But No Lost - CONTROLA - 11.04.2019

You most probably have some code inside OnPlayerExitVehicle or OnPlayerStateChanged where you destroy your vehicle. Search for "Vehicle[playerid]" in your gamemode and you'll find that code.