Create vehicles ingame
#7

CreateVehicle return the vehicleid. Thus, in the examples above, you save the vehicleid to a variable (car1,car2 etc).

To delete a vehicle, simply use DestroyVehicle (under OnVehicleDeath for example):

pawn Code:
#include <a_samp>

new car;

public OnGameModeInit()
{
    car = CreateVehicle(411,.......);
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    if(vehicleid == car) // if the vehicle that blew up is "car"
    {
        DestroyVehicle(vehicleid); //delete the vehicle (so it won't respawn)
    }
    return 1;
}
Reply


Messages In This Thread
Create vehicles ingame - by jop9888 - 13.05.2012, 17:41
Re: Create vehicles ingame - by Jonny5 - 13.05.2012, 17:46
Re: Create vehicles ingame - by jop9888 - 13.05.2012, 17:59
Re: Create vehicles ingame - by Jonny5 - 13.05.2012, 18:20
Re: Create vehicles ingame - by jop9888 - 13.05.2012, 18:45
Re: Create vehicles ingame - by Jonny5 - 13.05.2012, 18:52
Re: Create vehicles ingame - by Yuryfury - 13.05.2012, 19:40
Re: Create vehicles ingame - by jop9888 - 20.05.2012, 23:14

Forum Jump:


Users browsing this thread: 3 Guest(s)