How To Make Objective Vehicles
#4

Quote:
Originally Posted by AndreT
Посмотреть сообщение
You will need to create a vehicle and store its ID in a variable, for example:
pawn Код:
// above main()
new veh_LSairport = INVALID_VEHICLE_ID;

// whereever your gamemode round loads
if(veh_LSairport != INVALID_VEHICLE_ID)
{
    // if the vehicle already exists, destroy it (to avoid vehicles "piling up")
    DestroyVehicle(veh_LSairport);
}
// create a new vehicle
veh_LSairport = CreateVehicle(...);
Now that the vehicle is streamed in for a player, OnVehicleStreamIn is called. I will use this method to avoid having to create an array for vehicles holding the data. Note that the information set to a vehicle for a player has to be set every time the vehicle streams in for the player.
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(vehicleid == veh_LSairport // if the vehicle is the "marked" vehicle
    && gTeam[forplayerid] == TEAM_SFAIRPORT) // if the player is in the SF airport team
    {
        SetVehicleParamsForPlayer(vehicleid, forplayerid, 1, 0);
    }
    // add an "else if" statement here to continue with the objective vehicle for the LS airport team.
}
Thanks , That was usful , Can i PM you for More Information ?
Reply


Messages In This Thread
How To Make Objective Vehicles - by trick_master - 09.03.2012, 17:03
Re: How To Make Objective Vehicles - by Tom1412 - 09.03.2012, 17:29
Re: How To Make Objective Vehicles - by AndreT - 09.03.2012, 17:36
Re: How To Make Objective Vehicles - by trick_master - 09.03.2012, 19:00
Re: How To Make Objective Vehicles - by AndreT - 09.03.2012, 19:13
Re: How To Make Objective Vehicles - by trick_master - 09.03.2012, 19:25
Re: How To Make Objective Vehicles - by Vince - 09.03.2012, 19:34
Re: How To Make Objective Vehicles - by trick_master - 12.03.2012, 11:17

Forum Jump:


Users browsing this thread: 2 Guest(s)