25.07.2015, 01:49
https://sampwiki.blast.hk/wiki/AttachObjectToVehicle
=
OnVehicleDeath
Terб que criar uma sirene para cada carro.
Exemplo:
OnVehicleDeath
PHP код:
new sirenteste = CreateObject( 11701,0,0,0,0,0,0,80 ); // sirene
PHP код:
AttachObjectToVehicle(sirenteste, ID DO VEICULO, 0.000000, 0.000000, 0.829999, 0.000000, 0.000000, 0.000000);
PHP код:
AttachObjectToVehicle(sirenteste, CopCarros[159], 0.000000, 0.000000, 0.829999, 0.000000, 0.000000, 0.000000);
PHP код:
DestroyDynamicObject( CopCarros[159], sirenteste );
Exemplo:
PHP код:
new sirenes[ 10 ]
PHP код:
new sirenes[ 0 ] = CreateObject( 11701,0,0,0,0,0,0,80 ); // sirene 1
new sirenes[ 1 ] = CreateObject( 11701,0,0,0,0,0,0,80 ); // sirene 2
new sirenes[ 2 ] = CreateObject( 11701,0,0,0,0,0,0,80 ); // sirene 3 etc..
PHP код:
AttachObjectToVehicle(sirenes[ 0 ], CopCarros[159], 0.000000, 0.000000, 0.829999, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(sirenes[ 1 ], CopCarros[160], 0.000000, 0.000000, 0.829999, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(sirenes[ 2 ], CopCarros[161], 0.000000, 0.000000, 0.829999, 0.000000, 0.000000, 0.000000); // Etc...
PHP код:
DestroyDynamicObject( CopCarros[159], sirenes[ 0 ] );
DestroyDynamicObject( CopCarros[160], sirenes[ 1 ] );
DestroyDynamicObject( CopCarros[161], sirenes[ 2 ] );