[HELP]DestroyVehicle - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]DestroyVehicle (
/showthread.php?tid=186267)
[HELP]DestroyVehicle -
nemesis93 - 28.10.2010
Hi guys,
can you help me with problem with DestroyVehicle ?
First:
I create my admin car.
Код:
new AdminVozidlo;
dcmd_ac(playerid, params[])
#pragma unused params
{
if(IsPlayerAdmin(playerid))
{
new Float:X,Float:Y,Float:Z,Float:angle;
GetPlayerPos(playerid,X,Y,Z);
AdminVozidlo = CreateVehicle(411,X,Y,Z,angle,0,0,-1);
PutPlayerInVehicle(playerid, AdminVozidlo, 0);
}else{ // you are not administrator... etc etc....
return 1;
}
All is right.
But if i create more cars (2, 3, 4, 5....), and i destroycars with
Код:
dcmd_acd(playerid, params[])
#pragma unused params
{
if(IsPlayerAdmin(playerid))
{
DestroyVehicle(AdminVozidlo);
}else{ // you are not admin etc, etc....
}
return 1;
}
I destroy only last one car.
Can you help me with destroy all created cars ?
Thank you, good day
Re: [HELP]DestroyVehicle -
Kyle - 28.10.2010
Every vehicle gets assigned the same varible, so its going to delete the last one,
You need to create a varible like
new AdminVozidlo[10];
Then in your command make it so you can do
/ac (car id number 1 - 10)
then under
/acd
do DestroyVehicle(AdminVozidlo[id]);
Re: [HELP]DestroyVehicle -
nemesis93 - 28.10.2010
KyleSmith: Thank you for answer.
And how do command /ac ?
Or can you do command /ac ?
Re: [HELP]DestroyVehicle -
Kyle - 28.10.2010
I havn't got time to help you at the moment. Il come back to you, Maybe someone else might in the mean time. Sorry.
Re: [HELP]DestroyVehicle -
nemesis93 - 29.10.2010
KyleSmith: Ok thank, i will waiting
Re: [HELP]DestroyVehicle -
nemesis93 - 31.10.2010
Can you help me Anyone ?