attach -
Heress - 22.12.2018
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?
Re: attach -
InsaneBR - 22.12.2018
try
PHP Code:
new NVTransportas[4],
utilitytrailer[4]
;//out of callbacks
//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);
for(new x; x < 4; x++) AttachTrailerToVehicle(utilitytrailer[x], NVTransportas[x]);
Re: attach -
Heress - 23.12.2018
Quote:
Originally Posted by InsaneBR
try
PHP Code:
new NVTransportas[4],
utilitytrailer[4]
;//out of callbacks
//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);
for(new x; x < 4; x++) AttachTrailerToVehicle(utilitytrailer[x], NVTransportas[x]);
|
No it don't work. Trailer is not attaching OnGameModeInit...
https://imgur.com/a/NwCDkoX
Re: attach -
Deken - 23.12.2018
try making a timer and when timer end then try to attach trailer in public timerend?
Re: attach -
Heress - 23.12.2018
Quote:
Originally Posted by Deken
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);
}
|
Re: attach -
Deken - 23.12.2018
i made it like this make it like in your code AttachTrailerToVehicle(newTrailer[playerid], vehicleid);
Re: attach -
Heress - 23.12.2018
Quote:
Originally Posted by Deken
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.... :/
Re: attach -
AlfaSufaIndo - 23.12.2018
Quote:
Originally Posted by Heress
"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.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);
//--------------------------------------------------------------------------------------------------------//
utilitytrailer1[playerid] = CreateVehicle(611, -3775.2961, -1880.6464, 5.4584, 90.0000, -1, -1, 100);
utilitytrailer2[playerid] = CreateVehicle(611, -3775.0056, -1884.0587, 5.4584, 90.0000, -1, -1, 100);
utilitytrailer3[playerid] = CreateVehicle(611, -3774.0906, -1890.9784, 5.4584, 90.0000, -1, -1, 100);
utilitytrailer4[playerid] = CreateVehicle(611, -3774.3333, -1887.6206, 5.4584, 90.0000, -1, -1, 100);
//--------------------------------------------------------------------------------------------------------//
AttachTrailerToVehicle(utilitytrailer1[playerid], vehid1);
AttachTrailerToVehicle(utilitytrailer2[playerid], vehid2);
AttachTrailerToVehicle(utilitytrailer3[playerid], vehid3);
AttachTrailerToVehicle(utilitytrailer4[playerid], vehid4);
As Deken said
Re: attach -
AlfaSufaIndo - 23.12.2018
Wait, why don't you just use this?
PHP Code:
new NVTransportas[4];
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);
Re: attach -
Heress - 27.12.2018
Quote:
Originally Posted by AlfaSufaIndo
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.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);
//--------------------------------------------------------------------------------------------------------//
utilitytrailer1[playerid] = CreateVehicle(611, -3775.2961, -1880.6464, 5.4584, 90.0000, -1, -1, 100);
utilitytrailer2[playerid] = CreateVehicle(611, -3775.0056, -1884.0587, 5.4584, 90.0000, -1, -1, 100);
utilitytrailer3[playerid] = CreateVehicle(611, -3774.0906, -1890.9784, 5.4584, 90.0000, -1, -1, 100);
utilitytrailer4[playerid] = CreateVehicle(611, -3774.3333, -1887.6206, 5.4584, 90.0000, -1, -1, 100);
//--------------------------------------------------------------------------------------------------------//
AttachTrailerToVehicle(utilitytrailer1[playerid], vehid1);
AttachTrailerToVehicle(utilitytrailer2[playerid], vehid2);
AttachTrailerToVehicle(utilitytrailer3[playerid], vehid3);
AttachTrailerToVehicle(utilitytrailer4[playerid], vehid4);
As Deken said
|
OnGameModeInit dont have playerid...