Spawned Car .........
#1

I got A problem, When A player spawn a car/bike/plane with a command (/car)(/v)(acar)(vcar), the car stay always at the place where he spawned it!!!
Reply
#2

Yea, the same thing was with my GM.
Just set a variable to store created vehicle's ID
new veh = CreateVehicle(...)

And under OnVehicleSpawn put
if(vehicleid == veh) DestroyVehicle(...)

+ rep if helped
Reply
#3

Ok Thanks i will try it !!
Reply
#4

BTW, set variable veh as global and for each player new veh[MAX_PLAYERS]
And use it with veh[playerid]
Reply
#5

I don't understand ?
Reply
#6

I want Spawned Cars Automatic Destroyable ??
Reply
#7

Here:
pawn Код:
//above main()
new SpawnedCar[MAX_PLAYERS];

//in your spawn command:
SpawnedCar[playerid] = CreateVehicle(...);

//in OnVehicleSpawn or OnVehicleDeath
if(vehicleid == SpawnedCar[playerid])
{
    DestroyVehicle(SpawnedCar[playerid]);
}
Reply
#8

i want to set timer to destroy spawned vehicle
Reply
#9

pawn Код:
forward Destroy(vid);//on top
public Destroy(vid)
{
DestroyVehicle(vid);
return 1;
}


//now this in where you spawn car
new id;
id = CreateVehicle(....);
SetTimerEx("Destroy",1000*60*2/*2mins*/,false,"i",id);
Reply
#10

Thanks Everybody !!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)