Components
#1

I know add to one or two.. cars components.But how to add one type of car some component..All infernus get some wheels or all taxi's get nitro..?
Reply
#2

in your function:
MODEL = your model
pawn Код:
if(GetVehicleModel(vehicleid) == MODEL) {
   AddVehicleComponent(vehicleid,....);
}
Reply
#3

dont work
Reply
#4

**bump**
Reply
#5

here this one:

Код:
new vehicle;
 
public OnGameModeInit( )
{
    vehicle = AddStaticVehicle(420,-2482.4937,2242.3936,4.6225,179.3656,6,1); // Taxi
    return 1;
}
 
public OnPlayerEnterVehicle (playerid, vehicleid)
{
    if (vehicleid == vehicle)
    {
        AddVehicleComponent(vehicle, 1010); // Nitro
        SendClientMessage(playerid, 0xFFFFFFAA, "Nitro added to the Taxi.");
    }
    return 1;
}
Reply
#6

I dont need this guys...
I know all that what you posted.
Anyone else know what i need??
I want...

Код:
AddStaticVehicle(411,x,y,z,ang,0,0);
AddStaticVehicle(411,x,y,z,ang,0,0);
AddStaticVehicle(411,x,y,z,ang,0,0);
AddStaticVehicle(411,x,y,z,ang,0,0);
AddStaticVehicle(411,x,y,z,ang,0,0);
To all those infernus get some component what i chose.

I dont want do...
Код:
infernus1 = AddStaticVehicle(411,x,y,z,ang,0,0);
infernus2 = AddStaticVehicle(411,x,y,z,ang,0,0);
...

AddVehicleComponent(infernus1, somecomponent); 
AddVehicleComponent(infernus2, somecomponent); 
....
Cuz on server i have lot infernus or some other car model.
Reply
#7

You mean a function like this?

AddStaticVehicleCompenent(modelid, x, y, z, color1, color2, component1, component2);

If so, Its here




EDIT : 500 POSTS.
Reply
#8

I think he means that he want all in one line.

If I'm correct, here's how:

pawn Код:
//on top
new infernus[ number_of_infernus's_ingame ];
pawn Код:
//gamemodeinit
infernus[ 0 ] = AddStaticVehicle( ... );
infernus[ 1 ] = AddStaticVehicle( ... );
pawn Код:
//where you want the components to be added
for( new i = 0; i < sizeof( infernus ); i++ )
{
    AddVehicleComponent( infernus[ i ], component );
    //more if you want
}
Reply
#9

Quote:
Originally Posted by LarzI
Посмотреть сообщение
I think he means that he want all in one line.

If I'm correct, here's how:

pawn Код:
//on top
new infernus[ number_of_infernus's_ingame ];
pawn Код:
//gamemodeinit
infernus[ 0 ] = AddStaticVehicle( ... );
infernus[ 1 ] = AddStaticVehicle( ... );
pawn Код:
//where you want the components to be added
for( new i = 0; i < sizeof( infernus ); i++ )
{
    AddVehicleComponent( infernus[ i ], component );
    //more if you want
}
Thanks!
Reply
#10

No problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)