SA-MP Forums Archive
How to fix symbol already defined: "OnPlayerEditDynamicObject" - 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: How to fix symbol already defined: "OnPlayerEditDynamicObject" (/showthread.php?tid=601193)



How to fix symbol already defined: "OnPlayerEditDynamicObject" - biaprot - 18.02.2016

How to fix symbol already defined: "OnPlayerEditDynamicObject" , my code :

Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
	new idx = gGateEditID[playerid], string[128];
	if(response == EDIT_RESPONSE_UPDATE)
	{
		SetDynamicObjectPos(objectid, x, y, z);
		SetDynamicObjectRot(objectid, rx, ry, rz);
	}
	else if(response == EDIT_RESPONSE_CANCEL)
	{
	    if(gGateEdit[playerid] == 1)
	    {
		SetDynamicObjectPos(objectid, gGatePos[playerid][0], gGatePos[playerid][1], gGatePos[playerid][2]);
		SetDynamicObjectRot(objectid, gGateRot[playerid][0], gGateRot[playerid][1], gGateRot[playerid][2]);
		gGatePos[playerid][0] = 0; gGatePos[playerid][1] = 0; gGatePos[playerid][2] = 0;
		gGateRot[playerid][0] = 0; gGateRot[playerid][1] = 0; gGateRot[playerid][2] = 0;
		format(string, sizeof(string), "You have cancelled editing gate ID %d.", idx);
		SendClientMessage(playerid, 0xFFFFFF00, string);
		gGateEdit[playerid] = 0;
		gGateEditID[playerid] = 0;
		return 1;
		}
		else if(gGateEdit[playerid] == 2)
	    {
		SetDynamicObjectPos(objectid, gGatePos[playerid][0], gGatePos[playerid][1], gGatePos[playerid][2]);
		SetDynamicObjectRot(objectid, gGateRot[playerid][0], gGateRot[playerid][1], gGateRot[playerid][2]);
		gGatePos[playerid][0] = 0; gGatePos[playerid][1] = 0; gGatePos[playerid][2] = 0;
		gGateRot[playerid][0] = 0; gGateRot[playerid][1] = 0; gGateRot[playerid][2] = 0;
		format(string, sizeof(string), "You have cancelled editing gate ID %d.", idx);
		SendClientMessage(playerid, 0xFFFFFF00, string);
		gGateEdit[playerid] = 0;
		gGateEditID[playerid] = 0;
		return 1;
		}
	}
	else if(response == EDIT_RESPONSE_FINAL)
	{
		SetDynamicObjectPos(objectid, x, y, z);
		SetDynamicObjectRot(objectid, rx, ry, rz);
		if(gGateEdit[playerid] == 1)
		{
			GateInfo[idx][gCX] = x;
			GateInfo[idx][gCY] = y;
			GateInfo[idx][gCZ] = z;
			GateInfo[idx][gCRX] = rx;
			GateInfo[idx][gCRY] = ry;
			GateInfo[idx][gCRZ] = rz;
			gGateEdit[playerid] = 0;
			gGateEditID[playerid] = 0;
			format(string, sizeof(string), "You have finished editing gate ID %d's closing position.", idx);
			SendClientMessage(playerid, 0xFFFFFF00, string);
			GateInfo[idx][gStatus] = 0;
			SaveGates();
			return 1;
		}
		else if(gGateEdit[playerid] == 2)
		{
			GateInfo[idx][gOX] = x;
			GateInfo[idx][gOY] = y;
			GateInfo[idx][gOZ] = z;
			GateInfo[idx][gORX] = rx;
			GateInfo[idx][gORY] = ry;
			GateInfo[idx][gORZ] = rz;
			gGateEdit[playerid] = 0;
			gGateEditID[playerid] = 0;
			format(string, sizeof(string), "You have finished editing gate ID %d's opening position.", idx);
			SendClientMessage(playerid, 0xFFFFFF00, string);
			GateInfo[idx][gStatus] = 1;
			SaveGates();
			return 1;
		}
	}
	return 1;
}



Re: How to fix symbol already defined: "OnPlayerEditDynamicObject" - FreAkeD - 18.02.2016

It's already used somewhere in your script, remove it.


Re: How to fix symbol already defined: "OnPlayerEditDynamicObject" - biaprot - 18.02.2016

Used in streamer @@! but i'm scared remove this will have error

Quote:

forward OnPlayerEditDynamicObject(playerid, STREAMER_TAG_OBJECT objectid, response, Float, Float:y, Float:z, Float:rx, Float:ry, Float:rz);




Re: How to fix symbol already defined: "OnPlayerEditDynamicObject" - Vince - 18.02.2016

That is a forward declaration and has nothing to do with it. The public is still used somewhere else. Has to be. Perhaps within a dodgy include that's not properly hooked.


Re: How to fix symbol already defined: "OnPlayerEditDynamicObject" - Amunra - 18.02.2016

One Public just can One definition in a script ,
So You Must move the Code in OnPlayerEditDynamicObject to Other OnPlayerEditDynamicObject and Keep do to Make OnPlayerEditDynamicObject Just One !