SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 10/10/2019, 11:27 PM   #1
Pitstop
Little Clucker
 
Join Date: Aug 2015
Posts: 23
Reputation: 0
Default DestroyDynamicObject BUG.

Hey guys.

I have the newest streamer include and plugin.
I have a bug when I remove an object from a car I get a fucking weird object on the car.
And then if I change a car the objects goes with me it likes PlayerObject that created as a bug. happened to someone ?
Pitstop is online now   Reply With Quote
Old 11/10/2019, 01:23 AM   #2
KittyChloe
Little Clucker
 
KittyChloe's Avatar
 
Join Date: Oct 2019
Posts: 26
Reputation: 13
Default Re: DestroyDynamicObject BUG.

Can you provide a screenshot and a snippet of your code?
__________________
KittyChloe is offline   Reply With Quote
Old 11/10/2019, 06:46 PM   #3
Pitstop
Little Clucker
 
Join Date: Aug 2015
Posts: 23
Reputation: 0
Default Re: DestroyDynamicObject BUG.

Quote:
Originally Posted by KittyChloe View Post
Can you provide a screenshot and a snippet of your code?
Code:
SetPVarInt(playerid, "SirenEditorVehicleID", vehicleid);

		ShowPlayerDialogEx(playerid, DIALOG_SIREN_EDITOR, DIALOG_STYLE_LIST, "Sirens", "Add\nRemove a", "Select","Exit");

		new count = 0;
		for(new i = 0; i < MAX_VEHICLE_SIREN_OBJECTS; i++)
		{
			if(VehicleInfo[GetPlayerVehicleID(playerid)][vSirenObject][i] != 0)
			{

				AttachDynamicObjectToVehicle(VehicleInfo[vehicleid][vSirenObject][i], GetPlayerVehicleID(playerid),
				VehicleInfo[vehicleid][vSirenX][i], VehicleInfo[vehicleid][vSirenY][i], VehicleInfo[vehicleid][vSirenZ][i],
				VehicleInfo[vehicleid][vSirenXr][i], VehicleInfo[vehicleid][vSirenYr][i], VehicleInfo[vehicleid][vSirenZr][i]);
				count++;
			}
		}

		if(count > 0)
		{
			new Float:X, Float:Y, Float:Z;
			GetVehicleVelocity(vehicleid, X, Y, Z);
			if(X == 0 && Y == 0 && Z == 0)
			{
				SetVehicleVelocity(vehicleid, X, Y, Z + 0.01);
			}
		}
	}
This.
When there is one object on the vehicle and I try to add one more through /xx "edit" it create a weird object.
Pitstop is online now   Reply With Quote
Old 14/10/2019, 06:46 AM   #4
Pitstop
Little Clucker
 
Join Date: Aug 2015
Posts: 23
Reputation: 0
Default Re: DestroyDynamicObject BUG.

Up..
Pitstop is online now   Reply With Quote
Old 17/10/2019, 04:05 AM   #5
Pitstop
Little Clucker
 
Join Date: Aug 2015
Posts: 23
Reputation: 0
Default Re: DestroyDynamicObject BUG.

One more code, here's the problem.

Code:
if(!IsPlayerInAnyVehicle(playerid)) return 1;
				new vehicleid = GetPlayerVehicleID(playerid);

	            new Float:ofx, Float:ofy, Float:ofz, Float:ofaz,
			    Float:finalx, Float:finaly,
			    Float:px, Float:py, Float:pz, Float:roz;
			    GetVehiclePos(GetPlayerVehicleID(playerid), px, py, pz);
			    GetVehicleZAngle(GetPlayerVehicleID(playerid), roz);

			    ofx = fX-px;
			    ofy = fY-py;
			    ofz = fZ-pz;
			    ofaz = fRotZ-roz;
			    finalx = ofx*floatcos(roz, degrees)+ofy*floatsin(roz, degrees);
			    finaly = -ofx*floatsin(roz, degrees)+ofy*floatcos(roz, degrees);

			    for(new i = 0; i < MAX_VEHICLE_SIREN_OBJECTS; i++)
			    {
			    	if(VehicleInfo[vehicleid][vSirenObject][i] == 0)
			    	{
			    		VehicleInfo[vehicleid][vSirenObject][i] = GetPVarInt(playerid, "SirenModel");
			    		VehicleInfo[vehicleid][vSirenObjectID][i] = CreateDynamicObject(GetPVarInt(playerid, "SirenModel"), 0, 0, 0, 0.0, 0.0, 0.0);

			    		VehicleInfo[vehicleid][vSirenX][i] = finalx;
					    VehicleInfo[vehicleid][vSirenY][i] = finaly;
					    VehicleInfo[vehicleid][vSirenZ][i] = ofz;
					    VehicleInfo[vehicleid][vSirenXr][i] = fRotX;
					    VehicleInfo[vehicleid][vSirenYr][i] = fRotY;
					    VehicleInfo[vehicleid][vSirenZr][i] = ofaz;

					    AttachDynamicObjectToVehicle(VehicleInfo[vehicleid][vSirenObjectID][i], vehicleid,
					    	VehicleInfo[vehicleid][vSirenX][i], VehicleInfo[vehicleid][vSirenY][i], VehicleInfo[vehicleid][vSirenZ][i],
					    	VehicleInfo[vehicleid][vSirenXr][i], VehicleInfo[vehicleid][vSirenYr][i], VehicleInfo[vehicleid][vSirenZr][i]);

Something wrong here? It's just create to me a weird object...
Pitstop is online now   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
DestroyDynamicObject MerryDeer Scripting Help 5 01/03/2017 02:53 AM
DestroyDynamicObject MerryDeer Scripting Help 1 18/10/2016 11:55 PM
DestroyDynamicObject Ugaustin Scripting Help 6 23/03/2015 02:53 PM
CreateDynamicObject & DestroyDynamicObject Nourdin Scripting Help 6 15/01/2014 06:42 PM


All times are GMT. The time now is 02:04 PM.


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