SA-MP Forums Archive
How can i delete 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: How can i delete cars ? (/showthread.php?tid=545136)



How can i delete cars ? - Wixen - 06.11.2014

Hello again , im using united-rp mod.There is some cars in the game i can't delete.There is command like /deletefcar > Deletes family car , /deletepcar > Deleteplayercar , /deletepermcar > deletes permanent cars.But some cars i can't delete and there isn't have any command like that , so i checked all cars and noticed the ones which i'm going to delete but i don't know how.How can i delete on fscript or somewhere else ? sorry for bad english


Re: How can i delete cars ? - Kaperstone - 06.11.2014

save the vehicle id into an array when you create it like so
array_name=CreateVehicle();
then use the function DestroyVehicle(array_name); to destroy it.


Re: How can i delete cars ? - Wixen - 06.11.2014

Quote:
Originally Posted by xkirill
Посмотреть сообщение
save the vehicle id into an array when you create it like so
array_name=CreateVehicle();
then use the function DestroyVehicle(array_name); to destroy it.
Sorry but what's array ? i don't understand pawn so much.I just translated it to my language and i want to use.There isn't too much bug in this mod but i need to edit it first ingame.Factions businesses vs....Can u be more spesific ?


Re: How can i delete cars ? - Wixen - 07.11.2014

Can somebody help ? i need a deletecar command.i need deletecar command


Re: How can i delete cars ? - ThunderX - 07.11.2014

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if(strcmp(cmdtext, "/destroyveh", true) == 0)
     {
          new vehicleid;
          vehicleid= GetPlayerVehicleID(playerid);
          DestroyVehicle(vehicleid);
          return 1;
     }
 
     return 0;
}
https://sampwiki.blast.hk/wiki/DestroyVehicle


Re: How can i delete cars ? - Wixen - 07.11.2014

Quote:
Originally Posted by ThunderX
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if(strcmp(cmdtext, "/destroyveh", true) == 0)
     {
          new vehicleid;
          vehicleid= GetPlayerVehicleID(playerid);
          DestroyVehicle(vehicleid);
          return 1;
     }
 
     return 0;
}
https://sampwiki.blast.hk/wiki/DestroyVehicle
How can i add it to the pawn ? Where do i gonna put it ?Im not good at pawn an my pawner is really busy on theese days.


Re: How can i delete cars ? - BpX - 07.11.2014

Put it under OnPlayerCommandText.

If you haven't used OnPlayerCommandText yet, you can just copy that code and paste it on your script.


Re: How can i delete cars ? - Glossy42O - 07.11.2014

You are too new to scripting start from here https://sampwiki.blast.hk/wiki/Scripting_Basics

If you don't understand nothing just transtale to your language.

Good luck.


Re: How can i delete cars ? - dominik523 - 07.11.2014

Your pawner?
Go on ******* and watch pawn tutorials, or read tutorials on SAMP wiki or here on the forums.