attach
#1

new vehid1 = NVTransportas[0] = CreateVehicle(583, -3779.2019, -1880.6560, 5.2844, 90.0000, -1, -1, 100);
new vehid2 = NVTransportas[1] = CreateVehicle(583, -3778.9314, -1884.0042, 5.2844, 90.0000, -1, -1, 100);
new vehid3 = NVTransportas[2] = CreateVehicle(583, -3778.3508, -1887.5313, 5.2844, 90.0000, -1, -1, 100);
new vehid4 = NVTransportas[3] = CreateVehicle(583, -3777.9119, -1890.9458, 5.2844, 90.0000, -1, -1, 100);
//--------------------------------------------------------------------------------------------------------//
new utilitytrailer1 = CreateVehicle(611, -3775.2961, -1880.6464, 5.4584, 90.0000, -1, -1, 100);
new utilitytrailer2 = CreateVehicle(611, -3775.0056, -1884.0587, 5.4584, 90.0000, -1, -1, 100);
new utilitytrailer3 = CreateVehicle(611, -3774.0906, -1890.9784, 5.4584, 90.0000, -1, -1, 100);
new utilitytrailer4 = CreateVehicle(611, -3774.3333, -1887.6206, 5.4584, 90.0000, -1, -1, 100);
//--------------------------------------------------------------------------------------------------------//

AttachTrailerToVehicle(utilitytrailer1, vehid1);
AttachTrailerToVehicle(utilitytrailer2, vehid2);
AttachTrailerToVehicle(utilitytrailer3, vehid3);
AttachTrailerToVehicle(utilitytrailer4, vehid4);

Why attach is not working?
Reply
#2

try
PHP Code:
new NVTransportas[4],
    
utilitytrailer[4]
;
//out of callbacks
//OnGameModeInit
NVTransportas[0] = CreateVehicle(583, -3779.2019, -1880.65605.284490.0000, -1, -1100);
NVTransportas[1] = CreateVehicle(583, -3778.9314, -1884.00425.284490.0000, -1, -1100);
NVTransportas[2] = CreateVehicle(583, -3778.3508, -1887.53135.284490.0000, -1, -1100);
NVTransportas[3] = CreateVehicle(583, -3777.9119, -1890.94585.284490.0000, -1, -1100);
utilitytrailer[0] = CreateVehicle(611, -3775.2961, -1880.64645.458490.0000, -1, -1100);
utilitytrailer[1] = CreateVehicle(611, -3775.0056, -1884.05875.458490.0000, -1, -1100);
utilitytrailer[2] = CreateVehicle(611, -3774.0906, -1890.97845.458490.0000, -1, -1100);
utilitytrailer[3] = CreateVehicle(611, -3774.3333, -1887.62065.458490.0000, -1, -1100);
    
for(new 
x4x++) AttachTrailerToVehicle(utilitytrailer[x], NVTransportas[x]); 
Reply
#3

Quote:
Originally Posted by InsaneBR
View Post
try
PHP Code:
new NVTransportas[4],
    
utilitytrailer[4]
;
//out of callbacks
//OnGameModeInit
NVTransportas[0] = CreateVehicle(583, -3779.2019, -1880.65605.284490.0000, -1, -1100);
NVTransportas[1] = CreateVehicle(583, -3778.9314, -1884.00425.284490.0000, -1, -1100);
NVTransportas[2] = CreateVehicle(583, -3778.3508, -1887.53135.284490.0000, -1, -1100);
NVTransportas[3] = CreateVehicle(583, -3777.9119, -1890.94585.284490.0000, -1, -1100);
utilitytrailer[0] = CreateVehicle(611, -3775.2961, -1880.64645.458490.0000, -1, -1100);
utilitytrailer[1] = CreateVehicle(611, -3775.0056, -1884.05875.458490.0000, -1, -1100);
utilitytrailer[2] = CreateVehicle(611, -3774.0906, -1890.97845.458490.0000, -1, -1100);
utilitytrailer[3] = CreateVehicle(611, -3774.3333, -1887.62065.458490.0000, -1, -1100);
    
for(new 
x4x++) AttachTrailerToVehicle(utilitytrailer[x], NVTransportas[x]); 
No it don't work. Trailer is not attaching OnGameModeInit...
https://imgur.com/a/NwCDkoX
Reply
#4

try making a timer and when timer end then try to attach trailer in public timerend?
Reply
#5

Quote:
Originally Posted by Deken
View Post
try making a timer and when timer end then try to attach trailer in public timerend?
Nope

Quote:

forward OnTrailerAttached();

public OnTrailerAttached()
{
for(new x; x < 4; x++) AttachTrailerToVehicle(utilitytrailer[x], NVTransportas[x]);
}

new NVTransportas[4];
new utilitytrailer[4];

OnGameModeInit()
{
NVTransportas[0] = CreateVehicle(583, -3779.2019, -1880.6560, 5.2844, 90.0000, -1, -1, 100);
NVTransportas[1] = CreateVehicle(583, -3778.9314, -1884.0042, 5.2844, 90.0000, -1, -1, 100);
NVTransportas[2] = CreateVehicle(583, -3778.3508, -1887.5313, 5.2844, 90.0000, -1, -1, 100);
NVTransportas[3] = CreateVehicle(583, -3777.9119, -1890.9458, 5.2844, 90.0000, -1, -1, 100);

utilitytrailer[0] = CreateVehicle(611, -3775.2961, -1880.6464, 5.4584, 90.0000, -1, -1, 100);
utilitytrailer[1] = CreateVehicle(611, -3775.0056, -1884.0587, 5.4584, 90.0000, -1, -1, 100);
utilitytrailer[2] = CreateVehicle(611, -3774.0906, -1890.9784, 5.4584, 90.0000, -1, -1, 100);
utilitytrailer[3] = CreateVehicle(611, -3774.3333, -1887.6206, 5.4584, 90.0000, -1, -1, 100);

SetTimer("OnTrailerAttached", 5000, false);
}

