SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 24/11/2017, 07:35 AM   #1
,TomY'
Big Clucker
 
Join Date: Dec 2011
Posts: 60
Reputation: 0
Question Help with AttachObjectToVehicle

Hi all. Have a problem with AttachObjectToVehicle. When I use my command, object does not appear. When I use command and then move on with car, then object appears. Why it does not appear when I just type my command? Why I need to move on with car? I tryed to change AttachObjectToVehicle and CreateObject to Dynamic, but still same.

Code:
CMD:taxi(playerid)
{
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, ""COL_ERROR"{ffffff}Need be in car!");

	new vehicleid = PI[playerid][car];

	Object[playerid] 		= CreateObject(19308, 0, 0, 0, 0, 0, 0);

	AttachObjectToVehicle(Object[playerid], vehicleid, 0.019999, -0.070000, 0.934999, -0.000000, 0.000000, -90.000000);
	return 1;
}
,TomY' is offline   Reply With Quote
Old 24/11/2017, 09:01 AM   #2
PaulDinam
Gangsta
 
Join Date: Jun 2011
Posts: 897
Reputation: 45
Default Re: Help with AttachObjectToVehicle

Pretty sure It's a SAMP issue, your code is fine.
PaulDinam is offline   Reply With Quote
Old 24/11/2017, 09:18 AM   #3
Arthur Kane
Gangsta
 
Join Date: Sep 2012
Location: Los Angeles
Posts: 706
Reputation: 96
Default Re: Help with AttachObjectToVehicle

Because the object doesn't stream until you move. You can use Streamer_Update if you use the streamer plugin.
Arthur Kane is offline   Reply With Quote
Old 24/11/2017, 09:29 AM   #4
,TomY'
Big Clucker
 
Join Date: Dec 2011
Posts: 60
Reputation: 0
Default Re: Help with AttachObjectToVehicle

Quote:
Originally Posted by Arthur Kane View Post
Because the object doesn't stream until you move. You can use Streamer_Update if you use the streamer plugin.
Yes, I use streamer plugin. Can you help me with that? How I can use Streamer_Update?
,TomY' is offline   Reply With Quote
Old 24/11/2017, 09:39 AM   #5
Arthur Kane
Gangsta
 
Join Date: Sep 2012
Location: Los Angeles
Posts: 706
Reputation: 96
Default Re: Help with AttachObjectToVehicle

Use Streamer_Update(playerid); after you spawn the object.
Arthur Kane is offline   Reply With Quote
Old 24/11/2017, 10:03 AM   #6
PaulDinam
Gangsta
 
Join Date: Jun 2011
Posts: 897
Reputation: 45
Default Re: Help with AttachObjectToVehicle

Streamer_Update(playerid, type = 0 = TYPE_OBJECT);
PaulDinam 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
AttachObjectToVehicle nezo2001 Scripting Help 0 28/01/2015 10:19 AM
[Ajuda] AttachObjectToVehicle RDM Português/Portuguese 3 12/01/2015 04:44 PM
AttachObjectToVehicle little help LukasSLT Scripting Help 5 27/05/2012 08:25 AM
AttachObjectToVehicle TouhGear Scripting Help 4 01/04/2012 06:18 PM
AttachObjectToVehicle Dragony92 Help Archive 7 24/08/2011 10:41 AM


All times are GMT. The time now is 06:14 AM.


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