SA-MP Forums Archive
How to use "DestroyVehicle" without player in 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: How to use "DestroyVehicle" without player in vehicle? (/showthread.php?tid=635058)



How to use "DestroyVehicle" without player in vehicle? - tekass - 31.05.2017

Hi all, i need help with the Callback "DestoyVehicle" Because I have succeded to make it work but only with GetPlayerVehicleID but I need to use it without player in the vehicle for my crusher system.

Here is the method I use:


Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/fb", true))
     	{
      	new Float:x, Float:y, Float:z;
	new idcar;
	idcar = GetVehiclePos(idcar, x, y, z);
	DestroyVehicle(idcar);
     	GameTextForPlayer(playerid, "Vehicule broyer!", 3500, 1);
        }
}
Tanks for your help.

PS: Sorry for my bad english, im french...


Re: How to use "DestroyVehicle" without player in vehicle? - Sew_Sumi - 31.05.2017

idcar doesn't have any value...


You haven't checked for parameters in the command to make idcar have a value.