SA-MP Forums Archive
No respawn for createvehicle - 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: No respawn for createvehicle (/showthread.php?tid=92766)



No respawn for createvehicle - Zafire1410 - 22.08.2009

Hi i need help!! i want to make "createvehicle" car no respawns NEVER... because i createvehicle the id "carro1" my car have got damaged and explosion... and the car respawns i want the car no respawn!! only respawn when i use "setvehicletorespawn" but when the car get damaged no!!

Pleasee help i thx for atention, sorry for my english


Re: No respawn for createvehicle - ilikepie2221 - 22.08.2009

Personally, I like AddStaticVehicleEx better as it respawns on explosion/water-killed, and it will respawn if no one goes in it for w/e seconds. Bad part is that you can't use it in an FS that you start after that gamemode starts, the vehicles won't spawn.


Re: No respawn for createvehicle - Zafire1410 - 22.08.2009

the problem is addstaticvehicleex only can be used in ongamemodeinit no in another callback!


Re: No respawn for createvehicle - Eazy_Efolife - 22.08.2009

Quote:
Originally Posted by Zafire1410
the problem is addstaticvehicleex only can be used in ongamemodeinit no in another callback!
WELL.... You Can Try: https://sampwiki.blast.hk/wiki/CreateVehicle

This spawns a car anywhere at anytime! (ex: useing a command)


Re: No respawn for createvehicle - refshal - 22.08.2009

Quote:
Originally Posted by Compton's Eazy E (Eazyrp.tk)
Quote:
Originally Posted by Zafire1410
the problem is addstaticvehicleex only can be used in ongamemodeinit no in another callback!
WELL.... You Can Try: https://sampwiki.blast.hk/wiki/CreateVehicle

This spawns a car anywhere at anytime! (ex: useing a command)
Did you read the first post?


Re: No respawn for createvehicle - M4S7ERMIND - 22.08.2009

This could be useful, if you want all vehicles on your server never to respawn:

pawn Код:
new carro[MAX_VEHICLES];

carro[0] = CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay);
carro[1] = CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay);
carro[2] = CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay);
carro[3] ...

//if you want vehicle never to respawn, use -1 in respawn_delay
//and use this callback

public OnVehicleSpawn(vehicleid) {

  for(new veh; veh < MAX_VEHICLES; veh++) {
    if(vehicleid == carro[veh]) {
      DestroyVehicle(carro[veh]);
      break;
    }
  }
  return 1;
}
I think SetVehicleToRespawn wont work after this, so you need to recreate the vehicle...
whatever, have fun.