Error with OnPlayerEditDynamicObject
#1

The error is
Код:
C:\Users\user\Desktop\New folder\filterscripts\map.pwn(1553) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
public OnPlayerEditDynamicObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
    new i;
	new Float:oldX, Float:oldY, Float:oldZ, Float:oldRotX, Float:oldRotY, Float:oldRotZ;
	GetDynamicObjectPos(objectid, oldX, oldY, oldZ);
	GetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
	if(!playerobject) // If this is a global object, sync the position for other players
	{
	    if(!IsValidObject(objectid)) return 1;
	    SetDynamicObjectPos(objectid, fX, fY, fZ);
        SetDynamicObjectRot(objectid, fRotX, fRotY, fRotZ);
	}

	if(response == EDIT_RESPONSE_FINAL)
	{
		new x = cobject[playerid][i];
		new Float:xx,Float:yy,Float:zz;
		new Float:rxx,Float:ryy,Float:rzz;
		EditDynamicObject(playerid,x);
		GetDynamicObjectRot(x,rxx,ryy,rzz);
		GetDynamicObjectPos(x,xx,yy,zz);
		SetDynamicObjectRot(x,rxx,ryy,rzz);
		SetDynamicObjectPos(x,xx,yy,zz);
	}

	if(response == EDIT_RESPONSE_CANCEL)
	{
		//The player cancelled, so put the object back to it's old position
		if(!playerobject) //Object is not a playerobject
		{
			SetDynamicObjectPos(objectid, oldX, oldY, oldZ);
			SetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
		}
	}
	return 1;
}
Reply
#2

Change
Код:
public OnPlayerEditDynamicObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
To
Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
Also
do like this..
Код:
	new Float:oldX, Float:oldY, Float:oldZ,
 	Float:oldRotX, Float:oldRotY, Float:oldRotZ;
	GetDynamicObjectPos(objectid, oldX, oldY, oldZ);
	GetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);

	if(response == EDIT_RESPONSE_CANCEL)
	{
		SetDynamicObjectPos(objectid, oldX, oldY, oldZ);
		SetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
	}
instead of
Код:
	if(response == EDIT_RESPONSE_CANCEL)
	{
		//The player cancelled, so put the object back to it's old position
		if(!playerobject) //Object is not a playerobject
		{
			SetDynamicObjectPos(objectid, oldX, oldY, oldZ);
			SetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
		}
	}
Reply
#3

fixed thank you
Reply


Forum Jump:


Users browsing this thread: