Help with AttachObjectToVehicle - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with AttachObjectToVehicle (
/showthread.php?tid=645265)
Help with AttachObjectToVehicle -
,TomY' - 24.11.2017
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;
}
Re: Help with AttachObjectToVehicle -
PaulDinam - 24.11.2017
Pretty sure It's a SAMP issue, your code is fine.
Re: Help with AttachObjectToVehicle -
Kane - 24.11.2017
Because the object doesn't stream until you move. You can use Streamer_Update if you use the streamer plugin.
Re: Help with AttachObjectToVehicle -
,TomY' - 24.11.2017
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?
Re: Help with AttachObjectToVehicle -
Kane - 24.11.2017
Use
Streamer_Update(playerid); after you spawn the object.
Re: Help with AttachObjectToVehicle -
PaulDinam - 24.11.2017
Streamer_Update(playerid, type = 0 = TYPE_OBJECT);