No respawn for createvehicle
#1

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
Reply
#2

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.
Reply
#3

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

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)
Reply
#5

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?
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)