Reply
#6

i made it like this make it like in your code AttachTrailerToVehicle(newTrailer[playerid], vehicleid);
Reply
#7

Quote:
Originally Posted by Deken
View Post
i made it like this make it like in your code AttachTrailerToVehicle(newTrailer[playerid], vehicleid);
"i made it like this make it like in your code" sorry but i dont understand this sentence.... :/
Reply
#8

Quote:
Originally Posted by Heress
View Post
"i made it like this make it like in your code" sorry but i dont understand this sentence.... :/
PHP Code:
new utilitytrailer1[MAX_PLAYERS];
new 
utilitytrailer2[MAX_PLAYERS];
new 
utilitytrailer3[MAX_PLAYERS];
new 
utilitytrailer4[MAX_PLAYERS];
new 
vehid1 NVTransportas[0] = CreateVehicle(583, -3779.2019, -1880.65605.284490.0000, -1, -1100);
new 
vehid2 NVTransportas[1] = CreateVehicle(583, -3778.9314, -1884.00425.284490.0000, -1, -1100);
new 
vehid3 NVTransportas[2] = CreateVehicle(583, -3778.3508, -1887.53135.284490.0000, -1, -1100);
new 
vehid4 NVTransportas[3] = CreateVehicle(583, -3777.9119, -1890.94585.284490.0000, -1, -1100);
//--------------------------------------------------------------------------------------------------------//
utilitytrailer1[playerid] = CreateVehicle(611, -3775.2961, -1880.64645.458490.0000, -1, -1100);
utilitytrailer2[playerid] = CreateVehicle(611, -3775.0056, -1884.05875.458490.0000, -1, -1100);
utilitytrailer3[playerid] = CreateVehicle(611, -3774.0906, -1890.97845.458490.0000, -1, -1100);
utilitytrailer4[playerid] = CreateVehicle(611, -3774.3333, -1887.62065.458490.0000, -1, -1100);
//--------------------------------------------------------------------------------------------------------//
AttachTrailerToVehicle(utilitytrailer1[playerid], vehid1);
AttachTrailerToVehicle(utilitytrailer2[playerid], vehid2);
AttachTrailerToVehicle(utilitytrailer3[playerid], vehid3);
AttachTrailerToVehicle(utilitytrailer4[playerid], vehid4); 
As Deken said
Reply
#9

Wait, why don't you just use this?

PHP Code:
new NVTransportas[4];
NVTransportas[0] = CreateVehicle(583, -3779.2019, -1880.65605.284490.0000, -1, -1100); 
NVTransportas[1] = CreateVehicle(583, -3778.9314, -1884.00425.284490.0000, -1, -1100); 
NVTransportas[2] = CreateVehicle(583, -3778.3508, -1887.53135.284490.0000, -1, -1100); 
NVTransportas[3] = CreateVehicle(583, -3777.9119, -1890.94585.284490.0000, -1, -1100); 
Reply
#10

Quote:
Originally Posted by AlfaSufaIndo
View Post
PHP Code:
new utilitytrailer1[MAX_PLAYERS];
new 
utilitytrailer2[MAX_PLAYERS];
new 
utilitytrailer3[MAX_PLAYERS];
new 
utilitytrailer4[MAX_PLAYERS];
new 
vehid1 NVTransportas[0] = CreateVehicle(583, -3779.2019, -1880.65605.284490.0000, -1, -1100);
new 
vehid2 NVTransportas[1] = CreateVehicle(583, -3778.9314, -1884.00425.284490.0000, -1, -1100);
new 
vehid3 NVTransportas[2] = CreateVehicle(583, -3778.3508, -1887.53135.284490.0000, -1, -1100);
new 
vehid4 NVTransportas[3] = CreateVehicle(583, -3777.9119, -1890.94585.284490.0000, -1, -1100);
//--------------------------------------------------------------------------------------------------------//
utilitytrailer1[playerid] = CreateVehicle(611, -3775.2961, -1880.64645.458490.0000, -1, -1100);
utilitytrailer2[playerid] = CreateVehicle(611, -3775.0056, -1884.05875.458490.0000, -1, -1100);
utilitytrailer3[playerid] = CreateVehicle(611, -3774.0906, -1890.97845.458490.0000, -1, -1100);
utilitytrailer4[playerid] = CreateVehicle(611, -3774.3333, -1887.62065.458490.0000, -1, -1100);
//--------------------------------------------------------------------------------------------------------//
AttachTrailerToVehicle(utilitytrailer1[playerid], vehid1);
AttachTrailerToVehicle(utilitytrailer2[playerid], vehid2);
AttachTrailerToVehicle(utilitytrailer3[playerid], vehid3);
AttachTrailerToVehicle(utilitytrailer4[playerid], vehid4); 
As Deken said
OnGameModeInit dont have playerid...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)