Help Car spawning - 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 Car spawning (
/showthread.php?tid=213730)
Help Car spawning -
Elmerz_com - 19.01.2011
Hello, I need some help. How can I make cars that i spawn disapear whe a player spawns anothere one?
Re: Help Car spawning -
Kase - 19.01.2011
You can use
OnVehicleSpawn.
Re: Help Car spawning -
Sascha - 19.01.2011
cough... this advice kinda fails...
you can use a variable..
"new spawned[MAX_VEHICLES]";
at the command:
pawn Код:
new v = CreateVehicle(............); //if you have another variable defined for the vehicleid you can use this ofc.
spawned[v] = 1;
for(new vid=0; vid<MAX_VEHICLES; vid++)
{
if(spawned[vid] == 1 && vid != v)
{
spawned[vid] = 0;
DestroyVehicle(vid);
}
}
Re: Help Car spawning -
Elmerz_com - 19.01.2011
Thanks
Re: Help Car spawning -
Elmerz_com - 19.01.2011
Were does this go?
pawn Код:
new v = CreateVehicle(............); //if you have another variable defined for the vehicleid you can use this ofc.
spawned[v] = 1;
for(new vid=0; vid<MAX_VEHICLES; vid++)
{
if(spawned[vid] == 1 && vid != v)
{
spawned[vid] = 0;
DestroyVehicle(vid);
}
}
Re: Help Car spawning -
NRJ53 - 19.01.2011
It goes under the command.