How To Make Objective Vehicles
#1

Hi. i know you didnt understand what i m askin you to Help me But i ll explain..

i Want To Make a TDM (team dm) Script :
LS Airport team VS LV Airport team


And Hope to Host it ..

The objective is stealing other Team Plane and Get it back to base ..
i v maked evry thing exept This Hard Step : i need pawn code that Make The objective plane..An Objective plane.
Hope You Help me
if You Didnt Understand What i m asking. reply
Reply
#2

dude no one will make that for free
Reply
#3

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.
}
Reply
#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
#5

I'm obviously not going to write any more code for you on this specific issue. Although I do offer coding for money, I wrote the previous just to help you understand a little.
Reply
#6

Quote:
Originally Posted by AndreT
Посмотреть сообщение
I'm obviously not going to write any more code for you on this specific issue. Although I do offer coding for money, I wrote the previous just to help you understand a little.
okay
Reply
#7

Meh, just open the Rivershell gamemode that comes with the server pack and adjust to your needs. It's the same type of capture-the-vehicle gamemode.
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
Meh, just open the Rivershell gamemode that comes with the server pack and adjust to your needs. It's the same type of capture-the-vehicle gamemode.
Thank You So Much , it works Great !
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)