How to fix symbol already defined: "OnPlayerEditDynamicObject"
#1

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;
}
Reply
#2

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

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);

Reply
#4

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.
Reply
#5

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 !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)