Help with AttachObjectToVehicle
#1

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.

Код:
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;
}
Reply
#2

Pretty sure It's a SAMP issue, your code is fine.
Reply
#3

Because the object doesn't stream until you move. You can use Streamer_Update if you use the streamer plugin.
Reply
#4

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
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?
Reply
#5

Use Streamer_Update(playerid); after you spawn the object.
Reply
#6

Streamer_Update(playerid, type = 0 = TYPE_OBJECT);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)