samp-incognito / samp-streamer-plugin

Streamer Plugin for SA-MP (San Andreas Multiplayer)
Apache License 2.0
236 stars 92 forks source link

AttachDynamicObjectToVehicle cant EditDynamicObject #377

Open PutuSuhartawan opened 3 years ago

PutuSuhartawan commented 3 years ago

I was atached with same ID. but i have problem while wanna edit with moving tools. The object stuck with same coordinat.

the script. //AttachObjectToVehicle(objectid, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:RotX, Float:RotY, Float:RotZ) pInfo[playerid][pNeon] = AttachDynamicObjectToVehicle( contohdikendaraan, GetPlayerVehicleID(playerid)); / Float:0.0, // kanan kiri Float:-2.0, // kedepan Float:0.0, // ke atas Float:2.0, Float:0.0, Float:0.0); / //AttachDynamicObjectToVehicle(STREAMER_TAG_OBJECT objectid, vehicleid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz) //EditPlayerObject(playerid, objectid); //RemovePlayerFromVehicle(playerid); //EditAttachedObject(playerid, idterttach); //EditObject(playerid, contohdikendaraan); //contohdikendaraan = false; //Streamer_SetIntData(STREAMER_TYPE_OBJECT, contohdikendaraan, E_STREAMER_ATTACHED_VEHICLE, 2); //Streamer_SetFloatData( //SetDynamicObjectMaterial(contohdikendaraan, 0, 10765, "airportgnd_sfse", "white", -256); EditDynamicObject(playerid, contohdikendaraan); Streamer_Update(playerid);

IstuntmanI commented 3 years ago

If I remember correctly, SA-MP's EditPlayerObject won't work as expected if AttachPlayerObjectToVehicle (these SA-MP functions are used internally by this plugin) was successfully used on the object before, so this is what may happen in your case too.

You may want to test SA-MP's behavior when using the functions I mentioned. If the problem stays the same, then it can't be fixed by the Streamer Plugin. Instead, you would have to find a workaround. You may want to freeze the player in the vehicle, disable vehicle's object attachment (and set object's position exactly where it was when attached, if it won't stay in the same place by default), then you have to allow the player to edit the object and then, when everything is done, apply some transformations to actually reattach the object correctly to the vehicle. It can get pretty tricky.