SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 27/12/2018, 01:02 PM   #11
Heress
Huge Clucker
 
Heress's Avatar
 
Join Date: Mar 2018
Location: Lithuania
Posts: 262
Reputation: 7
Default Re: attach

Quote:
Originally Posted by AlfaSufaIndo View Post
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); 

Who said what i dont use it? go up...
__________________
==============
Sorry for my bad English









Respect: Kalcor, ******. Thank you for this great game!
Heress is offline   Reply With Quote
Old 27/12/2018, 03:11 PM   #12
InsaneBR
Big Clucker
 
InsaneBR's Avatar
 
Join Date: Feb 2018
Posts: 104
Reputation: 8
Default Re: attach

1. Try use the callback OnVehicleStreamIn to attach the trailer for player.

2. Use command to attach the trailer in the player vehicle
InsaneBR is offline   Reply With Quote
Old 27/12/2018, 03:30 PM   #13
Heress
Huge Clucker
 
Heress's Avatar
 
Join Date: Mar 2018
Location: Lithuania
Posts: 262
Reputation: 7
Default Re: attach

Quote:
Originally Posted by InsaneBR View Post
1. Try use the callback OnVehicleStreamIn to attach the trailer for player.

You found it on wiki

2. Use command to attach the trailer in the player vehicle
No i need attach without command (ongamemodeinit or onplayerconnect)
__________________
==============
Sorry for my bad English









Respect: Kalcor, ******. Thank you for this great game!
Heress is offline   Reply With Quote
Old 28/12/2018, 01:06 PM   #14
InsaneBR
Big Clucker
 
InsaneBR's Avatar
 
Join Date: Feb 2018
Posts: 104
Reputation: 8
Default Re: attach

Quote:
Originally Posted by Heress View Post
No i need attach without command (ongamemodeinit or onplayerconnect)
You can try method 1.
The only way I can imagine is to set the player's camera in the vehicles/trailers area in the OnPlayerRequestClass callback, and then spawn the player in their original position. Even so, one should check if atach will remain after VehicleStreamOut and VehicleStreamIn again.

note: I don't know if it will work, but you not will lose much time to testing it .

Anything send me PM.
InsaneBR is offline   Reply With Quote
Old 19/02/2019, 03:14 PM   #15
Heress
Huge Clucker
 
Heress's Avatar
 
Join Date: Mar 2018
Location: Lithuania
Posts: 262
Reputation: 7
Default Re: attach

Sorry what i write in this old thread but i have same problem. Utility trailer can be attached on Utility van so there's all good, but how to attach it on tug with no command? Can someone can give an example?

Code:
	nvtrailer[0] = CreateVehicle(611, -3790.3892, -1883.3661, 5.6122, 273.0000, 86, 86, 100);
	nvtrailer[1] = CreateVehicle(611, -3790.1970, -1886.2228, 5.6122, 273.0000, 86, 86, 100);
	nvtrailer[2] = CreateVehicle(611, -3789.9971, -1891.9280, 5.6122, 273.0000, 86, 86, 100);
	nvtrailer[3] = CreateVehicle(611, -3790.0215, -1889.2241, 5.6122, 273.0000, 86, 86, 100);
	nvtrailer[4] = CreateVehicle(611, -3786.7104, -1911.1266, 5.6122, 0.0000, 86, 86, 100);
	nvtrailer[5] = CreateVehicle(611, -3783.9299, -1911.1263, 5.6122, 0.0000, 86, 86, 100);
	nvtrailer[6] = CreateVehicle(611, -3780.9705, -1911.0824, 5.6122, 0.0000, 86, 86, 100);
	nvtrailer[7] = CreateVehicle(611, -3777.8892, -1911.0399, 5.6122, 0.0000, 86, 86, 100);
Code:
	NVTransportas[0] = CreateVehicle(552, -3777.2102, -1881.1045, 5.4652, 97.0000, 86, 86, 100);
	NVTransportas[1] = CreateVehicle(552, -3776.7327, -1885.2670, 5.4652, 97.0000, 86, 86, 100);
	NVTransportas[2] = CreateVehicle(552, -3776.2175, -1889.5054, 5.4652, 97.0000, 86, 86, 100);
	NVTransportas[3] = CreateVehicle(552, -3775.6274, -1893.9456, 5.4652, 97.0000, 86, 86, 100);
	NVTransportas[4] = CreateVehicle(583, -3774.1799, -1897.0842, 5.3037, 97.0000, 86, 86, 100);
	NVTransportas[5] = CreateVehicle(583, -3773.7610, -1899.8943, 5.3037, 97.0000, 86, 86, 100);
	NVTransportas[6] = CreateVehicle(583, -3773.3333, -1902.9445, 5.3037, 97.0000, 86, 86, 100);
	NVTransportas[7] = CreateVehicle(583, -3772.9575, -1905.7802, 5.3037, 97.0000, 86, 86, 100); << Tugs

Fixed, because i wrote cmd /attach and now working. I someone knows how to do that without command write it here.
__________________
==============
Sorry for my bad English









Respect: Kalcor, ******. Thank you for this great game!

Last edited by Heress; 19/02/2019 at 04:39 PM.
Heress is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help In attach Driver546465 Scripting Help 1 28/03/2015 01:41 AM
Attach obj Ananisiki Scripting Help 3 10/05/2014 12:31 AM
Need help for attach gekas Server Support 0 05/03/2014 10:37 AM
Attach help Er@x3r Scripting Help 4 16/01/2013 04:27 PM
/attach sorfa Help Archive 2 26/12/2009 05:08 PM


All times are GMT. The time now is 03:06 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.