SA-MP Forums Archive
Components - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Components (/showthread.php?tid=175644)



Components - Dime - 10.09.2010

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..?


Re: Components - CAR - 10.09.2010

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



Re: Components - Dime - 10.09.2010

dont work


Re: Components - Dime - 11.09.2010

**bump**


Re: Components - [Lsrcr]Rafa - 11.09.2010

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;
}



Re: Components - Dime - 12.09.2010

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.


Re: Components - Retardedwolf - 12.09.2010

You mean a function like this?

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

If so, Its here




EDIT : 500 POSTS.


Re: Components - LarzI - 12.09.2010

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
}



Re: Components - Dime - 12.09.2010

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!


Re: Components - LarzI - 12.09.2010

No problem