Szerző Téma: Jármű-Jármű összekötés  (Megtekintve 1642 alkalommal)

Jármű-Jármű összekötés
« Dátum: 2015. Július 13. - 20:52:18 »
0
Sziasztok! Azt milyen kóddal lehet megoldani hogy DFT-30-asra tudjak járművet attacholni? Láttam már ilyet afterlifeba de még nem is gondoltam rá.
Az ilyen attach vehicle to vehicle FS-el hagyjatok kérlek :)
« Utoljára szerkesztve: 2015. Július 13. - 21:10:30 írta MAЯTIN »

Jármű-Jármű összekötés
« Válasz #1 Dátum: 2015. Július 13. - 21:10:08 »
0
[gmod]Kategorizáltam![/gmod]
www.twitch.tv/almightymartin

Az év STAFF tagja - 2015
Az év RP szervere - 2015 - [rc-rp.hu]

Red County Role Play [rc-rp.hu] - Tulajdonos
Project San Andreas [psa.hu] - Főadminisztrátor
See MTA LV [see-game.com] - Admin 4

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Jármű-Jármű összekötés
« Válasz #2 Dátum: 2015. Július 13. - 22:46:22 »
0

Jármű-Jármű összekötés
« Válasz #3 Dátum: 2015. Július 14. - 02:09:34 »
0
Idézetet írta: Flash date=1436820382\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"55150\" data-ipsquote-contentclass=\"forums_Topic
https://wiki.sa-mp.com/wiki/AttachObjectToVehicle
 
Ezzel hogyan is kötném hozzá ?Object id helyett kocsi id-t irok ?

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Jármű-Jármű összekötés
« Válasz #4 Dátum: 2015. Július 14. - 02:12:34 »
0
objectid helyére egyértelmű. járműhöz meg pl:
new veh = CreateVehicle(...);
és a vehicleid helyéhez pedig így veh-t írsz.

Nem elérhető Alcatraz

  • 151
  • 4 éve tag.
    • Profil megtekintése
Jármű-Jármű összekötés
« Válasz #5 Dátum: 2015. Július 14. - 10:40:03 »
0
Utánanéztem, és ezt kaptam: http://pro-pawn.ru/showthread.php?11329-AttachVehicleToVehicle
Nem sokat értettem belőle(mivel orosz)de a kódot azért bemásolom.
 

//by Seregamil
native IsValidVehicle(vehicleid);
new vehicleAttached[ MAX_VEHICLES ] = { INVALID_VEHICLE_ID, ... };
new vehicleTimer[ MAX_VEHICLES ] ;
stock AttachVehicleToVehicle( vehicleid, to_vehicleid, Float: offsetX, Float: offsetY, Float: offsetZ, Float: offsetA, time = 100 ) {
    if( !IsValidVehicle( vehicleid ) || !IsValidVehicle( to_vehicleid ) )
        return INVALID_VEHICLE_ID ;
    if( vehicleAttached[ vehicleid ] != INVALID_VEHICLE_ID )
        return INVALID_VEHICLE_ID ;
       
    vehicleAttached[ vehicleid ] = to_vehicleid ;
    vehicleTimer[ vehicleid ] = SetTimerEx( \"updateVehiclesWithAttach\", time, false, \"iiffffi\", vehicleid, to_vehicleid, offsetX, offsetY, offsetZ, offsetA, time );
    return vehicleid ;
}
stock DeAttachVehicle( vehicleid ) {
    vehicleAttached[ vehicleid ] = INVALID_VEHICLE_ID ;
    KillTimer( vehicleTimer[ vehicleid ] );
}
forward updateVehiclesWithAttach( vehicleid, to_vehicleid, Float: offsetX, Float: offsetY, Float: offsetZ, Float: offsetA, time ) ;
public updateVehiclesWithAttach( vehicleid, to_vehicleid, Float: offsetX, Float: offsetY, Float: offsetZ, Float: offsetA, time ) {
    if( !IsValidVehicle( vehicleid ) || !IsValidVehicle( to_vehicleid ) )
        return ;
    new Float: x, Float: y, Float: z, Float: a ;
   
    GetVehiclePos( to_vehicleid, x, y, z );
    GetVehicleZAngle( to_vehicleid, a );
    SetVehiclePos( vehicleid, x + offsetX, y + offsetY, z + offsetZ );
    SetVehicleZAngle( vehicleid, a );
    vehicleTimer[ vehicleid ] = SetTimerEx( \"updateVehiclesWithAttach\", time, false, \"iifffi\", vehicleid, to_vehicleid, offsetX, offsetY, offsetZ, offsetA, time );

 


AttachVehicleToVehicle( vehicleid, to_vehicleid, Float: offsetX, Float: offsetY, Float: offsetZ, Float: offsetA, time = 100 )
DeAttachVehicle( vehicleid )

 
\"347839be01e244708a7926a262255411.png\"
(Nem teszteltem!)
« Utoljára szerkesztve: 2015. Július 14. - 10:47:10 írta Alcatraz »

Jármű-Jármű összekötés
« Válasz #6 Dátum: 2015. Július 14. - 12:33:06 »
0
Idézetet írta: Flash date=1436832754\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"55150\" data-ipsquote-contentclass=\"forums_Topic
objectid helyére egyértelmű. járműhöz meg pl:
new veh = CreateVehicle(...);
és a vehicleid helyéhez pedig így veh-t írsz.
 
Köszönöm. Megoldódott. Zárom

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal