OnPlayerEditDynamicObject on CrashDetect
#4

Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
	printf("Debug: playerid: %i, objectid: %i, response: %i, X: %f, Y: %f, Z: %f, rX: %f, rY: %f, rZ: %f", playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
	if(oEdit[playerid] == 1)
	{
		idx = oEditID[playerid];
		if(response == EDIT_RESPONSE_UPDATE)
		{
		    SetDynamicObjectPos(objectid, x, y, z);
			SetDynamicObjectRot(objectid, rx, ry, rz);
		}
		else if(response == EDIT_RESPONSE_CANCEL)
		{
		    SetDynamicObjectPos(objectid, oPos[playerid][0], oPos[playerid][1], oPos[playerid][2]);
			SetDynamicObjectRot(objectid, oRot[playerid][0], oRot[playerid][1], oRot[playerid][2]);
			oPos[playerid][0] = 0; oPos[playerid][1] = 0; oPos[playerid][2] = 0;
			oRot[playerid][0] = 0; oRot[playerid][1] = 0; oRot[playerid][2] = 0;
			oEdit[playerid] = 0;
			oEditID[playerid] = 0;
			format(string, sizeof(string), " Cancelled Edit Object ID %d.", idx);
			SendClientMessage(playerid, COLOR_WHITE, string);
		}
		else if(response == EDIT_RESPONSE_FINAL)
		{
			SetDynamicObjectPos(objectid, x, y, z);
			SetDynamicObjectRot(objectid, rx, ry, rz);
			if(oEdit[playerid] == 1)
			{
			    ObjectInfo[idx][oX] = x;
				ObjectInfo[idx][oY] = y;
				ObjectInfo[idx][oZ] = z;
				ObjectInfo[idx][oRX] = rx;
				ObjectInfo[idx][oRY] = ry;
				ObjectInfo[idx][oRZ] = rz;
			    oEdit[playerid] = 0;
			    oEditID[playerid] = 0;
			    format(string, sizeof(string), "Finished Edit Object ID %d.", idx);
			    SendClientMessage(playerid, COLOR_WHITE, string);
				SaveObj();
			}
		}
	}
        return 1;
}
Use this instead and post here what it prints out in the server logs after the server crashes.
Reply


Messages In This Thread
OnPlayerEditDynamicObject on CrashDetect - by qmnty - 27.02.2015, 02:28
Re: OnPlayerEditDynamicObject on CrashDetect - by Crayder - 27.02.2015, 02:30
Re: OnPlayerEditDynamicObject on CrashDetect - by qmnty - 28.02.2015, 22:24
Re: OnPlayerEditDynamicObject on CrashDetect - by maramizo - 28.02.2015, 22:28
Re: OnPlayerEditDynamicObject on CrashDetect - by Crayder - 01.03.2015, 03:07

Forum Jump:


Users browsing this thread: 1 Guest(s)